[Haskell-beginners] accessor function scope
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Tue Apr 7 13:38:16 EDT 2009
On 2009 Apr 7, at 9:15, Daniel Fischer wrote:
> Yes, they're called algebraic datatypes, but I'm not sure if a type
> must have
> more than one constructor to qualify as such.
An ADT is any type expressible by a combination of sum and product
types, IIRC. Single constructor types are product types, multiple
constructors are sums of product types. (Note that this leaves out
"data Nil"; that's why it's an extension. "data Nil = Nil" is
vacuously an ADT.)
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20090407/9275ed20/PGP.bin
More information about the Beginners
mailing list