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

Symparsec.Parser.Take

Synopsis

Documentation

type Take n = 'PParser TakeChSym TakeEndSym '(n, '[]) Source #

Return the next n characters.

type TakeS = (Natural, [Char]) Source #

type family TakeCh ch s where ... Source #

Equations

TakeCh ch '(0, chs) = Done (RevCharsToSymbol chs) 
TakeCh ch '(n, chs) = Cont '(n - 1, ch : chs) 

data TakeChSym f Source #

Instances

Instances details
KnownNat n => SingParser (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

Associated Types

type PS (Take n) :: s -> Type Source #

type PR (Take n) :: r -> Type Source #

Methods

singParser' :: SParser (PS (Take n)) (PR (Take n)) (Take n) Source #

type PR (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

type PS (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

type App TakeChSym (f :: Char) Source # 
Instance details

Defined in Symparsec.Parser.Take

type App TakeChSym (f :: Char) = TakeChSym1 f

data TakeChSym1 ch s Source #

Instances

Instances details
type App (TakeChSym1 ch :: FunKind TakeS (PResult TakeS Symbol) -> Type) (s :: TakeS) Source # 
Instance details

Defined in Symparsec.Parser.Take

type App (TakeChSym1 ch :: FunKind TakeS (PResult TakeS Symbol) -> Type) (s :: TakeS) = TakeCh ch s

type family TakeEnd s where ... Source #

Equations

TakeEnd '(0, chs) = Right (RevCharsToSymbol chs) 
TakeEnd '(n, _) = Left (ETakeEnd n) 

type ETakeEnd n = EBase "Take" ((Text "tried to take " :<>: Text (ShowNatDec n)) :<>: Text " chars from empty string") Source #

data TakeEndSym s Source #

Instances

Instances details
KnownNat n => SingParser (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

Associated Types

type PS (Take n) :: s -> Type Source #

type PR (Take n) :: r -> Type Source #

Methods

singParser' :: SParser (PS (Take n)) (PR (Take n)) (Take n) Source #

type PR (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

type PS (Take n :: PParser TakeS Symbol) Source # 
Instance details

Defined in Symparsec.Parser.Take

type App TakeEndSym (s :: TakeS) Source # 
Instance details

Defined in Symparsec.Parser.Take

type App TakeEndSym (s :: TakeS) = TakeEnd s