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

Stability | experimental |

Maintainer | ekmett@gmail.com |

Safe Haskell | Trustworthy |

A `Generator`

`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.

Since a `Generator`

is not polymorphic in its contents, it is more specialized
than Data.Foldable.Foldable, and a `Reducer`

may supply efficient left-to-right
and right-to-left reduction strategies that a `Generator`

may avail itself of.

- class Generator c where
- newtype Keys c = Keys {
- getKeys :: c

- newtype Values c = Values {
- getValues :: c

- newtype Char8 c = Char8 {
- getChar8 :: c

- reduce :: (Generator c, Reducer (Elem c) m, Monoid m) => c -> m
- mapReduceWith :: (Generator c, Reducer e m, Monoid m) => (m -> n) -> (Elem c -> e) -> c -> n
- reduceWith :: (Generator c, Reducer (Elem c) m, Monoid m) => (m -> n) -> c -> n

# Generators

mapReduce :: (Reducer e m, Monoid m) => (Elem c -> e) -> c -> mSource

mapTo :: (Reducer e m, Monoid m) => (Elem c -> e) -> m -> c -> mSource

mapFrom :: (Reducer e m, Monoid m) => (Elem c -> e) -> c -> m -> mSource

Generator ByteString | |

Generator ByteString | |

Generator IntSet | |

Generator Text | |

Generator [c] | |

Generator (Seq c) | |

Generator (IntMap v) | |

Generator (Set a) | |

Generator (NonEmpty c) | |

Generator (HashSet a) | |

Generator (Char8 ByteString) | |

Generator (Char8 ByteString) | |

Ix i => Generator (Values (Array i e)) | |

Generator (Values (IntMap v)) | |

Generator (Values (Map k v)) | |

Ix i => Generator (Keys (Array i e)) | |

Generator (Keys (IntMap v)) | |

Generator (Keys (Map k v)) | |

Ix i => Generator (Array i e) | |

Generator (Map k v) | |

Measured v e => Generator (FingerTree v e) | |

Generator (HashMap k v) |

# Generator Transformers

a `Generator`

transformer that asks only for the keys of an indexed container

a `Generator`

transformer that asks only for the values contained in an indexed container