-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Apollo now support empty lists. However it should be noted that an empty list is not a list but a type of its own, namely TListEmpty.
This means that a list cannot be defined as empty, e.g.
apollo> a: [Int] = []
Type error: definition of [Integer], but assigned to []
Here, we get a type error as expected.
However, once we cons an element to an empty list, then it turns into a full fledged list type and type checking takes care of verifying if, say, a definition is correct, as in
apollo> b: [Bool] = True :: []
apollo> b
[True]