kempe-0.1.0.0: lib/either.kmp
; I'm not sure how useful this module is but I have it as a test for the
; typechecker and I guess to show how pattern matching works.
type Either a b { Left a | Right b }
isLeft : ((Either a) b) -- Bool
=: [
{ case
| Left -> drop True
| Right -> drop False
}
]
isRight : ((Either a) b) -- Bool
=: [
{ case
| Right -> drop True
| Left -> drop False
}
]