> So, to answer your question, the only computational overhead with a
> data declaration is the extra memory and time to store and process the
> constructor tags.  It usually isn't noticeable, but sometimes the
> difference can be important.

Is there also potentially overhead due to laziness?  I mean, in this
case:

        newtype Fast = Fast Int

If you have a Fast value, you know you've got a real Int, not a thunk,
right?  But here:

        data Slow = Slow Int

Doesn't a Slow value remain unevaluated until you pattern match out the
Int?
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to