pa-error-tree-0.1.0.0: Collect a tree of errors and pretty-print
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Error.Tree

Synopsis

Documentation

newtype ErrorTree Source #

A tree of Errors, with a single root Error and 0..n nested ErrorTrees.

top error
|
|-- error 1
| |
|  -- error 1.1
|
|-- error 2

Constructors

ErrorTree 

Instances

Instances details
IsString ErrorTree Source # 
Instance details

Defined in Data.Error.Tree

Show ErrorTree Source # 
Instance details

Defined in Data.Error.Tree

singleError :: Error -> ErrorTree Source #

Turn a single Error into an ErrorTree, a leaf.

errorTree :: Error -> NonEmpty Error -> ErrorTree Source #

Take a list of errors & create a new ErrorTree with the given Error as the root.

errorTreeContext :: Text -> ErrorTree -> ErrorTree Source #

Attach more context to the root Error of the ErrorTree, via errorContext.

nestedError :: Error -> ErrorTree -> ErrorTree Source #

Nest the given Error around the ErrorTree

top level error
|
-- nestedError
  |
  -- error 1
  |
  -- error 2

nestedMultiError :: Error -> NonEmpty ErrorTree -> ErrorTree Source #

Nest the given Error around the list of ErrorTrees.

top level error
|
|- nestedError1
| |
| -- error 1
| |
| -- error 2
|
|- nestedError 2