Fix sample programs

This commit is contained in:
Martin Fredin 2023-04-29 16:02:51 +02:00
parent a2f61ea910
commit a87862a99f
19 changed files with 8 additions and 185 deletions

View file

@ -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