Skip to content

Empty list type #59

@rezanayebi

Description

@rezanayebi

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]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions