lerzegov/elm-syntax-fork/1.1.0

Elm.Syntax.Type

This syntax represents custom types. For example:

{-| This is a color
-}
type Color
    = Blue
    | Red

Types

type alias Type =
{ documentation : Maybe (Node Documentation)
, name : Node String
, generics : List (Node String)
, constructors : List (Node ValueConstructor)
}

Type alias that defines the syntax for a custom type. All information that you can define in a type alias is embedded.

type alias ValueConstructor =
{ name : Node String
, arguments : List (Node TypeAnnotation)
}

Syntax for a custom type value constructor.

Serialization

encode : Type -> Value

Encode a Type syntax element to JSON.

decoder : Decoder Type

JSON decoder for a Type syntax element.