{-# LANGUAGE TypeOperators #-}
module Data.Invertible.Invariant
( invmap
) where
import Data.Invertible.Bijection
import qualified Data.Functor.Invariant as I
invmap :: I.Invariant f => a <-> b -> f a -> f b
invmap :: forall (f :: * -> *) a b. Invariant f => (a <-> b) -> f a -> f b
invmap (a -> b
f :<->: b -> a
g) = (a -> b) -> (b -> a) -> f a -> f b
forall a b. (a -> b) -> (b -> a) -> f a -> f b
forall (f :: * -> *) a b.
Invariant f =>
(a -> b) -> (b -> a) -> f a -> f b
I.invmap a -> b
f b -> a
g