lerzegov/elm-syntax-fork/1.1.0

Elm.Syntax.TypeAnnotation

This syntax represents the type annotation syntax. For example:

Int -> String

Types

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

Custom type for different type annotations. For example:

  • GenericType: a
  • Typed: Maybe (Int -> String)
  • Unit: ()
  • Tuples: (a, b, c)
  • Record: { name : String}
  • GenericRecord: { a | name : String}
  • FunctionTypeAnnotation: Int -> String
type alias RecordDefinition =
List (Node RecordField)

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

type alias RecordField =
( Node String, Node TypeAnnotation )

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

Serialization

Encode a TypeAnnotation syntax element to JSON.

JSON decoder for a TypeAnnotation syntax element.