symparsec-1.1.1: Type level string parser combinators
Safe HaskellSafe-Inferred
LanguageGHC2021

Symparsec.Parser.Count

Documentation

type CountS s r = (Natural, [r], s) Source #

type family Count n p where ... Source #

Equations

Count n ('PParser pCh pEnd s0) = Count' n pCh pEnd s0 

type Count' n pCh pEnd s0 = 'PParser (CountChSym pCh s0) (CountEndSym pEnd s0) '(n, '[], s0) Source #

type SCountS ss sr = STuple3 SNat (SList sr) ss Source #

sCount :: SNat n -> SParser ss sr ('PParser pCh pEnd s0) -> SParser (SCountS ss sr) (SList sr) (Count' n pCh pEnd s0) Source #

type family CountCh pCh s0 ch s where ... Source #

Equations

CountCh pCh s0 ch '(n, rs, s) = CountCh' pCh s0 ch n rs s 

sCountChSym :: SParserChSym ss sr pCh -> ss s0 -> SParserChSym (SCountS ss sr) (SList sr) (CountChSym pCh s0) Source #

type family CountCh' pCh s0 ch n rs s where ... Source #

Equations

CountCh' pCh s0 ch 0 rs s = Done (Reverse rs) 
CountCh' pCh s0 ch n rs s = CountChN pCh ch n rs s0 ((pCh @@ ch) @@ s) 

sCountCh' :: SParserChSym ss sr pCh -> ss s0 -> SChar ch -> SNat n -> SList sr rs -> ss s -> SResult (SCountS ss sr) (SList sr) (CountCh' pCh s0 ch n rs s) Source #

type family CountChN pCh ch n rs s0 res where ... Source #

Equations

CountChN pCh ch n rs s0 (Cont s) = Cont '(n, rs, s) 
CountChN pCh ch n rs s0 (Done r) = CountCh' pCh s0 ch (n - 1) (r : rs) s0 
CountChN pCh ch n rs s0 (Err e) = Err (ECount e) 

sCountChN :: SParserChSym ss sr pCh -> SChar ch -> SNat n -> SList sr rs -> ss s0 -> SResult ss sr res -> SResult (SCountS ss sr) (SList sr) (CountChN pCh ch n rs s0 res) Source #

type ECount e = EIn "Count" e Source #

eCount :: SE e -> SE (ECount e) Source #

data CountChSym pCh s0 f Source #

Instances

Instances details
(p ~ 'PParser pCh pEnd s0, SingParser p, KnownNat n) => SingParser (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

Associated Types

type PS (Count' n pCh pEnd s0) :: s -> Type Source #

type PR (Count' n pCh pEnd s0) :: r -> Type Source #

Methods

singParser' :: SParser (PS (Count' n pCh pEnd s0)) (PR (Count' n pCh pEnd s0)) (Count' n pCh pEnd s0) Source #

type App (CountChSym pCh s0 :: FunKind Char (CountS s r ~> PResult (CountS s r) [r]) -> Type) (f :: Char) Source # 
Instance details

Defined in Symparsec.Parser.Count

type App (CountChSym pCh s0 :: FunKind Char (CountS s r ~> PResult (CountS s r) [r]) -> Type) (f :: Char) = CountChSym1 pCh s0 f
type PS (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

type PS (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) = SCountS (PS ('PParser pCh pEnd s0)) (PR ('PParser pCh pEnd s0))
type PR (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

type PR (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) = SList (PR ('PParser pCh pEnd s0))

data CountChSym1 pCh s0 ch s Source #

Instances

Instances details
type App (CountChSym1 pCh s0 ch :: FunKind (CountS k1 k2) (PResult (CountS k1 k2) [k2]) -> Type) (s :: CountS k1 k2) Source # 
Instance details

Defined in Symparsec.Parser.Count

type App (CountChSym1 pCh s0 ch :: FunKind (CountS k1 k2) (PResult (CountS k1 k2) [k2]) -> Type) (s :: CountS k1 k2) = CountCh pCh s0 ch s

type family CountEnd pEnd s0 s where ... Source #

Equations

CountEnd pEnd s0 '(n, rs, s) = CountEnd' pEnd s0 n rs s 

type family CountEnd' pEnd s0 n rs s where ... Source #

Equations

CountEnd' pEnd s0 0 rs s = Right (Reverse rs) 
CountEnd' pEnd s0 n rs s = CountEndN pEnd s0 n rs (pEnd @@ s) 

sCountEnd' :: SParserEndSym ss sr pEnd -> ss s0 -> SNat n -> SList sr rs -> ss s -> SResultEnd (SList sr) (CountEnd' pEnd s0 n rs s) Source #

type family CountEndN pEnd s0 n rs res where ... Source #

Equations

CountEndN pEnd s0 n rs (Right r) = CountEnd' pEnd s0 (n - 1) (r : rs) s0 
CountEndN pEnd s0 n rs (Left e) = Left (ECount e) 

sCountEndN :: SParserEndSym ss sr pEnd -> ss s0 -> SNat n -> SList sr rs -> SResultEnd sr res -> SResultEnd (SList sr) (CountEndN pEnd s0 n rs res) Source #

data CountEndSym pEnd s0 s Source #

Instances

Instances details
(p ~ 'PParser pCh pEnd s0, SingParser p, KnownNat n) => SingParser (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

Associated Types

type PS (Count' n pCh pEnd s0) :: s -> Type Source #

type PR (Count' n pCh pEnd s0) :: r -> Type Source #

Methods

singParser' :: SParser (PS (Count' n pCh pEnd s0)) (PR (Count' n pCh pEnd s0)) (Count' n pCh pEnd s0) Source #

type PS (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

type PS (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) = SCountS (PS ('PParser pCh pEnd s0)) (PR ('PParser pCh pEnd s0))
type App (CountEndSym pEnd s0 :: FunKind (CountS a k) (PResultEnd [k]) -> Type) (s :: CountS a k) Source # 
Instance details

Defined in Symparsec.Parser.Count

type App (CountEndSym pEnd s0 :: FunKind (CountS a k) (PResultEnd [k]) -> Type) (s :: CountS a k) = CountEnd pEnd s0 s
type PR (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) Source # 
Instance details

Defined in Symparsec.Parser.Count

type PR (Count' n pCh pEnd s0 :: PParser (CountS k r) [r]) = SList (PR ('PParser pCh pEnd s0))

sCountEndSym :: SParserEndSym ss sr pEnd -> ss s0 -> SParserEndSym (SCountS ss sr) (SList sr) (CountEndSym pEnd s0) Source #