talira

bifunctors

Haskell bifunctors, bifoldables and bitraversables

open sourceBSD-2-Clausefree

bifunctors is Edward Kmett's Haskell library of bifunctors, bifoldables and bitraversables: type classes for types with two type parameters you can map, fold or traverse over on both sides, with the usual combinators and instances. It's tested with GHC 8.0 to 9.14.

Problems it solves

  • map over both sides of an Either or a tuple in Haskell
  • fold or traverse a two-parameter type in Haskell
  • write Bifunctor instances for my own Haskell types

Features

  • bifunctor, bifoldable and bitraversable type classes
  • combinators and instances for common two-parameter types
  • Template Haskell deriving of Bifunctor, Bifoldable and Bitraversable instances
  • tested with GHC 8.0 to 9.14

Alternatives

The same job

These do what bifunctors does.

  1. profunctors Profunctor type classes and constructions for Haskell
  2. these Haskell's either-or-both data type, with Align for zipping with padding
  3. indexed-traversable FunctorWithIndex, FoldableWithIndex and TraversableWithIndex for Haskell

Compare bifunctors with the top 3