bricks-syntax- ...

Safe HaskellSafe



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 number
  • SourceRange - a pair of SourcePositions indicating the start and end of some expression
  • SourceName - 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 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.

newtype SourceName a Source #


SourceName a