megaparsec icon indicating copy to clipboard operation
megaparsec copied to clipboard

Add `drop` to `Text.Megaparsec`

Open sol opened this issue 10 months ago • 3 comments

I'd love to have Text.Megaparsec to export

-- | Advance by / ignore `n` input tokens
drop :: MonadParsec e s m => Int -> m ()
drop n = P.skipCount n $ P.token Just mempty

(or possibly implement it with getOffset / setOffset, if that results in the exact same parser state, not sure)

sol avatar Aug 09 '23 08:08 sol