elm-in-elm / compiler / Elm.Data.Type

A data structure representing the Elm types.


type Type
    = Var Basics.Int
    | Function Type Type
    | Int
    | Float
    | Char
    | String
    | Bool
    | List Type
    | Unit
    | Tuple Type Type
    | Tuple3 Type Type Type
    | UserDefinedType ({ module_ : String, name : String }) (List Type)


type TypeArgument
    = ConcreteType Type
    | TypeVariable Elm.Data.VarName.VarName

Type argument of a polymorphic type.

Maybe Int
--> ConcreteType Int

Maybe a
--> TypeVariable "a"

isParametric : Type -> Basics.Bool

Does it contain lower-case type parameters?

varId : Type -> Maybe Basics.Int

Unwrap the ID of the type variable