comonad-0.9.0: Haskell 98 comonads

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>

Data.Functor.Extend

Contents

Description

 

Synopsis

$definition

class Functor w => Extend w whereSource

Methods

duplicate :: w a -> w (w a)Source

 duplicate = extend id
 fmap (fmap f) . duplicate = duplicate . fmap f

extend :: (w a -> b) -> w a -> w bSource

 extend f  = fmap f . duplicate

Instances

(=>>) :: Extend w => w a -> (w a -> b) -> w bSource

extend with the arguments swapped. Dual to >>= for a Monad.

(<<=) :: Extend w => (w a -> b) -> w a -> w bSource

extend in operator form

(=>=) :: Extend w => (w a -> b) -> (w b -> c) -> w a -> cSource

Left-to-right Cokleisli composition

(=<=) :: Extend w => (w b -> c) -> (w a -> b) -> w a -> cSource

Right-to-left Cokleisli composition