HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulebarbies-2.1.1.0Haskell2010

Barbies.Bi

  • 1 type
  • 10 values
  • Packagebarbies-2.1.1.0
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBi.hs

Functor

2 declarations

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.

valuebtmap1
  1. :: (FunctorB (b f), FunctorT b)
  2. => forall (a :: k). f a -> g a
  3. -> b f f
  4. -> b g g
#

A version of btmap specialized to a single argument.

Traversable

5 declarations

A traversable bifunctor is simultaneously a TraversableT and a TraversableB.

valuebttraverse
  1. :: (TraversableB (b f), TraversableT b, Monad t)
  2. => forall (a :: k1). f a -> t (f' a)
  3. -> forall (a :: k2). g a -> t (g' a)
  4. -> b f g
  5. -> t (b f' g')
#

Traverse over both arguments, first over f, then over g..

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

3 declarations

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

1 declaration
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, …