Copyright | (c) 2013 Chris Done, 2013 Shachaf Ben-Kiki |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Formatting.Holey
Contents
Description
Copy of the holey monoids library but with constructor exported.
- type Format r x = Holey Builder r x
- type Holey m r a = HoleyT r a m
- newtype HoleyT r a m = Holey {
- runHM :: (m -> r) -> a
- (%) :: Format b c -> Format r b -> Format r c
- (%.) :: Format r (Builder -> b) -> Format b c -> Format r c
- now :: Builder -> Format r r
- bind :: Format b c -> (Builder -> Format a b) -> Format a c
- later :: (a -> Builder) -> Format r (a -> r)
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.
(%) :: Format b c -> Format r b -> Format r c Source
Composition operator. The same as category composition.
(%.) :: Format r (Builder -> b) -> Format b c -> Format r c Source
Function compose two holeys. Will feed the result of one holey into another.