| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Bricks.Source
Description
Source information is some form of description of where a Bricks expression or
term came from. This information is used to tag Expressions and Terms so
that our error messages can tell the user what parts of the Bricks source code
are relevant to the problem.
Overview of the types involved:
SourcePosition- a line and column numberSourceRange- a pair ofSourcePositions indicating the start and end of some expressionSourceName- a description of where the top-level expression was parsed from, such as a file path or a part of a REPL session.- '()' can be used as the source information type in cases where we do not actually care to retain any source information.
- data SourcePosition = SourcePosition {}
- show'sourcePosition :: SourcePosition -> Text
- data SourceRange = SourceRange {}
- show'sourceRange :: SourceRange -> Text
- sourceRange'join :: SourceRange -> SourceRange -> SourceRange
- sourceRangeMaybe'join :: Maybe SourceRange -> Maybe SourceRange -> Maybe SourceRange
- newtype SourceName a = SourceName a
Documentation
data SourcePosition Source #
An endpoint of a SourceRange.
Constructors
| SourcePosition | |
Fields | |
Instances
data SourceRange Source #
Start and end points for a span of text. When we parse text into an
Expression, we annotate it with source ranges so error messages that refer to
specific expressions can tell the user where in their Bricks code those
expressions are defined.
Constructors
| SourceRange | |
Fields | |
Instances
show'sourceRange :: SourceRange -> Text Source #
sourceRange'join :: SourceRange -> SourceRange -> SourceRange Source #
newtype SourceName a Source #
Constructors
| SourceName a |