| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.Diverse.Collector
- newtype Collector e xs r = Collector (e xs r)
- newtype Collector0 e xs r = Collector0 (e xs r)
- newtype CollectorN e n xs r = CollectorN (e n xs r)
- newtype CollectorN0 e n xs r = CollectorN0 (e n xs r)
Documentation
newtype Collector e xs r Source #
Folds output from an Emitter of values while reiterateing the xs typelist.
This guarantees that the Emit e '[] is not instantiated.
Undecidable instances! But this is safe since it's a wrapper
Constructors
| Collector (e xs r) |
Instances
| (Emit Type e ((:) Type x xs) r, Reiterate * e ((:) Type x xs), AFoldable (Collector * e xs) r) => AFoldable (Collector * e ((:) Type x xs)) r Source # | Folds values by |
| AFoldable (Collector * e ([] Type)) r Source # | null case that doesn't even use |
newtype Collector0 e xs r Source #
A variation of Collector which does require the Emit e '[] instance for the empty typelist.
Undecidable instances! But this is safe since it's a wrapper
Constructors
| Collector0 (e xs r) |
Instances
| (Emit Type e ((:) Type x xs) r, Reiterate * e ((:) Type x xs), AFoldable (Collector0 * e xs) r) => AFoldable (Collector0 * e ((:) Type x xs)) r Source # | Folds values by |
| Emit Type e ([] Type) r => AFoldable (Collector0 * e ([] Type)) r Source # | terminating case that does use |
newtype CollectorN e n xs r Source #
A variation of Collector which reiterateNs the xs typelist.
This version guarantees that the Emit (e n) '[] is not instantiated.
Undecidable instances! But this is safe since it's a wrapper
Constructors
| CollectorN (e n xs r) |
Instances
| (Emit Type (e n) ((:) Type x xs) r, ReiterateN * e n ((:) Type x xs), AFoldable (CollectorN * e ((+) n 1) xs) r) => AFoldable (CollectorN * e n ((:) Type x xs)) r Source # | Folds values by |
| AFoldable (CollectorN * e n ([] Type)) r Source # | null case that doesn't even use |
newtype CollectorN0 e n xs r Source #
A variation of Collector0 which reiterateNs the xs typelist.
Undecidable instances! But this is safe since it's a wrapper
Constructors
| CollectorN0 (e n xs r) |
Instances
| (Emit Type (e n) ((:) Type x xs) r, ReiterateN * e n ((:) Type x xs), AFoldable (CollectorN0 * e ((+) n 1) xs) r) => AFoldable (CollectorN0 * e n ((:) Type x xs)) r Source # | Folds values by |
| Emit Type (e n) ([] Type) r => AFoldable (CollectorN0 * e n ([] Type)) r Source # | terminating case that does use |