pandora-0.4.9: Pandora/Pattern/Functor/Contravariant.hs
module Pandora.Pattern.Functor.Contravariant where
import Pandora.Pattern.Category (Category)
infixl 4 >-|-, >!<
{- |
> When providing a new instance, you should ensure it satisfies:
> * Identity morphism: (identity >-|-) ≡ identity
> * Interpreted of morphisms: (f >-|-) . (g >-|-) ≡ (g . f >-|-)
-}
class (Category source, Category target) => Contravariant source target t where
(>-|-) :: source a b -> target (t b) (t a)
(>!<) :: Contravariant source target t => source a b -> target (t b) (t a)
(>!<) = (>-|-)