Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class HasLocation a where
- locStart :: HasLocation a => a -> Position
- locEnd :: HasLocation a => a -> Position
- data Located a = Located {}
- noLoc :: a -> Located a
- at :: HasLocation loc => a -> loc -> Located a
- atBin :: (HasLocation loc0, HasLocation loc1) => a -> loc0 -> loc1 -> Located a
- atList :: a -> [SrcLoc] -> Located a
- unLoc :: Located a -> a
- extendLoc :: SrcLoc -> Located a -> Located a
- type Source = Maybe String
- data SrcLoc
- srcLoclinePragma :: SrcLoc -> Maybe (Int, String)
- srcRange :: SrcLoc -> Range
- srcStart :: SrcLoc -> Position
- srcEnd :: SrcLoc -> Position
- data Range = Range {
- rangeStart :: !Position
- rangeEnd :: !Position
- data Position = Position {}
- zeroPosition :: Position
- smallerOf :: Position -> Position -> Position
- largerOf :: Position -> Position -> Position
- movePos :: Position -> Char -> Position
- movesPos :: Position -> String -> Position
Documentation
class HasLocation a where Source #
Instances
locStart :: HasLocation a => a -> Position Source #
locEnd :: HasLocation a => a -> Position Source #
Things that carry a range in the source syntax.
Instances
Functor Located Source # | |
Foldable Located Source # | |
Defined in Ivory.Language.Syntax.Concrete.Location fold :: Monoid m => Located m -> m # foldMap :: Monoid m => (a -> m) -> Located a -> m # foldr :: (a -> b -> b) -> b -> Located a -> b # foldr' :: (a -> b -> b) -> b -> Located a -> b # foldl :: (b -> a -> b) -> b -> Located a -> b # foldl' :: (b -> a -> b) -> b -> Located a -> b # foldr1 :: (a -> a -> a) -> Located a -> a # foldl1 :: (a -> a -> a) -> Located a -> a # elem :: Eq a => a -> Located a -> Bool # maximum :: Ord a => Located a -> a # minimum :: Ord a => Located a -> a # | |
Traversable Located Source # | |
Defined in Ivory.Language.Syntax.Concrete.Location | |
Eq a => Eq (Located a) Source # | |
Ord a => Ord (Located a) Source # | |
Defined in Ivory.Language.Syntax.Concrete.Location | |
Read a => Read (Located a) Source # | |
Show a => Show (Located a) Source # | |
HasLocation (Located a) Source # | |
at :: HasLocation loc => a -> loc -> Located a Source #
Attach location information to a value.
atBin :: (HasLocation loc0, HasLocation loc1) => a -> loc0 -> loc1 -> Located a Source #
at
helper for binary operators.
A range in the program source.
srcLoclinePragma :: SrcLoc -> Maybe (Int, String) Source #
Get info to build a line pragma from a SrcLoc
. Returns a value only if
there is a valid range. Returns the starting line number.
The region between to source positions.
Range | |
|
Position information within a source.
zeroPosition :: Position Source #
Starting position.