FoldA is:module
Class of data structures that can be folded to a summary value.
A class of non-empty data structures that can be folded to a summary
value.
Re-exports a subset of the
Data.Foldable1 module along with
some additional combinators that require
Foldable1 constraints.
Contains utility functions for working with tuples.
Generic tools for data structures that can be folded.
Written by John Goerzen, jgoerzen@complete.org
Foldable types.
A minimal implementation of this interface is given by either
FoldMap or
Foldr, but a default still needs to be given
explicitly for the other.
data MyType a = ... {- Some custom Foldable type -}
-- Method 1: Implement Foldr, default FoldMap.
type instance Eval (Foldr f y xs) = ... {- Explicit implementation -}
type instance Eval (FoldMap f xs) = FoldMapDefault_ f xs {- Default -}
-- Method 2: Implement FoldMap, default Foldr.
type instance Eval (FoldMap f xs) = ... {- Explicit implementation -}
type instance Eval (Foldr f y xs) = FoldrDefault_ f y xs {- Default -}
Class of data structures that can be folded to a summary value.
Efficient enumeration of subsets of triangular elements. Given a list
[1..n] we want to enumerate a subset [(i,j)] of
ordered pairs in such a way that we only have to hold the elements
necessary for this subset in memory.
This shows how
Foldable is basically
Recursive
specialized to lists. The true operation of
Foldable is
toList.
As these few operations have the usual signatures, the rest of the
type class can be implemented in the as in
base.
Overrides for problematic
Foldable functions.
A module to provide the extended variants to convert a
InsertLeft instance structure with some values to another one
with the values from the pre-defined structure. Similar to the
measurement of the quantum state observables with the discrete
spectrum. For performance reasons it is better to use module
ListQuantizer whenever possible (especially if the given
Foldable and
InsertLeft instances are just lists).
Contrary to TwoQuantizer module, the results in every function here
depend not just on the two values, which the point is located in
between, but on the whole structure. Defined for just positive real
numbers of
Double type.