This syntax represents the patterns. For example:
Just x as someMaybe
{name, age}
Custom type for all patterns such as:
AllPattern
: _
UnitPattern
: ()
CharPattern
: 'c'
StringPattern
: "hello"
IntPattern
: 42
HexPattern
: 0x11
FloatPattern
: 42.0
TuplePattern
: (a, b)
RecordPattern
: {name, age}
UnConsPattern
: x :: xs
ListPattern
: [ x, y ]
VarPattern
: x
NamedPattern
: Just _
AsPattern
: _ as x
ParenthesizedPattern
: ( _ )
{ moduleName : List String
, name : String
}
Qualified name reference such as Maybe.Just
.
moduleNames : Pattern -> List Elm.Syntax.ModuleName.ModuleName
Get all the modules names that are used in the pattern (and its nested patterns).
Use this to collect qualified patterns, such as Maybe.Just x
.
encode : Pattern -> Json.Encode.Value
Encode a Pattern
syntax element to JSON.
decoder : Json.Decode.Decoder Pattern
JSON decoder for a Pattern
syntax element.