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

Safe HaskellSafe
LanguageHaskell2010

Control.Functor.Covariant.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

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

Right-to-left Cokleisli composition

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

Left-to-right Cokleisli composition

Instances
Extendable Identity Source # 
Instance details

Defined in Data.Functor.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 #

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

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

Extendable (Product a) Source # 
Instance details

Defined in Data.Functor.Product

Methods

(=>>) :: Product a a0 -> (Product a a0 -> b) -> Product a b Source #

(<<=) :: (Product a a0 -> b) -> Product a a0 -> Product a b Source #

extend :: (Product a a0 -> b) -> Product a a0 -> Product a b Source #

duplicate :: Product a a0 -> (Product a :.: Product a) a0 Source #

(=<=) :: (Product a b -> c) -> (Product a a0 -> b) -> Product a a0 -> c Source #

(=>=) :: (Product a a0 -> b) -> (Product a b -> c) -> Product a a0 -> c Source #

Extendable t => Extendable (Yoneda t) Source # 
Instance details

Defined in Data.Functor.Yoneda

Methods

(=>>) :: Yoneda t a -> (Yoneda t a -> b) -> Yoneda t b Source #

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

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

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

(=<=) :: (Yoneda t b -> c) -> (Yoneda t a -> b) -> Yoneda t a -> c Source #

(=>=) :: (Yoneda t a -> b) -> (Yoneda t b -> c) -> Yoneda t a -> c Source #