Skip to content

Commit

Permalink
Adjust documentation for the ‘Hints’ type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkkrp committed Dec 9, 2017
1 parent 0754936 commit a69f955
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Text/Megaparsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ data Result t e a
= OK a -- ^ Parser succeeded
| Error (ParseError t e) -- ^ Parser failed

-- | 'Hints' represent collection of strings to be included into
-- 'ParserError' as “expected” message items when a parser fails without
-- consuming input right after successful parser that produced the hints.
-- | 'Hints' represent a collection of 'ErrorItem's to be included into
-- 'ParserError' (when it's a 'TrivialError') as “expected” message items
-- when a parser fails without consuming input right after successful parser
-- that produced the hints.
--
-- For example, without hints you could get:
--
Expand All @@ -228,7 +229,8 @@ data Result t e a
-- unexpected 'a'
-- expecting 'r' or end of input

newtype Hints t = Hints [Set (ErrorItem t)] deriving (Semigroup, Monoid)
newtype Hints t = Hints [Set (ErrorItem t)]
deriving (Semigroup, Monoid)

-- | Convert 'ParseError' record into 'Hints'.

Expand Down

0 comments on commit a69f955

Please sign in to comment.