distributive

Distributive functors -- Dual to Traversable http://github.com/ekmett/distributive/

Version on this page:0.4.4
LTS Haskell 15.13:0.6.2
Stackage Nightly 2020-05-26:0.6.2
Latest on Hackage:0.6.2

See all snapshots distributive appears in

BSD-3-Clause licensed by Edward A. Kmett
Maintained by Edward A. Kmett

Module documentation for 0.4.4

This version can be pinned in stack with:[email protected]:78db081dcf000679d964386f855cd9e84c80e0221917f21f35a8db01272b7126,1572

distributive

Build Status

This package provides the notion that is categorically dual to Traversable.

A Distributive 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.

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 fmap.

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.

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett

Changes

0.4.4

  • transformers 0.4 compatibility

0.4.3.1

  • Fixed builds with older versions of GHC

0.4.2

  • Added Data.Distributive.Generic.

0.4.1

  • Control.Monad.Instances is deprecated in GHC 7.8. Don’t import it there.

0.4

  • Added support for Data.Tagged and Data.Proxy.

0.3.1

  • Minor documentation fix

0.3

  • Added instances for Control.Applicative.Backwards and Data.Functor.Reverse from transformers 0.3, taking them from transformers-compat if necessary for transformers 0.2