invariant-0.6: Haskell98 invariant functors
Copyright(C) 2012-2017 Nicolas Frisby (C) 2015-2017 Ryan Scott
LicenseBSD-style (see the file LICENSE)
MaintainerRyan Scott
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Functor.Invariant

Description

Haskell98 invariant functors (also known as exponential functors).

For more information, see Edward Kmett's article "Rotten Bananas":

http://comonad.com/reader/2008/rotten-bananas/

Synopsis

Invariant

class Invariant f where Source #

Any * -> * type parametric in the argument permits an instance of Invariant.

Instances should satisfy the following laws:

invmap id id = id
invmap f2 f2' . invmap f1 f1' = invmap (f2 . f1) (f1' . f2')

Minimal complete definition

Nothing

Methods

invmap :: (a -> b) -> (b -> a) -> f a -> f b Source #

default invmap :: (Generic1 f, Invariant (Rep1 f)) => (a -> b) -> (b -> a) -> f a -> f b Source #

Instances

Instances details
Invariant [] Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> [a] -> [b] Source #

Invariant Maybe Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Maybe a -> Maybe b Source #

Invariant IO Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> IO a -> IO b Source #

Invariant Par1 Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Par1 a -> Par1 b Source #

Invariant StateVar Source #

from the StateVar package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> StateVar a -> StateVar b Source #

Invariant SettableStateVar Source #

from the StateVar package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> SettableStateVar a -> SettableStateVar b Source #

Invariant Complex Source #

from Data.Complex

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Complex a -> Complex b Source #

Invariant Predicate Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Predicate a -> Predicate b Source #

Invariant Comparison Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Comparison a -> Comparison b Source #

Invariant Equivalence Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Equivalence a -> Equivalence b Source #

Invariant Min Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Min a -> Min b Source #

Invariant Max Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Max a -> Max b Source #

Invariant First Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> First a -> First b Source #

Invariant Last Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Last a -> Last b Source #

Invariant Option Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Option a -> Option b Source #

Invariant ArgOrder Source #

from System.Console.GetOpt

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ArgOrder a -> ArgOrder b Source #

Invariant OptDescr Source #

from System.Console.GetOpt

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> OptDescr a -> OptDescr b Source #

Invariant ArgDescr Source #

from System.Console.GetOpt

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ArgDescr a -> ArgDescr b Source #

Invariant ZipList Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ZipList a -> ZipList b Source #

Invariant Identity Source #

from Data.Functor.Identity

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Identity a -> Identity b Source #

Invariant Handler Source #

from Control.Exception

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Handler a -> Handler b Source #

Invariant STM Source #

from the stm package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> STM a -> STM b Source #

Invariant First Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> First a -> First b Source #

Invariant Last Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Last a -> Last b Source #

Invariant Dual Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Dual a -> Dual b Source #

Invariant Endo Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Endo a -> Endo b Source #

Invariant Sum Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Sum a -> Sum b Source #

Invariant Product Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Product a -> Product b Source #

Invariant ReadPrec Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ReadPrec a -> ReadPrec b Source #

Invariant ReadP Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ReadP a -> ReadP b Source #

Invariant NonEmpty Source #

from Data.List.NonEmpty

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> NonEmpty a -> NonEmpty b Source #

Invariant IntMap Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> IntMap a -> IntMap b Source #

Invariant Tree Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Tree a -> Tree b Source #

Invariant Seq Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Seq a -> Seq b Source #

Invariant ViewL Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ViewL a -> ViewL b Source #

Invariant ViewR Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ViewR a -> ViewR b Source #

Invariant (Either a) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Either a a0 -> Either a b Source #

