bytesmith-0.3.6.0: Nonresumable byte parser

Safe HaskellNone
LanguageHaskell2010

Data.Bytes.Parser.Rebindable

Description

Provides levity-polymorphic variants of >>=, >>, and pure used to assemble parsers whose result types are unlifted. This cannot be used with the RebindableSyntax extension because that extension disallows representations other than LiftedRep. Consequently, users of this module must manually desugar do notation. See the url-bytes library for an example of this module in action.

Only resort to the functions in this module after checking that GHC is unable to optimize away I# and friends in your code.

Documentation

class Bind (ra :: RuntimeRep) (rb :: RuntimeRep) where Source #

Methods

(>>=) :: forall e s (a :: TYPE ra) (b :: TYPE rb). Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: forall e s (a :: TYPE ra) (b :: TYPE rb). Parser e s a -> Parser e s b -> Parser e s b Source #

Instances
Bind LiftedRep LiftedRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

Bind LiftedRep IntRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

Bind IntRep LiftedRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

Bind LiftedRep (TupleRep (IntRep ': (IntRep ': ([] :: [RuntimeRep])))) Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

Bind IntRep (TupleRep (IntRep ': (IntRep ': ([] :: [RuntimeRep])))) Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

Bind (TupleRep (IntRep ': (IntRep ': ([] :: [RuntimeRep])))) LiftedRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

(>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b Source #

(>>) :: Parser e s a -> Parser e s b -> Parser e s b Source #

class Pure (ra :: RuntimeRep) where Source #

Methods

pure :: forall e s (a :: TYPE ra). a -> Parser e s a Source #

Instances
Pure LiftedRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

pure :: a -> Parser e s a Source #

Pure IntRep Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

pure :: a -> Parser e s a Source #

Pure (TupleRep (IntRep ': (IntRep ': ([] :: [RuntimeRep])))) Source # 
Instance details

Defined in Data.Bytes.Parser.Rebindable

Methods

pure :: a -> Parser e s a Source #