Some values have known locations in the evaluated source code. This module provides functions for working with them.
Represents a value a
with location information.
Represents the location of a value in the source code. Known offsets or unknown.
{ start : ( Basics.Int
, Basics.Int )
, end : ( Basics.Int
, Basics.Int )
}
Represents the offsets of the start and the end of a value in the source code.
at : ( Basics.Int, Basics.Int ) -> ( Basics.Int, Basics.Int ) -> a -> Located a
Wraps a
in a location at given offsets
getValue : Located a -> a
Extracts the located value
map : (a -> b) -> Located a -> Located b
Applies a function to the located value
sameAs : Located a -> b -> Located b
Assigns location information from a
to b
unknown : a -> Located a
Wraps a
in an unknown location
getLocation : Located a -> Location
Extract the location of a located value
getOffsets : Located a -> Maybe Offsets
Extract the offsets of the located value (if known)