What is the difference between empty list [] and list with one unit element [()]?



Or, yet:

():[()] --is legal
10:[()] --is not

One list can contain elements of a
single type. Since the type of () is
() (element constructors  and types
are allowed to have the same name),
a list of type [()] can only contain
elements of type (), i.e., ()s. Try
this is ghci:

:t [()]
:t [(),(),(),()]

Best,
MaurĂ­cio

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to