... | ... | @@ -48,6 +48,12 @@ There are a number of concerns with the generalizations proposed for GHC 7.10. S |
|
|
|
|
|
- Containers with a constrained element type (e.g. `StorableVector`, `Vector.Storable` and `Vector.Unboxed`) cannot be made instances of the `Foldable` class.
|
|
|
|
|
|
- Neither `null` nor `length` are inherently limited to `Foldable` containers, making this, perhaps, an insufficient generalization. Adding them to `Foldable` makes it harder to put them somewhere else later. This does not seem terribly likely, but it should be considered.
|
|
|
|
|
|
- The `Foldable` abstraction is a bit "leaky". Different `Monoid` and `Foldable` instance can interact in very different ways. The usual assumption is that `Foldable` instances are more likely to be like lists than like snoc-lists with regard to laziness and performance, but there is no law to justify this assumption.
|
|
|
|
|
|
- Sums and products may depend for efficiency and precision on both container and element type. For example, one might want to sum floating point numbers in a certain order for greatest precision. There is no way for the `Foldable` instance to behave differently for different monoids without `RULES` hacks.
|
|
|
|
|
|
## Concerns for the ecosystem
|
|
|
|
|
|
|
... | ... | |