Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- 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 `Emit`

ter of values while ** reiterate**ing the

`xs`

typelist.
This guarantees that the `Emit e '[]`

is not instantiated.
Undecidable instances! But this is safe since it's a wrapperCollector (e xs r) |

(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

Collector0 (e xs r) |

(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 ** reiterateN**s the

`xs`

typelist.
This version guarantees that the `Emit (e n) '[]`

is not instantiated.
Undecidable instances! But this is safe since it's a wrapperCollectorN (e n xs r) |

(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 ** reiterateN**s the

`xs`

typelist.
Undecidable instances! But this is safe since it's a wrapperCollectorN0 (e n xs r) |

(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 |