Portability | portable |
---|---|

Stability | experimental |

Maintainer | ekmett@gmail.com |

A `Generator1`

`c`

is a possibly-specialized container, which contains values of
type `Elem`

`c`

, and which knows how to efficiently apply a `Reducer`

to extract
an answer.

`Generator1`

is to `Generator`

as `Foldable1`

is to `Foldable`

.

- class Generator c => Generator1 c where
- reduce1 :: (Generator1 c, Reducer (Elem c) m) => c -> m
- mapReduceWith1 :: (Generator1 c, Reducer e m) => (m -> n) -> (Elem c -> e) -> c -> n
- reduceWith1 :: (Generator1 c, Reducer (Elem c) m) => (m -> n) -> c -> n

# Generators

class Generator c => Generator1 c whereSource

minimal definition `mapReduce1`

or `mapTo1`

mapReduce1 :: Reducer e m => (Elem c -> e) -> c -> mSource

mapTo1 :: Reducer e m => (Elem c -> e) -> m -> c -> mSource

mapFrom1 :: Reducer e m => (Elem c -> e) -> c -> m -> mSource

Generator1 (NonEmpty e) |

# Combinators

reduce1 :: (Generator1 c, Reducer (Elem c) m) => c -> mSource

mapReduceWith1 :: (Generator1 c, Reducer e m) => (m -> n) -> (Elem c -> e) -> c -> nSource

reduceWith1 :: (Generator1 c, Reducer (Elem c) m) => (m -> n) -> c -> nSource