pandora-0.1.2: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.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 Pandora.Paradigm.Basis.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 #

Covariant t => Extendable (Cofree t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Cofree

Methods

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

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

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

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

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

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

Extendable (Product a) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.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 (Storage p t) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory.Storage

Methods

(=>>) :: Storage p t a -> (Storage p t a -> b) -> Storage p t b Source #

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

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

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

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

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