
10 Oct
2008
10 Oct
'08
7:10 a.m.
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