polyvariadic-0.3.0.2: Creation and application of polyvariadic functions

Copyright(c) Francesco Gazzetta 2017
LicenseBSD3 (see the file LICENSE)
Maintainerfrancygazz@gmail.org
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Accumulator

Description

Accumulators, primarily useful for Polyvariadic

Synopsis

Documentation

class Accumulator acc x where Source #

An 'Accumulator c i' supports accumulation of elements of type i in it. This is different from Semigroup or Monoid, where <> acts between two values with the same type.

Minimal complete definition

accumulate

Methods

accumulate Source #

Arguments

:: x 
-> acc 
-> acc

Accumulate a value

singleton :: (Accumulator acc x, Monoid acc) => x -> acc Source #

Accumulate a single value in a Monoid

accumulateMany :: (Foldable f, Accumulator acc x) => f x -> acc -> acc Source #

Strictly accumulate multiple values from a Foldable, from left to right