Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Data.Type.Symbol.Parser.Internal
Documentation
type ParserEnd s r = s -> Either ErrorMessage r Source #
Constructors
Cont s | |
Done r | |
Err ErrorMessage |
Instances
type ParserEndSym s r = s ~> Either ErrorMessage r Source #
type Parser s r = (ParserChSym s r, ParserEndSym s r, s) Source #
type family RunParser p sym where ... Source #
Equations
RunParser '(pCh, pEnd, s) sym = RunParser' pCh pEnd 0 s (UnconsSymbol sym) |
type family RunParser' pCh pEnd idx s msym where ... Source #
Equations
RunParser' pCh pEnd idx s 'Nothing = RunParserEnd idx (pEnd @@ s) | |
RunParser' pCh pEnd idx s ('Just '(ch, sym)) = RunParser'' pCh pEnd idx ch ((pCh @@ ch) @@ s) sym |
type family RunParserEnd idx end where ... Source #
Equations
RunParserEnd idx ('Left e) = 'Left e | |
RunParserEnd idx ('Right r) = 'Right '(r, "") |
type family RunParser'' pCh pEnd idx ch res sym where ... Source #
Equations
RunParser'' pCh pEnd idx ch ('Err e) sym = 'Left e | |
RunParser'' pCh pEnd idx ch ('Done r) sym = 'Right '(r, sym) | |
RunParser'' pCh pEnd idx ch ('Cont s) sym = RunParser' pCh pEnd (idx + 1) s (UnconsSymbol sym) |