{-# LANGUAGE Safe #-}
module Data.Invertible.Internal
( invert
, involution
) where
import Data.Invertible.Bijection
invert :: Bijection a b c -> Bijection a c b
invert :: forall (a :: * -> * -> *) b c. Bijection a b c -> Bijection a c b
invert (a b c
f :<->: a c b
g) = a c b
g a c b -> a b c -> Bijection a c b
forall (a :: * -> * -> *) b c. a b c -> a c b -> Bijection a b c
:<->: a b c
f
{-# INLINE invert #-}
involution :: a b b -> Bijection a b b
involution :: forall (a :: * -> * -> *) b. a b b -> Bijection a b b
involution a b b
f = a b b
f a b b -> a b b -> Bijection a b b
forall (a :: * -> * -> *) b c. a b c -> a c b -> Bijection a b c
:<->: a b b
f
{-# INLINE involution #-}