[Haskell-cafe] newtype is superfluous

Bulat Ziganshin bulatz at HotPOP.com
Sat Oct 15 02:31:13 EDT 2005

Hello Haskell,

  number of type definition statements in Haskell (data, type, newtype) is a bit
too large. at least, newtype definition seems to be superfluous - it
can be replaced by the same `data` definition:

newtype A = A Int
data A = A Int

is equal, excluding for internal representation. we can exclude
newtype definition and rely on the assumption that compiler is smart
enough to optimize `data` definitions with just one constructor
containing one field

(moreover, i prefer something like `alias` to defining aliases for
existing types, and `type` for defining new types, but i think it's a
bit too late to complain about it :) )

Best regards,
 Bulat                          mailto:bulatz at HotPOP.com

More information about the Haskell-Cafe mailing list