symparsec
Safe HaskellNone
LanguageGHC2021

Symparsec.Parser.Applicative

Description

Type-level string parsers shaped like Applicative functions.

Synopsis

Documentation

data ((l :: PParser (a ~> b)) <*> (r :: PParser a)) (s :: FunKind PState (PReply b)) infixl 4 Source #

<*> for parsers. Sequence two parsers, left to right.

Instances

Instances details
type App (l <*> r :: FunKind PState (PReply b) -> Type) (s :: PState) Source # 
Instance details

Defined in Symparsec.Parser.Applicative

type App (l <*> r :: FunKind PState (PReply b) -> Type) (s :: PState)

data Pure (a1 :: a) (s :: FunKind PState (PReply a)) Source #

pure for parsers. Non-consuming parser that just returns the given value.

Instances

Instances details
type App (Pure a2 :: FunKind PState (PReply a1) -> Type) (s :: PState) Source # 
Instance details

Defined in Symparsec.Parser.Applicative

type App (Pure a2 :: FunKind PState (PReply a1) -> Type) (s :: PState) = 'Reply ('OK a2 :: Result Symbol Natural a1) s

type LiftA2 (f :: a ~> (b ~> c)) (l :: PParser a) (r :: PParser b) = (f <$> l) <*> r Source #

liftA2 for parsers. Sequence two parsers, and combine their results with a binary type function.

type (*>) (l :: PParser a) (r :: PParser b) = ((IdSym :: FunKind b b -> Type) <$ l) <*> r infixl 4 Source #

*> for parsers. Sequence two parsers left to right, discarding the value of the left parser.

type (<*) (l :: PParser a) (r :: PParser b) = LiftA2 (ConstSym :: FunKind a (b ~> a) -> Type) l r infixl 4 Source #

<* for parsers. Sequence two parsers left to right, discarding the value of the right parser.