[Haskell-cafe] Why Maybe exists if there is Either?
Mateusz Kowalczyk
fuuzetsu at fuuzetsu.co.uk
Thu Jan 9 22:56:37 UTC 2014
On 09/01/14 20:57, Patrick Hurst wrote:
> Why have Bool? Just let true = 1, false = 0, (||) = (+), (&&) = (*).
>
> Why have Ordering? Just use Integer and let lt = -1, eq = 0, gt = 1.
>
> Why have three-tuples (a, b, c)? Just use ((a, b), c).
>
> Why have Data.Map a b? Just use a -> Maybe b. You don't even need an Ord
> constraint any more!
>
> Why have Data.Set a? Just use a -> Bool (or, a -> Integer).
>
> For that matter, why use algebraic data types? data Person = Person String
> Int is isomorphic to type Person = (String, Int).
>
>
>
Hey, you're right, I should have been using C all along!
Thanks for showing me the light.
--
Mateusz K.
More information about the Haskell-Cafe
mailing list