[Integer] is the type meaning "a list of integer values". Can there be a value in this type that doesn't actually contain any integers? Yes, the empty list [] contains zero integers.
[[Integer]] is the type meaning "a list of lists of integer values". Can there be a value in this type that doesn't actually contain any lists? Yes, the empty list [] contains zero lists.
Note that [] with type [[Integer]] is quite different from [[]] with the same type. The first represents the empty list of lists. The second is a non-empty list; it contains exactly one element, which is itself the empty list. A box containing one empty box is not the same thing as a box containing nothing at all! We could of course have [[], [], [], []] as well, where the outer non-empty list contains several elements, each of which is a empty list.
If it helps, think of the type [[Integer]] as representing list of rows, where each row is a list of integers. For example, the following:
11, 12, 13;
21, 22, 23, 24;
31;
is one way of visualising the [[Integer]] value [[11, 12, 13], [21, 22, 23, 24], [31]], where I've used commas to separate elements of the inner lists, and also semicolons to terminate each row (also line breaks to make it easy to read).
In that scheme, [[]] is the list consisting of one empty row. so you'd write it as just a single line ending in a semicolon. Whereas [] is a list with no rows at all, not even empty ones. So you'd write it as a blank file with no semicolons.
If that helped, then it should be easy to see how that applies to more abstract types like [[a]]. In general tough, [] with some list type (regardless of what type is written between the brackets) is always the list consisting of zero of the element type; it doesn't matter whether the element type itself is a list (or anything else with a concept of "empty").
list<list<T>>()in C++, except that the innerlist<T>is inferred. - Jon Purdy[String]. It's very natural to think that you could have the value[] :: [String], it's just an empty list of strings. ButStringis just a type alias for[Char], so really[] :: [String]is[] :: [[Char]]. This would just be a special case of[[a]]. - bheklilr[] :: [[Int]]is, for instance, the list (actually, the set) of all collections of integer numbers which sum up to π. Or, more real-worldly: take a list of groups of people. If you first filter out all groups with any adult in them, and then also all with any children, the only group that remains is the empty group, i.e. you'd get[[]] :: [[Person]]. However, you would probably have only considered nonempty groups in the first place, so[] :: [Person]was never in there, so actually you'd get[] :: [[Person]]- leftaroundabout[a,b,c]are really just syntactic sugar fora:b:c:[]. For instance,[[1,2], [3,4], [5]]is syntactic sugar for(1:2:[]) : (3:4:[]) : (5:[]) : [], where the[]at the end is an empty list of type[[Int]]. - leftaroundabout