stil4m / elm-syntax / Elm.Syntax.Declaration

Syntax for the different top-level declarations in Elm. These can be one of the following (all declared in Declaration):

Types


type Declaration
    = FunctionDeclaration Elm.Syntax.Expression.Function
    | AliasDeclaration Elm.Syntax.TypeAlias.TypeAlias
    | CustomTypeDeclaration Elm.Syntax.Type.Type
    | PortDeclaration Elm.Syntax.Signature.Signature
    | InfixDeclaration Elm.Syntax.Infix.Infix
    | Destructuring (Elm.Syntax.Node.Node Elm.Syntax.Pattern.Pattern) (Elm.Syntax.Node.Node Elm.Syntax.Expression.Expression)

Custom type that represents all different top-level declarations.

Serialization

encode : Declaration -> Json.Encode.Value

Encode a Declaration syntax element to JSON.

decoder : Json.Decode.Decoder Declaration

JSON decoder for a Declaration syntax element.