[Haskell-cafe] Types in bounds

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Mon Sep 1 05:49:59 EDT 2008


>> type Point = (Int, Int)

> 2. using "type" (instead of "data") is generally a bad idea.

and in this case, using "data Point ..." would allow to
define a "smart constructor" that can at least check at run-time
whether the bounds are met. - J.W.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080901/0414ae2c/signature.bin


More information about the Haskell-Cafe mailing list