symparsec
Safe HaskellNone
LanguageGHC2021

Symparsec.Run

Description

Running Symparsec parsers.

Synopsis

Documentation

type Run (p :: PParser a) (str :: Symbol) = RunEnd str (p @@ StateInit str) Source #

Run the given parser on the given Symbol.

  • On success, returns a tuple of (result :: a, remaining :: Symbol).
  • On failure, returns an ErrorMessage.

type RunTest (p :: PParser a) (str :: Symbol) = FromRightTypeError (Run p str) Source #

Run the given parser on the given Symbol, emitting a type error on failure.

This would be useful for :k! runs, but it doesn't work properly with TypeErrors, printing = (TypeError ...) instead of the error message. Alas! Instead, do something like > Proxy @(RunTest ...).