Skip to content

rest primitive String parser #110

Closed
@jamesdbrock

Description

@jamesdbrock

I needed this rest parser today so I wrote something like it. It's pretty common and I think we should include it in the primitive parsers for Text.Parsing.Parser.String.

-- | Parse and return the rest of the input. Always succeeds.
rest :: forall m. Monad m => ParserT String m String
rest = do
  ParseState input position _ <- get
  set $ ParseState "" (updatePosString position input) true
  pure input

Except we can't write it for StringLike. Are we sure that the StringLike typeclass is a good idea?

rest :: forall m s. StringLike s => Monad m => ParserT s m s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions