reducers-3.12.4: Semigroups, specialized containers and a general map/reduce framework
Copyright(c) Edward Kmett 2009
LicenseBSD-style
Maintainerekmett@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Semigroup.Generator

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 where Source #

minimal definition mapReduce1 or mapTo1

Minimal complete definition

mapReduce1

Methods

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

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

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

Instances

Instances details
Generator1 (NonEmpty e) Source # 
Instance details

Defined in Data.Semigroup.Generator

Methods

mapReduce1 :: Reducer e0 m => (Elem (NonEmpty e) -> e0) -> NonEmpty e -> m Source #

mapTo1 :: Reducer e0 m => (Elem (NonEmpty e) -> e0) -> m -> NonEmpty e -> m Source #

mapFrom1 :: Reducer e0 m => (Elem (NonEmpty e) -> e0) -> NonEmpty e -> m -> m Source #

Combinators

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

Apply a Reducer directly to the elements of a Generator

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

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