newtype | data

Mark Carroll mark@chaos.x-philes.com
Fri, 5 Oct 2001 12:29:49 -0400 (EDT)


Why does "newtype" exist, instead of letting people always use "data" and
still get maximum efficiency? After all, surely the implementation is an
implementation detail - a compiler could see the use of "data" with a
unary constructor and implement it as it does "newtype", instead of making
the programmer worry about how things are actually represented?

I'm obviously missing something obvious here; I'm hoping to learn what.
(-:

-- Mark