Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
PLMZ
iTypes
Commits
c2722538
Commit
c2722538
authored
Sep 06, 2019
by
André Pacak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code in haskell implementation
parent
f573137d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
haskell/src/SumTypes/EliminateContextArgument.hs
haskell/src/SumTypes/EliminateContextArgument.hs
+0
-1
haskell/test/SumTypes/TestCases.hs
haskell/test/SumTypes/TestCases.hs
+1
-1
No files found.
haskell/src/SumTypes/EliminateContextArgument.hs
View file @
c2722538
...
...
@@ -221,7 +221,6 @@ checkType p@(Case e n1 t1 n2 t2 _) = do
checkType
p
@
(
Tag
n
t
_
)
=
do
ty
<-
requiredType
p
types
<-
matchVariant
ty
(
show
p
)
let
lty
=
Map
.
lookup
n
types
lty
<-
liftMaybe
(
Map
.
lookup
n
types
)
"Label not contained in Variant"
checkType
t
checkType
p
@
(
Match
m
cases
_
)
=
do
...
...
haskell/test/SumTypes/TestCases.hs
View file @
c2722538
...
...
@@ -45,7 +45,7 @@ tFailCaseRightShadowBinding = root $ (let' "a" zero (anno Nat (case' (anno (Sum
tFailWrongTypeForTaggedLabel
=
root
$
(
anno
(
Variant
(
fromList
[(
"c"
,
Nat
),
(
"a"
,
Nat
),
(
"b"
,
(
Fun
Nat
Nat
))]))
(
tag
"b"
zero
))
tFailWrongLabel
=
root
$
(
anno
(
Variant
(
fromList
[(
"c"
,
Nat
),
(
"a"
,
Nat
),
(
"b"
,
(
Fun
Nat
Nat
))]))
(
tag
"d"
zero
))
tFailMatchNotVariant
=
root
$
(
anno
Nat
(
match1
(
anno
(
Variant
(
fromList
[(
"a"
,
Nat
)]))
zero
)
(
"a"
,
"x"
,
succ
$
var
"x"
)))
tFailMatchNotVariant
=
root
$
(
anno
Nat
(
match1
(
anno
Nat
zero
)
(
"a"
,
"x"
,
succ
$
var
"x"
)))
tFailMatchUnequalTypesForCases
=
root
$
(
anno
Nat
(
match2
(
anno
(
Variant
(
fromList
[(
"a"
,
Nat
),
(
"b"
,
(
Fun
Nat
Nat
))]))
(
tag
"b"
(
lam
"x"
(
var
"x"
))))
(
"a"
,
"x"
,
succ
$
var
"x"
)
(
"b"
,
"x"
,
(
var
"x"
)
)))
-- tOkMatchSingle = root $ (anno Nat (match1 (anno (Variant (fromList [("a", Nat)])) (tag "a" zero)) ("a", "x", succ $ var "x")))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment