HORIZON HASKELLDocslts/ghc-9.14.xb9228482026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · b922848 · 2026-10-12

Modulebarbies-2.1.1.0Haskell2010

Barbies.Bi

Contents
  1. Functor
  2. Traversable
  3. Applicative
  4. Wrappers
Synopsis
  • Packagebarbies-2.1.1.0
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBi.hs

Functor

A bifunctor is simultaneously a FunctorT and a FunctorB.

valuebtmap
  1. :: (FunctorB (b f), FunctorT b)
  2. => forall (a :: k1). f a -> f' a
  3. -> forall (a :: k2). g a -> g' a
  4. -> b f g
  5. -> b f' g'

Map over both arguments at the same time.

Traversable

A traversable bifunctor is simultaneously a TraversableT and a TraversableB.

valuebttraverse_
  1. :: (TraversableB (b f), TraversableT b, Monad e)
  2. => forall (a :: k1). f a -> e c
  3. -> forall (a :: k2). g a -> e d
  4. -> b f g
  5. -> e ()

Map each element to an action, evaluate these actions from left to right and ignore the results.

Applicative

If t is an ApplicativeT, the type of tpure shows that its second argument must be a phantom-type, so there are really no interesting types that are both ApplicativeT and ApplicativeB. However, we can sometimes reconstruct a bi-applicative from an ApplicativeB and a FunctorT.

Wrappers

newtypenewtype Flip (b :: k -> k1 -> Type) (l :: k1) (r :: k)

Convert a FunctorB into a FunctorT and vice-versa.

Constructors

Instances12ApplicativeT, FunctorT, TraversableT, DistributiveT, ApplicativeB, DistributiveB, …