Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type Parser s r = (ParserChSym s r, ParserEndSym s r, s)
- type family Run p sym where ...
- type family Isolate n p where ...
- type (:<*>:) pl pr = Then pl pr
- type (:*>:) pl pr = ThenVL pl pr
- type (:<*:) pl pr = ThenVR pl pr
- type (:<|>:) pl pr = Or pl pr
- type family Take n where ...
- type family Drop n where ...
- type Literal sym = Literal' (UnconsSymbol sym)
- type End = '(EndChSym, EmitEndSym, '())
- type NatDec = NatBase 10 ParseDecimalDigitSym
- type NatHex = NatBase 16 ParseHexDigitSym
- type NatBin = NatBase 2 ParseBinaryDigitSym
- type NatOct = NatBase 8 ParseOctalDigitSym
- type NatBase base parseDigit = '(NatBaseChSym base parseDigit, EmitEndSym, 0)
Base definitions
type Parser s r = (ParserChSym s r, ParserEndSym s r, s) Source #
type family Run p sym where ... Source #
Run the given parser on the given Symbol
.
Run '(pCh, pEnd, s) sym = MapLeftPrettyERun (RunStart pCh pEnd s (UnconsSymbol sym)) |
Parsers
Combinators
type family Isolate n p where ... Source #
Isolate 0 '(pCh, pEnd, s) = '(FailChSym "Isolate" (ErrParserLimitation "cannot isolate 0"), IsolateEndSym, '(0, s)) | |
Isolate n '(pCh, pEnd, s) = '(IsolateChSym pCh pEnd, IsolateEndSym, '(n - 1, s)) |
type (:*>:) pl pr = ThenVL pl pr Source #
Sequence parsers, discarding the return value of the left parser
type (:<*:) pl pr = ThenVR pl pr Source #
Sequence parsers, discarding the return value of the right parser.
Consider using :*>:
instead, which is simpler and potentially faster since
we parse L->R.
Primitives
type family Take n where ... Source #
Take 0 = '(FailChSym "Take" (ErrParserLimitation "can't take 0"), TakeEndSym, '(0, '[])) | |
Take n = '(TakeChSym, TakeEndSym, '(n, '[])) |
type family Drop n where ... Source #
Drop 0 = '(FailChSym "Drop" (ErrParserLimitation "can't drop 0"), DropEndSym, 0) | |
Drop n = Drop' n |
type Literal sym = Literal' (UnconsSymbol sym) Source #
type End = '(EndChSym, EmitEndSym, '()) Source #
Naturals
type NatBase base parseDigit = '(NatBaseChSym base parseDigit, EmitEndSym, 0) Source #