churf/sample-programs/mono-2.crf
2023-04-29 16:02:51 +02:00

17 lines
295 B
Text

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