reducers-0.1.5: Semigroups, specialized containers and a general map/reduce framework

Portabilityportable
Stabilityexperimental
Maintainerekmett@gmail.com

Data.Semigroup.Generator

Contents

Description

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.

Synopsis

Generators

class Generator c => Generator1 c whereSource

minimal definition mapReduce1 or mapTo1

Methods

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

Instances

Combinators

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

Apply a Reducer directly to the elements of a Generator

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

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