On Dec 17, 2007 10:47 PM, Nicholls, Mark <[EMAIL PROTECTED]> wrote: > "The constructor of a newtype must have exactly one field but `R' has > two In the newtype declaration for `Rectangle'" > > It doesn't like > > "newtype Rectangle = R Int Int"
A newtype can only have one constructor, with one argument, and is essentially a wrapper for that argument type. In the general case, you want to use "data" instead of "newtype": data Rectangle = R Int Int Stuart _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
