morphisms-functors-0.1.3: Functors, theirs compositions and transformations

Safe HaskellSafe
LanguageHaskell2010

Control.Functor.Composition.Extendable

Synopsis

Documentation

class Covariant t => Extendable t where Source #

When providing a new instance, you should ensure it satisfies the three laws:
* Duplication interchange: comap (comap f) . duplicate ≡ duplicate . comap f
* Extension interchange: extend f ≡ comap f . duplicate

Minimal complete definition

(=>>)

Methods

(=>>) :: t a -> (t a -> b) -> t b infixl 1 Source #

Infix and flipped version of extend, the dual of >>=

(<<=) :: (t a -> b) -> t a -> t b infixr 1 Source #

Flipped version of >>=, the dual of =<<

extend :: (t a -> b) -> t a -> t b Source #

Prefix and flipped version of =>>, the dual of bind

duplicate :: t a -> (t :.: t) a Source #

Clone existing structure, the dual of join

Instances
Extendable Identity Source # 
Instance details

Defined in Control.Functor.Basic.Identity

Methods

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

(<<=) :: (Identity a -> b) -> Identity a -> Identity b Source #

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

duplicate :: Identity a -> (Identity :.: Identity) a Source #