Module

Data.Divide

Package
purescript-contravariant
Repository
purescript/purescript-contravariant

#Divide Source

class (Contravariant f) <= Divide f  where

Divide is the contravariant analogue of Apply.

For example, to test equality of Points, we can use the Divide instance for Equivalence:

type Point = Tuple Int Int

pointEquiv :: Equivalence Point
pointEquiv = divided defaultEquivalence defaultEquivalence

Members

  • divide :: forall a b c. (a -> Tuple b c) -> f b -> f c -> f a

Instances

#divided Source

divided :: forall f a b. Divide f => f a -> f b -> f (Tuple a b)

divided = divide id