Portability | GHC |
---|---|

Stability | experimental |

Maintainer | chrisdone@gmail.com |

Safe Haskell | None |

Copy of the holey monoids library but with constructor exported.

- type Format a = forall r. Holey Builder r (a -> r)
- newtype Holey m r a = Holey {
- runHM :: (m -> r) -> a

- (%) :: Monoid n => Holey n b c -> Holey n b1 b -> Holey n b1 c
- now :: m -> Holey m r r
- bind :: Holey m b c -> (m -> Holey n a b) -> Holey n a c
- later :: (a -> m) -> Holey m r (a -> r)
- hmap :: (m -> n) -> Holey m r a -> Holey n r a

# Formatting library

The type of a monoid with holes. The underlying monoid is
represented by type parameter `m`

. The `r`

is the result type and
stays polymorphic until the very last moment when `run`

is
called. The last argument `a`

is always a function with zero or
more arguments, finally resulting in `r`

. Ordering the arguments in
this order allows holey monoids to be composed using `.`

, stacking
the expected arguments. Note that the `Monoid`

constraint is only
used in the identity `Holey`

and in composing two `Holey`

s.

(%) :: Monoid n => Holey n b c -> Holey n b1 b -> Holey n b1 cSource

Composition operator. The same as category composition.

bind :: Holey m b c -> (m -> Holey n a b) -> Holey n a cSource

Monadic indexed bind for holey monoids.