
9 Jan
2014
9 Jan
'14
5:56 p.m.
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.