[Haskell-cafe] Data & newtype differences. Today: strictness
yves.pares at gmail.com
Sun Jan 22 15:23:51 CET 2012
Big sum up of everything:
If TestN is a newtype constructor, then
'TestN undefined' and 'undefined' are exactly the same thing.
2012/1/22 Yitzchak Gale <gale at sefer.org>
> Yves Parès wrote:
> >> Is there some litterature expliciting in a less empiric way than I did
> >> differences like this between data and newtype? I've never come against
> >> such documentation through all my learning of Haskell, yet I think it's
> >> important point.
> Roman Cheplyaka wrote:
> > See the Haskell report, section 3.17.2 "Informal Semantics of Pattern
> > Matching" .
> And section 4.2.3 of the report  addresses exactly your points very
> "A type created by newtype differs from an algebraic datatype in that...
> The following examples clarify the differences between data
> (algebraic datatypes), type (type synonyms), and newtype
> (renaming types)..."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe