@@ -32,24 +32,27 @@ import Prelude hiding (getChar, succ)
3232newtype Pos = Pos { fromPos :: Int }
3333 deriving (Eq, Ord, Show, Num)
3434
35−-- | The result of a parse. This is parameterised over the type @t@
35+-- | The result of a parse. This is parameterised over the type @i@
3636-- of string that was processed.
3737--
3838-- This type is an instance of 'Functor', where 'fmap' transforms the
3939-- value in a 'Done' result.
4040data IResult i t r =
4141 Fail i [String] String
42− -- ^ The parse failed. The 'i' parameter is the input that had
42+ -- ^ The parse failed. The @i@ parameter is the input that had
4343 -- not yet been consumed when the failure occurred. The
4444 -- @[@'String'@]@ is a list of contexts in which the error
4545 -- occurred. The 'String' is the message describing the error, if
4646 -- any.
4747 | Partial (i -> IResult i t r)
4848 -- ^ Supply this continuation with more input so that the parser
49− -- can resume. To indicate that no more input is available, use
50− -- an empty string.
49+ -- can resume. To indicate that no more input is available, pass
50+ -- an empty string to the continuation.
51+ --
52+ -- __Note__: if you get a 'Partial' result, do not call its
53+ -- continuation more than once.
5154 | Done i r
52− -- ^ The parse succeeded. The 'i' parameter is the input that had
55+ -- ^ The parse succeeded. The @i@ parameter is the input that had
5356 -- not yet been consumed (if any) when the parse succeeded.
5457
5558instance (Show i, Show r) => Show (IResult i t r) where