[Haskell-cafe] Newbie Question on type constructors

Finn Wilcox finnw at sucs.org
Mon Nov 1 14:09:26 EST 2004


On Mon, 1 Nov 2004, Ben Rudiak-Gould wrote:

> In particular, one cannot write an invert :: (a->b) -> Maybe 
> (b->a) which never returns a wrong answer, except for invert = const 
> Nothing

How about:

invert = undefined

This never returns an answer at all, so it can't return a wrong one!

Finn


More information about the Haskell-Cafe mailing list