Formerly Morgan-Stanley/morphir-elm. Search finds this package by either name.
A data type that represents a node in the IR
Represents a path in the IR. This is a recursive structure made up of the following building blocks:
The path should be constructed in a reverse order: the node at the top will be the last step in the path
Example usage:
type alias Foo =
{ field1 : Bool
, field2 :
{ field1 : Int
, field2 : ( String, Float )
}
}
NodePath.fromList [] -- Refers to type "Foo" itself
NodePath.fromList [ ChildByName "field1" ] -- Refers to Bool
NodePath.fromList [ ChildByName "field2", ChildByName "field1" ] -- Refers to Int
NodePath.fromList [ ChildByName "field2", ChildByName "field2", ChildByIndex 1 ] -- Refers to FloatRepresents a path to a child node
Try to parse a string into NodeID. Return an Error if it's not a valid NodeID.
Convert a NodeID to String.
Parse a String into a NodePath.
Convert a NodePath to String.
Get attribute from a module, type or value by NodeID. Return error, if the NodeID is invalid.
Applies the given map function to the attributes of every node of the given pattern.
Applies the given map function to the attributes of every node of the given type.
Applies the given map function to the attributes of every node of the given value.
Get type attribute by NodePath. Return an Error if the NodePath is invalid.
Get value attribute by NodePath. Return an Error if the NodePath is invalid.
Represents an error that might occur during node operations
Represents a node in the IR. Could be a Type, Value or Module