2008/10/6 Arnar Birgisson <[EMAIL PROTECTED]>: > Ah, that's pretty neat and subtle. Now, say I have a type created with > data that has only one constructor. Couldn't the compiler optimize > away this unneccessary evaluation during pattern matching? I.e. it > would make what you just wrote implicit in that case. Or perhaps data > declarations with just one ctor should really be turned into newtypes > by the programmer?
Well, the trouble is that because there are differences in the termination behaviour of programs depending on whether something is a newtype or a data with a single constructor, I think automatic conversion of one to the other is avoided. _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
