Interface DatatypeCreation<Name>

interface DatatypeCreation<Name extends string> {
    createDatatypes(...datatypes: Datatype<Name>[]): DatatypeSort<Name>[];
    createPolymorphicDatatype(
        typeParams: AnySort<Name>[],
        datatype: Datatype<Name>,
    ): DatatypeSort<Name>;
    (name: string): Datatype<Name>;
}

Type Parameters

  • Name extends string

Methods

  • Create a single polymorphic datatype sort with explicit type parameters. Type parameters should be sorts created with Context.TypeVariable. Self-recursive fields in constructors may reference the Datatype object directly.

    Parameters

    • typeParams: AnySort<Name>[]

      Array of type variable sorts

    • datatype: Datatype<Name>

      Datatype declaration with constructors

    Returns DatatypeSort<Name>

    Created DatatypeSort instance