churf/sample-programs/mono-2.crf

14 lines
204 B
Text

data Either(a b) where
Left: a -> Either (a b)
Right: b -> Either (a b)
unwrapLeft x = case x of
Left y => y
unwrapRight x = case x of
Right y => y
wow = Left 5
main = unwrapLeft wow