Invariant (V1 :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> V1 a -> V1 b Source #

Invariant (U1 :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> U1 a -> U1 b Source #

Invariant (UAddr :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UAddr a -> UAddr b Source #

Invariant (UChar :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UChar a -> UChar b Source #

Invariant (UDouble :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UDouble a -> UDouble b Source #

Invariant (UFloat :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UFloat a -> UFloat b Source #

Invariant (UInt :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UInt a -> UInt b Source #

Invariant (UWord :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> UWord a -> UWord b Source #

Invariant ((,) a) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> (a, a0) -> (a, b) Source #

Invariant (ST s) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ST s a -> ST s b Source #

Invariant (Array i) Source #

from the array package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Array i a -> Array i b Source #

Invariant (Op a) Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Op a a0 -> Op a b Source #

Invariant (Arg a) Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Arg a a0 -> Arg a b Source #

Invariant (ST s) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ST s a -> ST s b Source #

Monad m => Invariant (WrappedMonad m) Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedMonad m a -> WrappedMonad m b Source #

Arrow a => Invariant (ArrowMonad a) Source #

from Control.Arrow

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> ArrowMonad a a0 -> ArrowMonad a b Source #

Invariant (Proxy :: Type -> Type) Source #

from Data.Proxy

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Proxy a -> Proxy b Source #

Invariant (Map k) Source #

from the containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Map k a -> Map k b Source #

Invariant f => Invariant (Lift f) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Lift f a -> Lift f b Source #

Invariant m => Invariant (MaybeT m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> MaybeT m a -> MaybeT m b Source #

Invariant m => Invariant (ListT m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ListT m a -> ListT m b Source #

Invariant (HashMap k) Source #

from the unordered-containers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> HashMap k a -> HashMap k b Source #

Invariant f => Invariant (Rec1 f) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Rec1 f a -> Rec1 f b Source #

Invariant ((,,) a b) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b0) -> (b0 -> a0) -> (a, b, a0) -> (a, b, b0) Source #

Arrow arr => Invariant (WrappedArrow arr a) Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedArrow arr a a0 -> WrappedArrow arr a b Source #

Invariant m => Invariant (Kleisli m a) Source #

from Control.Arrow

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Kleisli m a a0 -> Kleisli m a b Source #

Invariant (Const a :: Type -> Type) Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Const a a0 -> Const a b Source #

Invariant f => Invariant (Alt f) Source #

from Data.Monoid

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Alt f a -> Alt f b Source #

Invariant2 p => Invariant (Join p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Join p a -> Join p b Source #

Invariant2 p => Invariant (Fix p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Fix p a -> Fix p b Source #

Invariant m => Invariant (IdentityT m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> IdentityT m a -> IdentityT m b Source #

(Invariant f, Invariant g) => Invariant (Compose f g) Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Compose f g a -> Compose f g b Source #

(Invariant f, Invariant g) => Invariant (ComposeFC f g) Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ComposeFC f g a -> ComposeFC f g b Source #

(Invariant f, Invariant g) => Invariant (ComposeCF f g) Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ComposeCF f g a -> ComposeCF f g b Source #

Invariant (Yoneda p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Yoneda p a a0 -> Yoneda p a b Source #

Invariant (Coyoneda p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Coyoneda p a a0 -> Coyoneda p a b Source #

Invariant2 p => Invariant (Prep p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Prep p a -> Prep p b Source #

Invariant2 p => Invariant (Coprep p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Coprep p a -> Coprep p b Source #

Invariant (FreeMapping p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> FreeMapping p a a0 -> FreeMapping p a b Source #

Invariant (FreeTraversing p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> FreeTraversing p a a0 -> FreeTraversing p a b Source #

Invariant2 p => Invariant (TambaraSum p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> TambaraSum p a a0 -> TambaraSum p a b Source #

Invariant (PastroSum p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> PastroSum p a a0 -> PastroSum p a b Source #

Invariant (CotambaraSum p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> CotambaraSum p a a0 -> CotambaraSum p a b Source #

Invariant (CopastroSum p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> CopastroSum p a a0 -> CopastroSum p a b Source #

Invariant2 p => Invariant (Closure p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Closure p a a0 -> Closure p a b Source #

Invariant (Environment p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Environment p a a0 -> Environment p a b Source #

Invariant2 p => Invariant (Tambara p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Tambara p a a0 -> Tambara p a b Source #

Invariant (Pastro p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Pastro p a a0 -> Pastro p a b Source #

Invariant (Cotambara p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Cotambara p a a0 -> Cotambara p a b Source #

Invariant (Copastro p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Copastro p a a0 -> Copastro p a b Source #

Invariant (Tagged s) Source #

from the tagged package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Tagged s a -> Tagged s b Source #

Invariant f => Invariant (Reverse f) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Reverse f a -> Reverse f b Source #

Invariant (Constant a :: Type -> Type) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Constant a a0 -> Constant a b Source #

Invariant m => Invariant (WriterT w m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WriterT w m a -> WriterT w m b Source #

Invariant m => Invariant (WriterT w m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WriterT w m a -> WriterT w m b Source #

Invariant m => Invariant (StateT s m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> StateT s m a -> StateT s m b Source #

Invariant m => Invariant (StateT s m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> StateT s m a -> StateT s m b Source #

Invariant m => Invariant (ReaderT r m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ReaderT r m a -> ReaderT r m b Source #

Invariant m => Invariant (ExceptT e m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ExceptT e m a -> ExceptT e m b Source #

Invariant m => Invariant (ErrorT e m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ErrorT e m a -> ErrorT e m b Source #

Invariant f => Invariant (Backwards f) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Backwards f a -> Backwards f b Source #

Arrow c => Invariant (InvariantArrow c) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> InvariantArrow c a -> InvariantArrow c b Source #

Profunctor p => Invariant (InvariantProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> InvariantProfunctor p a -> InvariantProfunctor p b Source #

Contravariant f => Invariant (WrappedContravariant f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedContravariant f a -> WrappedContravariant f b Source #

Functor f => Invariant (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedFunctor f a -> WrappedFunctor f b Source #

Invariant ((->) a :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> (a -> a0) -> a -> b Source #

Invariant (K1 i c :: Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> K1 i c a -> K1 i c b Source #

(Invariant l, Invariant r) => Invariant (l :+: r) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> (l :+: r) a -> (l :+: r) b Source #

(Invariant l, Invariant r) => Invariant (l :*: r) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> (l :*: r) a -> (l :*: r) b Source #

Invariant ((,,,) a b c) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b0) -> (b0 -> a0) -> (a, b, c, a0) -> (a, b, c, b0) Source #

(Invariant f, Invariant g) => Invariant (Product f g) Source #

from Data.Functor.Product

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Product f g a -> Product f g b Source #

(Invariant f, Invariant g) => Invariant (Sum f g) Source #

from Data.Functor.Sum

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Sum f g a -> Sum f g b Source #

Invariant (Cokleisli w a) Source #

from the comonad package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Cokleisli w a a0 -> Cokleisli w a b Source #

Invariant f => Invariant (Star f a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Star f a a0 -> Star f a b Source #

Invariant (Costar f a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Costar f a a0 -> Costar f a b Source #

Invariant (Forget r a :: Type -> Type) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Forget r a a0 -> Forget r a b Source #

Invariant (ContT r m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ContT r m a -> ContT r m b Source #

Invariant f => Invariant (M1 i t f) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> M1 i t f a -> M1 i t f b Source #

(Invariant f, Invariant g) => Invariant (f :.: g) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> (f :.: g) a -> (f :.: g) b Source #

Invariant ((,,,,) a b c d) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b0) -> (b0 -> a0) -> (a, b, c, d, a0) -> (a, b, c, d, b0) Source #

(Invariant f, Invariant g) => Invariant (Compose f g) Source #

from Data.Functor.Compose

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Compose f g a -> Compose f g b Source #

Bifunctor p => Invariant (WrappedBifunctor p a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b Source #

Invariant g => Invariant (Joker g a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Joker g a a0 -> Joker g a b Source #

Invariant2 p => Invariant (Flip p a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Flip p a a0 -> Flip p a b Source #

Invariant (Clown f a :: Type -> Type) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Clown f a a0 -> Clown f a b Source #

Invariant2 p => Invariant (Codensity p a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Codensity p a a0 -> Codensity p a b Source #

Arrow arr => Invariant (WrappedArrow arr a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedArrow arr a a0 -> WrappedArrow arr a b Source #

Invariant m => Invariant (RWST r w s m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> RWST r w s m a -> RWST r w s m b Source #

Invariant m => Invariant (RWST r w s m) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> RWST r w s m a -> RWST r w s m b Source #

Profunctor p => Invariant (WrappedProfunctor p a) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedProfunctor p a a0 -> WrappedProfunctor p a b Source #

(Invariant f, Invariant2 p) => Invariant (Tannen f p a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Tannen f p a a0 -> Tannen f p a b Source #

Invariant2 q => Invariant (Ran p q a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Ran p q a a0 -> Ran p q a b Source #

Invariant2 p => Invariant (Procompose p q a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Procompose p q a a0 -> Procompose p q a b Source #

Invariant2 p => Invariant (Rift p q a) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Rift p q a a0 -> Rift p q a b Source #

(Invariant2 p, Invariant g) => Invariant (Biff p f g a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Biff p f g a a0 -> Biff p f g a b Source #

invmapFunctor :: Functor f => (a -> b) -> (b -> a) -> f a -> f b Source #

Every Functor is also an Invariant functor.

GHC.Generics

With GHC 7.2 or later, Invariant instances can be defined easily using GHC generics like so:

{-# LANGUAGE DeriveGeneric, FlexibleContexts #-}

import Data.Functor.Invariant
import GHC.Generics

data T f a = T (f a) deriving Generic1

instance Invariant f => Invariant (T f)

Be aware that generic Invariant instances cannot be derived for data types that have function arguments in which the last type parameter appears in a position other than the result type (e.g., data Fun a = Fun (a -> a)). For these, you can derive them using the Data.Functor.Invariant.TH module.

genericInvmap :: (Generic1 f, Invariant (Rep1 f)) => (a -> b) -> (b -> a) -> f a -> f b Source #

A generic implementation of invmap.

newtype WrappedFunctor f a Source #

Wrap a Functor to be used as a member of Invariant.

Constructors

WrapFunctor 

Fields

Instances

Instances details
Monad m => Monad (WrappedFunctor m) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

(>>=) :: WrappedFunctor m a -> (a -> WrappedFunctor m b) -> WrappedFunctor m b #

(>>) :: WrappedFunctor m a -> WrappedFunctor m b -> WrappedFunctor m b #

return :: a -> WrappedFunctor m a #

Functor f => Functor (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

fmap :: (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b #

(<$) :: a -> WrappedFunctor f b -> WrappedFunctor f a #

Applicative f => Applicative (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

pure :: a -> WrappedFunctor f a #

(<*>) :: WrappedFunctor f (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b #

liftA2 :: (a -> b -> c) -> WrappedFunctor f a -> WrappedFunctor f b -> WrappedFunctor f c #

(*>) :: WrappedFunctor f a -> WrappedFunctor f b -> WrappedFunctor f b #

(<*) :: WrappedFunctor f a -> WrappedFunctor f b -> WrappedFunctor f a #

Foldable f => Foldable (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

fold :: Monoid m => WrappedFunctor f m -> m #

foldMap :: Monoid m => (a -> m) -> WrappedFunctor f a -> m #

foldMap' :: Monoid m => (a -> m) -> WrappedFunctor f a -> m #

foldr :: (a -> b -> b) -> b -> WrappedFunctor f a -> b #

foldr' :: (a -> b -> b) -> b -> WrappedFunctor f a -> b #

foldl :: (b -> a -> b) -> b -> WrappedFunctor f a -> b #

foldl' :: (b -> a -> b) -> b -> WrappedFunctor f a -> b #

foldr1 :: (a -> a -> a) -> WrappedFunctor f a -> a #

foldl1 :: (a -> a -> a) -> WrappedFunctor f a -> a #

toList :: WrappedFunctor f a -> [a] #

null :: WrappedFunctor f a -> Bool #

length :: WrappedFunctor f a -> Int #

elem :: Eq a => a -> WrappedFunctor f a -> Bool #

maximum :: Ord a => WrappedFunctor f a -> a #

minimum :: Ord a => WrappedFunctor f a -> a #

sum :: Num a => WrappedFunctor f a -> a #

product :: Num a => WrappedFunctor f a -> a #

Traversable f => Traversable (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

traverse :: Applicative f0 => (a -> f0 b) -> WrappedFunctor f a -> f0 (WrappedFunctor f b) #

sequenceA :: Applicative f0 => WrappedFunctor f (f0 a) -> f0 (WrappedFunctor f a) #

mapM :: Monad m => (a -> m b) -> WrappedFunctor f a -> m (WrappedFunctor f b) #

sequence :: Monad m => WrappedFunctor f (m a) -> m (WrappedFunctor f a) #

Alternative f => Alternative (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

MonadPlus m => MonadPlus (WrappedFunctor m) Source # 
Instance details

Defined in Data.Functor.Invariant

Functor f => Invariant (WrappedFunctor f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedFunctor f a -> WrappedFunctor f b Source #

Eq (f a) => Eq (WrappedFunctor f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Ord (f a) => Ord (WrappedFunctor f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Read (f a) => Read (WrappedFunctor f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Show (f a) => Show (WrappedFunctor f a) Source # 
Instance details

Defined in Data.Functor.Invariant

invmapContravariant :: Contravariant f => (a -> b) -> (b -> a) -> f a -> f b Source #

Every Contravariant functor is also an Invariant functor.

invmapProfunctor :: Profunctor p => (a -> b) -> (b -> a) -> p a a -> p b b Source #

A Profunctor with the same input and output types can be seen as an Invariant functor.

invmapArrow :: Arrow arr => (a -> b) -> (b -> a) -> arr a a -> arr b b Source #

An Arrow with the same input and output types can be seen as an Invariant functor.

newtype WrappedContravariant f a Source #

Wrap a Contravariant functor to be used as a member of Invariant.

Constructors

WrapContravariant 

Fields

Instances

Instances details
Contravariant f => Contravariant (WrappedContravariant f) Source # 
Instance details

Defined in Data.Functor.Invariant

Divisible f => Divisible (WrappedContravariant f) Source # 
Instance details

Defined in Data.Functor.Invariant

Decidable f => Decidable (WrappedContravariant f) Source # 
Instance details

Defined in Data.Functor.Invariant

Contravariant f => Invariant (WrappedContravariant f) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedContravariant f a -> WrappedContravariant f b Source #

Eq (f a) => Eq (WrappedContravariant f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Ord (f a) => Ord (WrappedContravariant f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Read (f a) => Read (WrappedContravariant f a) Source # 
Instance details

Defined in Data.Functor.Invariant

Show (f a) => Show (WrappedContravariant f a) Source # 
Instance details

Defined in Data.Functor.Invariant

newtype InvariantProfunctor p a Source #

A Profunctor with the same input and output types can be seen as an Invariant functor.

Constructors

InvariantProfunctor (p a a) 

Instances

Instances details
Profunctor p => Invariant (InvariantProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> InvariantProfunctor p a -> InvariantProfunctor p b Source #

newtype InvariantArrow c a Source #

An Arrow with the same input and output types can be seen as an Invariant functor.

Constructors

InvariantArrow (c a a) 

Instances

Instances details
Arrow c => Invariant (InvariantArrow c) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> InvariantArrow c a -> InvariantArrow c b Source #

Invariant2

class Invariant2 f where Source #

Any * -> * -> * type parametric in both arguments permits an instance of Invariant2.

Instances should satisfy the following laws:

invmap2 id id id id = id
invmap2 f2 f2' g2 g2' . invmap2 f1 f1' g1 g1' =
  invmap2 (f2 . f1) (f1' . f2') (g2 . g1) (g1' . g2')

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> f a b -> f c d Source #

Instances

Instances details
Invariant2 Either Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Either a b -> Either c d Source #

Invariant2 (,) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> (a, b) -> (c, d) Source #

Invariant2 Op Source #

from the contravariant package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Op a b -> Op c d Source #

Invariant2 Arg Source #

from Data.Semigroup

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Arg a b -> Arg c d Source #

Invariant2 ((,,) a) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a0 -> c) -> (c -> a0) -> (b -> d) -> (d -> b) -> (a, a0, b) -> (a, c, d) Source #

Arrow arr => Invariant2 (WrappedArrow arr) Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedArrow arr a b -> WrappedArrow arr c d Source #

Invariant m => Invariant2 (Kleisli m) Source #

from Control.Arrow

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Kleisli m a b -> Kleisli m c d Source #

Invariant2 (Const :: Type -> Type -> Type) Source #

from Control.Applicative

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Const a b -> Const c d Source #

Invariant2 (Yoneda p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Yoneda p a b -> Yoneda p c d Source #

Invariant2 (Coyoneda p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Coyoneda p a b -> Coyoneda p c d Source #

Invariant2 p => Invariant2 (CofreeMapping p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> CofreeMapping p a b -> CofreeMapping p c d Source #

Invariant2 (FreeMapping p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> FreeMapping p a b -> FreeMapping p c d Source #

Invariant2 p => Invariant2 (CofreeTraversing p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> CofreeTraversing p a b -> CofreeTraversing p c d Source #

Invariant2 (FreeTraversing p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> FreeTraversing p a b -> FreeTraversing p c d Source #

Invariant2 p => Invariant2 (TambaraSum p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> TambaraSum p a b -> TambaraSum p c d Source #

Invariant2 (PastroSum p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> PastroSum p a b -> PastroSum p c d Source #

Invariant2 (CotambaraSum p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> CotambaraSum p a b -> CotambaraSum p c d Source #

Invariant2 (CopastroSum p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> CopastroSum p a b -> CopastroSum p c d Source #

Invariant2 p => Invariant2 (Closure p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Closure p a b -> Closure p c d Source #

Invariant2 (Environment p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Environment p a b -> Environment p c d Source #

Invariant2 p => Invariant2 (Tambara p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Tambara p a b -> Tambara p c d Source #

Invariant2 (Pastro p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Pastro p a b -> Pastro p c d Source #

Invariant2 (Cotambara p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Cotambara p a b -> Cotambara p c d Source #

Invariant2 (Copastro p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Copastro p a b -> Copastro p c d Source #

Invariant2 (Tagged :: Type -> Type -> Type) Source #

from the tagged package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Tagged a b -> Tagged c d Source #

Invariant2 (Constant :: Type -> Type -> Type) Source #

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Constant a b -> Constant c d Source #

Invariant2 ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> (a -> b) -> c -> d Source #

Invariant2 (K1 i :: Type -> Type -> Type) Source #

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> K1 i a b -> K1 i c d Source #

Invariant2 ((,,,) a b) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a0 -> c) -> (c -> a0) -> (b0 -> d) -> (d -> b0) -> (a, b, a0, b0) -> (a, b, c, d) Source #

Invariant w => Invariant2 (Cokleisli w) Source #

from the comonad package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Cokleisli w a b -> Cokleisli w c d Source #

Invariant f => Invariant2 (Star f) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Star f a b -> Star f c d Source #

Invariant f => Invariant2 (Costar f) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Costar f a b -> Costar f c d Source #

Invariant2 (Forget r :: Type -> Type -> Type) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Forget r a b -> Forget r c d Source #

Invariant2 ((,,,,) a b c) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a0 -> c0) -> (c0 -> a0) -> (b0 -> d) -> (d -> b0) -> (a, b, c, a0, b0) -> (a, b, c, c0, d) Source #

Bifunctor p => Invariant2 (WrappedBifunctor p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedBifunctor p a b -> WrappedBifunctor p c d Source #

Invariant g => Invariant2 (Joker g :: Type -> Type -> Type) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Joker g a b -> Joker g c d Source #

Invariant2 p => Invariant2 (Flip p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Flip p a b -> Flip p c d Source #

Invariant f => Invariant2 (Clown f :: Type -> Type -> Type) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Clown f a b -> Clown f c d Source #

Invariant2 p => Invariant2 (Codensity p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Codensity p a b -> Codensity p c d Source #

Arrow arr => Invariant2 (WrappedArrow arr) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedArrow arr a b -> WrappedArrow arr c d Source #

Profunctor p => Invariant2 (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedProfunctor p a b -> WrappedProfunctor p c d Source #

(Invariant2 p, Invariant2 q) => Invariant2 (Sum p q) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Sum p q a b -> Sum p q c d Source #

(Invariant2 f, Invariant2 g) => Invariant2 (Product f g) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Product f g a b -> Product f g c d Source #

(Invariant f, Invariant2 p) => Invariant2 (Tannen f p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Tannen f p a b -> Tannen f p c d Source #

(Invariant f, Invariant2 p) => Invariant2 (Cayley f p) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Cayley f p a b -> Cayley f p c d Source #

(Invariant2 p, Invariant2 q) => Invariant2 (Ran p q) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Ran p q a b -> Ran p q c d Source #

(Invariant2 p, Invariant2 q) => Invariant2 (Procompose p q) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Procompose p q a b -> Procompose p q c d Source #

(Invariant2 p, Invariant2 q) => Invariant2 (Rift p q) Source #

from the profunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Rift p q a b -> Rift p q c d Source #

(Invariant2 p, Invariant f, Invariant g) => Invariant2 (Biff p f g) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> Biff p f g a b -> Biff p f g c d Source #

invmap2Bifunctor :: Bifunctor f => (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> f a b -> f c d Source #

Every Bifunctor is also an Invariant2 functor.

newtype WrappedBifunctor (p :: k -> k1 -> Type) (a :: k) (b :: k1) #

Make a Functor over the second argument of a Bifunctor.

Constructors

WrapBifunctor 

Fields

Instances

Instances details
Generic1 (WrappedBifunctor p a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep1 (WrappedBifunctor p a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). WrappedBifunctor p a a0 -> Rep1 (WrappedBifunctor p a) a0 #

to1 :: forall (a0 :: k). Rep1 (WrappedBifunctor p a) a0 -> WrappedBifunctor p a a0 #

Bitraversable p => Bitraversable (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> WrappedBifunctor p a b -> f (WrappedBifunctor p c d) #

Bifoldable p => Bifoldable (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

bifold :: Monoid m => WrappedBifunctor p m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> WrappedBifunctor p a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> WrappedBifunctor p a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> WrappedBifunctor p a b -> c #

Bifunctor p => Bifunctor (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

bimap :: (a -> b) -> (c -> d) -> WrappedBifunctor p a c -> WrappedBifunctor p b d #

first :: (a -> b) -> WrappedBifunctor p a c -> WrappedBifunctor p b c #

second :: (b -> c) -> WrappedBifunctor p a b -> WrappedBifunctor p a c #

Eq2 p => Eq2 (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> WrappedBifunctor p a c -> WrappedBifunctor p b d -> Bool #

Ord2 p => Ord2 (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> WrappedBifunctor p a c -> WrappedBifunctor p b d -> Ordering #

Read2 p => Read2 (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (WrappedBifunctor p a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [WrappedBifunctor p a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (WrappedBifunctor p a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [WrappedBifunctor p a b] #

Show2 p => Show2 (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> WrappedBifunctor p a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [WrappedBifunctor p a b] -> ShowS #

Biapplicative p => Biapplicative (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

bipure :: a -> b -> WrappedBifunctor p a b #

(<<*>>) :: WrappedBifunctor p (a -> b) (c -> d) -> WrappedBifunctor p a c -> WrappedBifunctor p b d #

biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> WrappedBifunctor p a d -> WrappedBifunctor p b e -> WrappedBifunctor p c f #

(*>>) :: WrappedBifunctor p a b -> WrappedBifunctor p c d -> WrappedBifunctor p c d #

(<<*) :: WrappedBifunctor p a b -> WrappedBifunctor p c d -> WrappedBifunctor p a b #

Bifunctor p => Invariant2 (WrappedBifunctor p) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedBifunctor p a b -> WrappedBifunctor p c d Source #

Bifunctor p => Functor (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

fmap :: (a0 -> b) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b #

(<$) :: a0 -> WrappedBifunctor p a b -> WrappedBifunctor p a a0 #

Bifoldable p => Foldable (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

fold :: Monoid m => WrappedBifunctor p a m -> m #

foldMap :: Monoid m => (a0 -> m) -> WrappedBifunctor p a a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> WrappedBifunctor p a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> WrappedBifunctor p a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> WrappedBifunctor p a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> WrappedBifunctor p a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> WrappedBifunctor p a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> WrappedBifunctor p a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> WrappedBifunctor p a a0 -> a0 #

toList :: WrappedBifunctor p a a0 -> [a0] #

null :: WrappedBifunctor p a a0 -> Bool #

length :: WrappedBifunctor p a a0 -> Int #

elem :: Eq a0 => a0 -> WrappedBifunctor p a a0 -> Bool #

maximum :: Ord a0 => WrappedBifunctor p a a0 -> a0 #

minimum :: Ord a0 => WrappedBifunctor p a a0 -> a0 #

sum :: Num a0 => WrappedBifunctor p a a0 -> a0 #

product :: Num a0 => WrappedBifunctor p a a0 -> a0 #

Bitraversable p => Traversable (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

traverse :: Applicative f => (a0 -> f b) -> WrappedBifunctor p a a0 -> f (WrappedBifunctor p a b) #

sequenceA :: Applicative f => WrappedBifunctor p a (f a0) -> f (WrappedBifunctor p a a0) #

mapM :: Monad m => (a0 -> m b) -> WrappedBifunctor p a a0 -> m (WrappedBifunctor p a b) #

sequence :: Monad m => WrappedBifunctor p a (m a0) -> m (WrappedBifunctor p a a0) #

(Eq2 p, Eq a) => Eq1 (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftEq :: (a0 -> b -> Bool) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b -> Bool #

(Ord2 p, Ord a) => Ord1 (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftCompare :: (a0 -> b -> Ordering) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b -> Ordering #

(Read2 p, Read a) => Read1 (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (WrappedBifunctor p a a0) #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [WrappedBifunctor p a a0] #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (WrappedBifunctor p a a0) #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [WrappedBifunctor p a a0] #

(Show2 p, Show a) => Show1 (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> WrappedBifunctor p a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [WrappedBifunctor p a a0] -> ShowS #

Bifunctor p => Invariant (WrappedBifunctor p a) Source #

from the bifunctors package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b Source #

Eq (p a b) => Eq (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

(==) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool #

(/=) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool #

Ord (p a b) => Ord (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Read (p a b) => Read (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Show (p a b) => Show (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Generic (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

Associated Types

type Rep (WrappedBifunctor p a b) :: Type -> Type #

Methods

from :: WrappedBifunctor p a b -> Rep (WrappedBifunctor p a b) x #

to :: Rep (WrappedBifunctor p a b) x -> WrappedBifunctor p a b #

type Rep1 (WrappedBifunctor p a :: k1 -> Type) 
Instance details

Defined in Data.Bifunctor.Wrapped

type Rep1 (WrappedBifunctor p a :: k1 -> Type) = D1 ('MetaData "WrappedBifunctor" "Data.Bifunctor.Wrapped" "bifunctors-5.5.12-L4PDm0SBsOhFd059lLT7m6" 'True) (C1 ('MetaCons "WrapBifunctor" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapBifunctor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (p a))))
type Rep (WrappedBifunctor p a b) 
Instance details

Defined in Data.Bifunctor.Wrapped

type Rep (WrappedBifunctor p a b) = D1 ('MetaData "WrappedBifunctor" "Data.Bifunctor.Wrapped" "bifunctors-5.5.12-L4PDm0SBsOhFd059lLT7m6" 'True) (C1 ('MetaCons "WrapBifunctor" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapBifunctor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (p a b))))

invmap2Profunctor :: Profunctor f => (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> f a b -> f c d Source #

Every Profunctor is also an Invariant2 functor.

newtype WrappedProfunctor p a b Source #

Wrap a Profunctor to be used as a member of Invariant2.

Constructors

WrapProfunctor 

Fields

Instances

Instances details
Category p => Category (WrappedProfunctor p :: k -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

id :: forall (a :: k0). WrappedProfunctor p a a #

(.) :: forall (b :: k0) (c :: k0) (a :: k0). WrappedProfunctor p b c -> WrappedProfunctor p a b -> WrappedProfunctor p a c #

ProfunctorFunctor (WrappedProfunctor :: (Type -> Type -> Type) -> Type -> Type -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> WrappedProfunctor p :-> WrappedProfunctor q #

ProfunctorMonad (WrappedProfunctor :: (Type -> Type -> Type) -> Type -> Type -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> WrappedProfunctor p #

projoin :: forall (p :: Type -> Type -> Type). Profunctor p => WrappedProfunctor (WrappedProfunctor p) :-> WrappedProfunctor p #

ProfunctorComonad (WrappedProfunctor :: (Type -> Type -> Type) -> Type -> Type -> Type) Source # 
Instance details

Defined in Data.Functor.Invariant

Arrow p => Arrow (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

arr :: (b -> c) -> WrappedProfunctor p b c #

first :: WrappedProfunctor p b c -> WrappedProfunctor p (b, d) (c, d) #

second :: WrappedProfunctor p b c -> WrappedProfunctor p (d, b) (d, c) #

(***) :: WrappedProfunctor p b c -> WrappedProfunctor p b' c' -> WrappedProfunctor p (b, b') (c, c') #

(&&&) :: WrappedProfunctor p b c -> WrappedProfunctor p b c' -> WrappedProfunctor p b (c, c') #

ArrowZero p => ArrowZero (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

zeroArrow :: WrappedProfunctor p b c #

ArrowPlus p => ArrowPlus (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

(<+>) :: WrappedProfunctor p b c -> WrappedProfunctor p b c -> WrappedProfunctor p b c #

ArrowChoice p => ArrowChoice (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

ArrowLoop p => ArrowLoop (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

loop :: WrappedProfunctor p (b, d) (c, d) -> WrappedProfunctor p b c #

Mapping p => Mapping (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

map' :: Functor f => WrappedProfunctor p a b -> WrappedProfunctor p (f a) (f b) #

roam :: ((a -> b) -> s -> t) -> WrappedProfunctor p a b -> WrappedProfunctor p s t #

Traversing p => Traversing (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

traverse' :: Traversable f => WrappedProfunctor p a b -> WrappedProfunctor p (f a) (f b) #

wander :: (forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t) -> WrappedProfunctor p a b -> WrappedProfunctor p s t #

Choice p => Choice (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Cochoice p => Cochoice (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Closed p => Closed (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

closed :: WrappedProfunctor p a b -> WrappedProfunctor p (x -> a) (x -> b) #

Strong p => Strong (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

first' :: WrappedProfunctor p a b -> WrappedProfunctor p (a, c) (b, c) #

second' :: WrappedProfunctor p a b -> WrappedProfunctor p (c, a) (c, b) #

Costrong p => Costrong (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

unfirst :: WrappedProfunctor p (a, d) (b, d) -> WrappedProfunctor p a b #

unsecond :: WrappedProfunctor p (d, a) (d, b) -> WrappedProfunctor p a b #

Profunctor p => Profunctor (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

dimap :: (a -> b) -> (c -> d) -> WrappedProfunctor p b c -> WrappedProfunctor p a d #

lmap :: (a -> b) -> WrappedProfunctor p b c -> WrappedProfunctor p a c #

rmap :: (b -> c) -> WrappedProfunctor p a b -> WrappedProfunctor p a c #

(#.) :: forall a b c q. Coercible c b => q b c -> WrappedProfunctor p a b -> WrappedProfunctor p a c #

(.#) :: forall a b c q. Coercible b a => WrappedProfunctor p b c -> q a b -> WrappedProfunctor p a c #

Profunctor p => Invariant2 (WrappedProfunctor p) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> WrappedProfunctor p a b -> WrappedProfunctor p c d Source #

Profunctor p => Invariant (WrappedProfunctor p a) Source # 
Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> WrappedProfunctor p a a0 -> WrappedProfunctor p a b Source #

Eq (p a b) => Eq (WrappedProfunctor p a b) Source # 
Instance details

Defined in Data.Functor.Invariant

Ord (p a b) => Ord (WrappedProfunctor p a b) Source # 
Instance details

Defined in Data.Functor.Invariant

Read (p a b) => Read (WrappedProfunctor p a b) Source # 
Instance details

Defined in Data.Functor.Invariant

Show (p a b) => Show (WrappedProfunctor p a b) Source # 
Instance details

Defined in Data.Functor.Invariant