Fix sample programs
This commit is contained in:
parent
a2f61ea910
commit
a87862a99f
19 changed files with 8 additions and 185 deletions
|
|
@ -1,13 +1,16 @@
|
|||
data Either(a b) where
|
||||
Left: a -> Either (a b)
|
||||
Right: b -> Either (a b)
|
||||
data Either (a b) where
|
||||
Left : a -> Either (a b)
|
||||
Right : b -> Either (a b)
|
||||
|
||||
unwrapLeft : Either (a b) -> a
|
||||
unwrapLeft x = case x of
|
||||
Left y => y
|
||||
|
||||
unwrapRight : Either (a b) -> b
|
||||
unwrapRight x = case x of
|
||||
Right y => y
|
||||
|
||||
wow : Either (Int Char)
|
||||
wow = Left 5
|
||||
|
||||
main = unwrapLeft wow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue