[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").