Joachim,

Don't stop at the booleans. Next you can define the natural numbers by

newtype Number = N (forall a.(a->a) -> (a->a))
--
Dan

On 3/7/07, Joachim Breitner <[EMAIL PROTECTED]> wrote:

For a while I have been thinking: Isn't there a way to get rid of the
intermediate Maybe construct in a common expression like "fromMaybe
default . lookup". It seems that a way to do that would be to pass more
information to the Maybe-generating function: What to do with a
Just-Value, and what to return in case of Nothing. This leads to a new
definion of the Maybe data type as a function. Later I discovered that
this seems to work for any algebraic data type.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to