[Haskell-cafe] Re: Datatypes - Haskell

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Tue Feb 12 10:15:07 EST 2008

"Richard A. O'Keefe" <ok at cs.otago.ac.nz> writes:

> On the subject of data types, I've recently seen Haskell code using
> 	data Foo ... = Foo { ... }
> where I would have used newtype instead of data.  When is it a good
> idea to avoid newtype?

When the code was written before newtype was introduced into
the language?  Also when { ... } is not a single type.

Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk

More information about the Haskell-Cafe mailing list