Represents a Node
of the AST (Abstract Syntax Tree).
The purpose of this type is to add the information of the Range
, i.e. where in the source code the
element of the tree was found.
Base representation for a syntax node in a source file.
empty : a -> Node a
Create a Node with an empty range.
combine : (Node a -> Node b -> c) -> Node a -> Node b -> Node c
Combine two nodes, constructing a new node which will have the outer most range of the child nodes
range : Node a -> Elm.Syntax.Range.Range
Extract the range out of a Node a
value : Node a -> a
Extract the value (a
) out of a Node a
map : (a -> b) -> Node a -> Node b
Map the value within a node leaving the range untouched
encode : (a -> Json.Encode.Value) -> Node a -> Json.Encode.Value
Encode a Node
into JSON
decoder : Json.Decode.Decoder a -> Json.Decode.Decoder (Node a)
A JSON decoder for Node