stil4m / elm-syntax / Elm.Syntax.TypeAnnotation

This syntax represents the type annotation syntax. For example:

Int -> String

Types


type TypeAnnotation
    = GenericType String
    | Typed (Elm.Syntax.Node.Node ( Elm.Syntax.ModuleName.ModuleName, String )) (List (Elm.Syntax.Node.Node TypeAnnotation))
    | Unit
    | Tupled (List (Elm.Syntax.Node.Node TypeAnnotation))
    | Record RecordDefinition
    | GenericRecord (Elm.Syntax.Node.Node String) (Elm.Syntax.Node.Node RecordDefinition)
    | FunctionTypeAnnotation (Elm.Syntax.Node.Node TypeAnnotation) (Elm.Syntax.Node.Node TypeAnnotation)

Custom type for different type annotations. For example:


type alias RecordDefinition =
List (Elm.Syntax.Node.Node RecordField)

A list of fields in-order of a record type annotation.


type alias RecordField =
( Elm.Syntax.Node.Node String
, Elm.Syntax.Node.Node TypeAnnotation 
)

Single field of a record. A name and its type.

Serialization

encode : TypeAnnotation -> Json.Encode.Value

Encode a TypeAnnotation syntax element to JSON.

decoder : Json.Decode.Decoder TypeAnnotation

JSON decoder for a TypeAnnotation syntax element.