newtype pattern matching

Martin Norbäck d95mback@dtek.chalmers.se
22 Jan 2002 17:06:52 +0100


tis 2002-01-22 klockan 15.52 skrev Feuer:
> Why is pattern matching on newtypes lazy?  Does this add to efficiency
> somehow?  If not, it seems to be just another rule to keep straight.

That's the difference between newtype and data. Newtypes are unboxed, so
there is no constructor to match on. Pattern matching on newtypes is
only a type-checker thing, the constructor doesn't exist.

Regards,

	Martin

-- 
[ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN:
4439498 ]
    Opinions expressed above are mine, and not those of my future
employees.
SIGBORE: Signature boring error, core dumped