[Haskell-cafe] Definition of List type?

Gregory Crosswhite gcross at phys.washington.edu
Fri Jul 30 14:50:56 EDT 2010


 List are actually built in to the language, but they are roughly
equivalent to the following definition:

data List a =
    []
 |  a:List a

The reason why this definition never actually appears is because it
defines the constructors using operators rather than names, which is not
allowed in vanilla Haskell.  (There is an extension, TypeOperators,
however, that does allow this.)

Cheers,
Greg

On 07/30/10 11:41, michael rice wrote:
> From: Data.Maybe
>
> Description
> The Maybe type, and associated operations.
>
>
> From: Data.List
>
> Description
> Operations on lists.
>
>
> One description has the type and associated operations, the other only
> has the operations.
>
> Where can I find the type definition for List, and why isn't it in
> Data.List?
>
> Michael
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100730/1978baaa/attachment.html


More information about the Haskell-Cafe mailing list