-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell 98 comonads -- -- Haskell 98 comonads @package comonad @version 1.0 module Data.Functor.Extend class Functor w => Extend w duplicate :: Extend w => w a -> w (w a) extend :: Extend w => (w a -> b) -> w a -> w b -- | extend with the arguments swapped. Dual to >>= for -- a Monad. (=>>) :: Extend w => w a -> (w a -> b) -> w b -- | extend in operator form (<<=) :: Extend w => (w a -> b) -> w a -> w b -- | Left-to-right Cokleisli composition (=>=) :: Extend w => (w a -> b) -> (w b -> c) -> w a -> c -- | Right-to-left Cokleisli composition (=<=) :: Extend w => (w b -> c) -> (w a -> b) -> w a -> c instance Extend w => Extend (IdentityT w) instance Extend Identity instance Semigroup m => Extend ((->) m) instance Extend ((,) e) instance Extend (Either a) instance Extend Maybe instance Extend [] module Control.Comonad class Functor w => Extend w duplicate :: Extend w => w a -> w (w a) extend :: Extend w => (w a -> b) -> w a -> w b -- | Left-to-right Cokleisli composition (=>=) :: Extend w => (w a -> b) -> (w b -> c) -> w a -> c -- | Right-to-left Cokleisli composition (=<=) :: Extend w => (w b -> c) -> (w a -> b) -> w a -> c -- | extend in operator form (<<=) :: Extend w => (w a -> b) -> w a -> w b -- | extend with the arguments swapped. Dual to >>= for -- a Monad. (=>>) :: Extend w => w a -> (w a -> b) -> w b -- | $definition class Extend w => Comonad w extract :: Comonad w => w a -> a -- | A suitable default definition for fmap for a Comonad. -- Promotes a function to a comonad. -- --
-- fmap f = extend (f . extract) --liftW :: Comonad w => (a -> b) -> w a -> w b -- | Comonadic fixed point wfix :: Comonad w => w (w a -> a) -> a -- | The Cokleisli Arrows of a given Comonad newtype Cokleisli w a b Cokleisli :: (w a -> b) -> Cokleisli w a b runCokleisli :: Cokleisli w a b -> w a -> b instance Monad (Cokleisli w a) instance Applicative (Cokleisli w a) instance Functor (Cokleisli w a) instance Comonad w => ArrowChoice (Cokleisli w) instance Comonad w => ArrowApply (Cokleisli w) instance Comonad w => Arrow (Cokleisli w) instance Comonad w => Category (Cokleisli w) instance Typeable1 w => Typeable2 (Cokleisli w) instance Comonad w => Comonad (IdentityT w) instance Comonad Identity instance (Semigroup m, Monoid m) => Comonad ((->) m) instance Comonad ((,) e)