Distributive functors -- Dual to Traversable
|LTS Haskell 20.16:||0.6.2.1@rev:1|
|Stackage Nightly 2023-03-27:||0.6.2.1@rev:1|
|Latest on Hackage:||0.6.2.1@rev:1|
Maintained by Edward A. Kmett
This version can be pinned in stack with:
Module documentation for 0.6.2.1
Depends on 4 packages(full list with versions):
Used by 31 packages in lts-20.2(full list with versions):
adjunctions, algebra, barbies, blanks, chimera, comonad, comonad-extras, compensated, data-functor-logistic, diagrams-core, diagrams-lib, folds, free, hyperloglog, intervals, kan-extensions, lens, linear, log-domain, machines, numhask-array, numhask-space, profunctors, ral, rank2classes, semigroupoids, streams, tagged-transformer, termonad, vec, vector-sized
This package provides the notion that is categorically dual to
Functor is one that you can push any functor inside of.
distribute :: (Functor f, Distributive g) => f (g a) -> g (f a)
Compare this with the corresponding Traversable notion,
sequenceA :: (Applicative f, Traversable g) => g (f a) -> f (g a)
This package includes instances for common types, and includes other methods similar to
traverse which fuse the use of
We only require
Functor rather than some dual notion to
Applicative, because the latter cannot meaningfully exist in Haskell
since all comonoids there are trivial.
Contributions and bug reports are welcome!
Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.
- The build-type has been changed from
Simple. To achieve this, the
docteststest suite has been removed in favor of using
cabal-docspecto run the doctests.
- Make the
- Add a
fmapCollect. (See here for an explanation of why it was removed.)
- Avoid incurring some dependencies when using recent GHCs.
cabal-doctest. This makes
Cabal-1.25, and makes the
doctests work with
cabal new-buildand sandboxes.
- Fix bugs in
Data.Distributive.Genericthat cause generic
Distributiveinstances not to work properly for datatypes with recursive types
Data.Distributive.Generic, and switch the underlying machinery in that module to work on a
collect-like method instead of a
- Add a test suite for regression-testing
Distributiveinstances for datatypes from
- A more elegant fix for builds on GHC 7.2
- Fix builds on GHC 7.2
- Added flags for removing some dependencies.
doctestswhen building to non-standard locations (such as when using
- Fixed builds with older versions of GHC
Control.Monad.Instancesis deprecated in GHC 7.8. Don’t import it there.
- Added support for
- Minor documentation fix
- Added instances for
transformers0.3, taking them from
transformers-compatif necessary for