doctest-0.22.6: Test interactive Haskell examples

Safe Haskell | Safe-Inferred
Language | Haskell2010

Test.DocTest.Internal.Location

Synopsis

- data Located a = Located Location a
- toLocated :: Located a -> Located a
- unLoc :: Located a -> a
- noLocation :: a -> Located a
- type Line = Int
- data Location
  - = UnhelpfulLocation String
  - | Location FilePath Line
- enumerate :: Location -> [Location]
- toLocation :: SrcSpan -> Location

# Documentation

data Located a Source #

A thing with a location attached.

Constructors

Located Location a |

#### Instances

Instances details

Functor Located Source # |
Instance details Defined in Location Methods fmap :: (a -> b) -> Located a -> Located b Source # (<$) :: a -> Located b -> Located a Source #
Show a => Show (Located a) Source # |
Instance details Defined in Location Methods showsPrec :: Int -> Located a -> ShowS Source # show :: Located a -> String Source # showList :: [Located a] -> ShowS Source #
NFData a => NFData (Located a) Source # |
Instance details Defined in Location Methods rnf :: Located a -> () Source #
Eq a => Eq (Located a) Source # |
Instance details Defined in Location Methods (==) :: Located a -> Located a -> Bool Source # (/=) :: Located a -> Located a -> Bool Source #

toLocated :: Located a -> Located a Source #

Convert a GHC located thing to a located thing.

unLoc :: Located a -> a Source #

Discard location information.

noLocation :: a -> Located a Source #

Add dummy location information.

type Line = Int Source #

A line number.

data Location Source #

A combination of file name and line number.

Constructors

UnhelpfulLocation String |
Location FilePath Line |

#### Instances

Instances details

Show Location Source # |
Instance details Defined in Location Methods showsPrec :: Int -> Location -> ShowS Source # show :: Location -> String Source # showList :: [Location] -> ShowS Source #
NFData Location Source # |
Instance details Defined in Location Methods rnf :: Location -> () Source #
Eq Location Source # |
Instance details Defined in Location Methods (==) :: Location -> Location -> Bool Source # (/=) :: Location -> Location -> Bool Source #

enumerate :: Location -> [Location] Source #

Create a list from a location, by repeatedly increasing the line number by one.

toLocation :: SrcSpan -> Location Source #

Convert a GHC source span to a location.