Skip to content

Commit

Permalink
Make () an error component (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
int-index authored and mrkkrp committed Mar 5, 2017
1 parent 936635c commit ae19a87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@

* Dropped support for GHC 7.6.

* Added an `ErrorComponent` instance for `()`.

## Megaparsec 5.2.0

* Added `MonadParsec` instance for `RWST`.
Expand Down
4 changes: 4 additions & 0 deletions Text/Megaparsec/Error.hs
Expand Up @@ -100,6 +100,10 @@ class Ord e => ErrorComponent e where
-> Pos -- ^ Actual indentation level
-> e

instance ErrorComponent () where
representFail _ = ()
representIndentation _ _ _ = ()

-- | “Default error component”. This in our instance of 'ErrorComponent'
-- provided out-of-box.
--
Expand Down

0 comments on commit ae19a87

Please sign in to comment.