stil4m / elm-syntax / Elm.Syntax.Type

This syntax represents custom types. For example:

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

Types


type alias Type =
{ documentation : Maybe (Elm.Syntax.Node.Node Elm.Syntax.Documentation.Documentation)
, name : Elm.Syntax.Node.Node String
, generics : List (Elm.Syntax.Node.Node String)
, constructors : List (Elm.Syntax.Node.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 : Elm.Syntax.Node.Node String
, arguments : List (Elm.Syntax.Node.Node Elm.Syntax.TypeAnnotation.TypeAnnotation) 
}

Syntax for a custom type value constructor.

Serialization

encode : Type -> Json.Encode.Value

Encode a Type syntax element to JSON.

decoder : Json.Decode.Decoder Type

JSON decoder for a Type syntax element.