Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ekmett/distributive
Dual Traversable
https://github.com/ekmett/distributive
Last synced: 5 days ago
JSON representation
Dual Traversable
- Host: GitHub
- URL: https://github.com/ekmett/distributive
- Owner: ekmett
- License: other
- Created: 2011-01-22T22:27:59.000Z (almost 14 years ago)
- Default Branch: main
- Last Pushed: 2023-05-16T21:28:22.000Z (over 1 year ago)
- Last Synced: 2024-05-08T16:03:47.180Z (6 months ago)
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/distributive
- Size: 643 KB
- Stars: 41
- Watchers: 12
- Forks: 25
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
distributive
============[![Hackage](https://img.shields.io/hackage/v/distributive.svg)](https://hackage.haskell.org/package/distributive) [![Build Status](https://github.com/ekmett/distributive/workflows/Haskell-CI/badge.svg)](https://github.com/ekmett/distributive/actions?query=workflow%3AHaskell-CI)
This package provides the notion that is categorically dual to `Traversable`.
A `Distributive` `Functor` is one that you can push any functor inside of.
```haskell
distribute :: (Functor f, Distributive g) => f (g a) -> g (f a)
```Compare this with the corresponding Traversable notion, `sequenceA`.
```haskell
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