errata
Source code error pretty printing
https://github.com/1Computer1/errata
| LTS Haskell 24.17: | 0.4.0.3 |
| Stackage Nightly 2025-07-14: | 0.4.0.3 |
| Latest on Hackage: | 0.4.0.3 |
errata-0.4.0.3@sha256:b66989752fd374d984a7a35ef22b7057791aef33cf4191a5cc467f412f7669a7,2335Module documentation for 0.4.0.3
- Errata
- Errata.Internal
- Errata.Source
- Errata.Styles
- Errata.Types
Errata
Errata is an extremely customizable error pretty printer that can handle many kinds of error formatting.
Features
Errata can handle errors that are all over the source or errors that are connected to each other spanning multiple lines. You can be as simple or as fancy as you like!
You can also customize the format of the printer in several ways:
- Custom messages and labels
- Custom character sets for symbols
- Highlighting the source, messages, and symbols
Examples
A clean, modern error message that is trying to be helpful:

A busy error message with underlining and connections:

Changes
Changelog
Errata uses PVP Versioning.
0.4.0.3
- Updated for GHC 9.10.
0.4.0.2
- Updated for GHC 9.8.
0.4.0.1
- Updated for GHC 9.4 and 9.6.
0.4.0.0
-
Added styling individual pointers with
PointerStyle(e.g. characters, highlighting).-
This changes how
styleLineandhighlightworks and movesstyleUnderlinetoPointerStyle. -
This also adds a
PointerStyleparameter to the helper functions so e.g.blockSimple fancyStyle ...should now beblockSimple fancyStyle fancyPointer .... -
Crazy example from the tests (you can imagine coloring things differently):
an error --> here:1:1 | 1 | abcdefghijk | .. ~~ ^^ z | | : | | 2 y | 1 x 2 | lmnopqrstuv | ''' w an error occurred here
-
-
Moved existing and added new premade styles to
Errata.Styles.Erratano longer exports premade styles. Also movedhighlightthere. -
Added support for characters with different widths (full-width, combining characters, others). The cabal flag
usewcwidth(default false) can be enabled to use the nativewcwidthfunction. -
Added support for replacing tabs with spaces with the
styleTabWidthoption inStyle(defaults to 4). -
Added option for the lines before and after the omission line with
styleExtraLinesAfterandstyleExtraLinesBeforeinStyle. -
Added option for padding lines before and after the source
stylePaddingTopandstylePaddingBottominStyle. -
Added option for disabling the hook with
styleEnableHookinPointerStyle. -
Added option for toggling all decorations completely with
styleEnableDecorationsinStyle. Useful if you only want highlighting and not underlining. Combine withstylePaddingTop = Falsefor a compact source code block. -
Added option for toggling the line prefixes with
styleEnableLinePrefixinStyle. -
Added
Showinstances to all the types. Style functions are applied to some sample text. -
Changed
Monoidconstraint ofSourceto just requiring anemptySourcevalue. -
Fixed trailing whitespace in the omission line.
0.3.0.0
-
Support GHC 9.0.1 (and eventually 9.2).
-
Optimized rendering of errors (#5). Huge thanks to RiugaBachi for this! This also adds a
Monoidconstraint toSource. -
Reworked the pretty printer so that it no longer prints trailing whitespace in most places.
-
Removed the
errataBlockfield, and only useerrataBlocks. Now, anErratacan have no blocks attached to it at all. They will also no longer be sorted beforehand, as that should be up to the user. -
Removed
prettyErrorsNE, as it is no longer useful for what it was documented for. -
Fixed the rendering of
Blocks with noPointers adding extra blank lines.
0.2.0.0
-
Added new
blockHeaderfield toBlock, which will put text underneath the location text but above the source lines. This also affects all the block helper functions, which now have an argument for the header. -
The
blockSimpleandblockSimple'functions are now passed tuples of positions and labels instead ofInts, which is more consistent with the rest of the helper functions. -
Defined type synonyms for line, column, headers, bodies, and labels, for the purpose of documentation. It should be much easier to know what is expected by just reading the types now.
-
Use
GHC.Arr.Arrayfor keeping source lines, which should be faster for indexing and should not force the individual lines until they are needed.
0.1.0.0
- Initial release.