Skip to content

Type system diagram

tim-hardcastle edited this page Aug 1, 2024 · 24 revisions

Here is a diagram of the type system. It contains a few types we haven't met yet, such as func.

It does not show the nullable twin of each standard type, with the exception of single? because that would complicate the diagram to little purpose.

The error type is shown off to one side because it doesn't belong anywhere in the type hierarchy: not belonging is what it's for.

graph TD;
    any-->single?;
    any-->tuple
    single?-->single
    single?-->null
    single-->intlike;
    intlike-->int
    intlike-->I[clones of int];
    single-->floatlike;
    floatlike-->float
    floatlike-->F[clones of float];
    single-->stringlike;
    stringlike-->string
    string-->V[varchar];
    stringlike-->S[clones of string]
    single-->bool;
    single-->null;
    single-->struct;
    single-->listlike;
    listlike-->list
    listlike-->L[clones of list]
    single-->pairlike;
    pairlike-->pair
    pairlike-->P[clones of pair]
    single-->label;
    single-->setlike;
    setlike-->set
    setlike-->Z[clones of set]
    single-->maplike
    maplike-->M[map];
    maplike-->N[clones of map]
    single-->func;
    single-->type;
    struct-->X[user-defined structs];
    single-->enum
    enum-->Y[user-defined enums];
    error
Loading

🧿 Pipefish

Clone this wiki locally