swap and assoc: Symmetric and Semigroupy Bifunctors

Version on this page:1.1@rev:1
LTS Haskell 22.23:1.1.1
Stackage Nightly 2024-05-30:1.1.1
Latest on Hackage:1.1.1

See all snapshots assoc appears in

BSD-3-Clause licensed and maintained by Oleg Grenrus
This version can be pinned in stack with:assoc-1.1@sha256:56d0fd1c17aaf6268e81bf19ba5afe186128d7f88126bd546d5b3151ab692652,1617

Module documentation for 1.1

Depends on 2 packages(full list with versions):
Used by 5 packages in nightly-2024-04-19(full list with versions):

Provides generalisations of swap :: (a,b) -> (b,a) and assoc :: ((a,b),c) -> (a,(b,c)) to Bifunctors supporting similar operations (e.g. Either, These).



  • Depend on bifunctor-classes-compat only. Instances for types defined in bifunctors package are moved there. With this change assoc only depends on base and tagged.
  • Mark modules as explicitly Safe


  • Add ‘Swap’ instances for more n-tuples


  • Add Assoc Const and Tagged instances