adjunctions-4.4.3: Adjunctions and representable functors

Copyright | (C) 2011 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | MPTCs, fundeps
Safe Haskell | Safe-Inferred
Language | Haskell2010

Control.Monad.Trans.Contravariant.Adjoint

Description

Uses a contravariant adjunction:

f -| g : Hask^op -> Hask

to build a `Comonad` to `Monad` transformer. Sadly, the dual construction, which builds a `Comonad` out of a `Monad`, is uninhabited, because any `Adjunction` of the form

    f -| g : Hask -> Hask^op

would trivially admit unsafePerformIO.

# Documentation

type Adjoint (f :: Type -> Type) (g :: Type -> Type) = AdjointT f g Identity Source #

runAdjoint :: Contravariant g => Adjoint f g a -> g (f a) Source #

adjoint :: Contravariant g => g (f a) -> Adjoint f g a Source #

newtype AdjointT (f :: Type -> Type) (g :: Type -> Type) (w :: Type -> Type) a Source #

Constructors

AdjointT |

Fields

- runAdjointT :: g (w (f a))

#### Instances

Instances details

(Adjunction f g, Comonad w) => Applicative (AdjointT f g w) Source # |

Instance details

Defined in Control.Monad.Trans.Contravariant.Adjoint

Methods

pure :: a -> AdjointT f g w a Source #

(<*>) :: AdjointT f g w (a -> b) -> AdjointT f g w a -> AdjointT f g w b Source #

liftA2 :: (a -> b -> c) -> AdjointT f g w a -> AdjointT f g w b -> AdjointT f g w c Source #

(*>) :: AdjointT f g w a -> AdjointT f g w b -> AdjointT f g w b Source #

(<*) :: AdjointT f g w a -> AdjointT f g w b -> AdjointT f g w a Source #

(Adjunction f g, Functor w) => Functor (AdjointT f g w) Source # |
Instance details Defined in Control.Monad.Trans.Contravariant.Adjoint Methods fmap :: (a -> b) -> AdjointT f g w a -> AdjointT f g w b Source # (<$) :: a -> AdjointT f g w b -> AdjointT f g w a Source #
(Adjunction f g, Comonad w) => Monad (AdjointT f g w) Source # |
Instance details Defined in Control.Monad.Trans.Contravariant.Adjoint Methods (>>=) :: AdjointT f g w a -> (a -> AdjointT f g w b) -> AdjointT f g w b Source # (>>) :: AdjointT f g w a -> AdjointT f g w b -> AdjointT f g w b Source # return :: a -> AdjointT f g w a Source #