@@ -418,6 +418,14 @@ parse m s = T.runParser m (buffer s) (Pos 0) Incomplete failK successK
418418{-# INLINE parse #-}
419419
420420-- | Run a parser that cannot be resupplied via a 'Partial' result.
421+--
422+-- This function does not force a parser to consume all of its input.
423+-- Instead, any residual input will be discarded. To force a parser
424+-- to consume all of its input, use something like this:
425+--
426+-- @
427+--'parseOnly' (myParser 'Control.Applicative.<*' 'endOfInput')
428+-- @
421429parseOnly :: Parser a -> ByteString -> Either String a
422430parseOnly m s = case T.runParser m (buffer s) (Pos 0) Complete failK successK of
423431 Fail _ _ err -> Left err