talira

contravariant

Contravariant functors for Haskell

open sourceBSD-3-Clausefree

contravariant is a Haskell library of contravariant functors (the Contravariant class and its instances), for types that consume values rather than produce them. It is by Edward Kmett and is published on Hackage.

Problems it solves

  • map over the input of a function-like type in Haskell with a Contravariant instance
  • use contravariant functors in Haskell code that supports old GHC versions
  • combine Haskell types that consume values the way Functor combines producers

Features

  • The Contravariant type class for contravariant functors
  • Supports GHC from 8.0 to 9.14

Alternatives

The same job

These do what contravariant does.

  1. semigroupoids id-free versions of Haskell's Category, Applicative, Monad and related type classes
  2. adjunctions Adjunctions and representable functors for Haskell

Compare contravariant with the top 3