Next | Types Are Theorems; Programs Are Proofs | 26 |
How do you use a value of type Either a b?
It's a little complicated
In Haskell it looks like this:
-- z :: Either a b
case z of Left x -> … x … -- a -> c Right y -> … y … -- b -> c
:: c
continued...
Next | Copyright © 2014 M. J. Dominus |