stil4m/elm-syntax/6.0.0

NOTE: the latest version is 7.3.9

Elm.Syntax.Type

#Type Syntax

This syntax represents custom types. For example:

{-| This is a person
-}
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 deines the syntax for a custom type. All information that you can define in on 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.