Data.Bytes.Parser.Rebindable

bytesmith-0.3.11.1: Nonresumable byte parser

Safe Haskell | None
Language | Haskell2010

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 #

Methods

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

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

#### Instances

Instances details

Bind 'IntRep LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE 'IntRep) b. Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE 'IntRep) b. Parser e s a -> Parser e s b -> Parser e s b #
Bind LiftedRep 'IntRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s a (b :: TYPE 'IntRep). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s a (b :: TYPE 'IntRep). Parser e s a -> Parser e s b -> Parser e s b #
Bind LiftedRep LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: Parser e s a -> Parser e s b -> Parser e s b #
Bind 'WordRep LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE 'WordRep) b. Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE 'WordRep) b. Parser e s a -> Parser e s b -> Parser e s b #
Bind 'IntRep ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE 'IntRep) (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE 'IntRep) (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> Parser e s b -> Parser e s b #
Bind 'IntRep ('TupleRep '['IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE 'IntRep) (b :: TYPE ('TupleRep '['IntRep, 'IntRep])). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE 'IntRep) (b :: TYPE ('TupleRep '['IntRep, 'IntRep])). Parser e s a -> Parser e s b -> Parser e s b #
Bind LiftedRep ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s a (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s a (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> Parser e s b -> Parser e s b #
Bind LiftedRep ('TupleRep '['IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s a (b :: TYPE ('TupleRep '['IntRep, 'IntRep])). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s a (b :: TYPE ('TupleRep '['IntRep, 'IntRep])). Parser e s a -> Parser e s b -> Parser e s b #
Bind ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep]) LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])) b. Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])) b. Parser e s a -> Parser e s b -> Parser e s b #
Bind ('TupleRep '['IntRep, 'IntRep]) LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep])) b. Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep])) b. Parser e s a -> Parser e s b -> Parser e s b #
Bind ('TupleRep '['IntRep, 'IntRep]) ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods (>>=) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep])) (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> (a -> Parser e s b) -> Parser e s b # (>>) :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep])) (b :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). Parser e s a -> Parser e s b -> Parser e s b #

class Pure (ra :: RuntimeRep) where #

Methods

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

#### Instances

Instances details

Pure 'IntRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods pure :: forall e s (a :: TYPE 'IntRep). a -> Parser e s a #
Pure LiftedRep # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods pure :: forall e s a. a -> Parser e s a #
Pure ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods pure :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep, 'IntRep, 'IntRep, 'IntRep])). a -> Parser e s a #
Pure ('TupleRep '['IntRep, 'IntRep]) # |
Instance details Defined in Data.Bytes.Parser.Rebindable Methods pure :: forall e s (a :: TYPE ('TupleRep '['IntRep, 'IntRep])). a -> Parser e s a #