Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Covariant t => Extendable t where
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
(=>>) :: 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 # | |
Defined in Data.Functor.Identity (=>>) :: 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 t => Extendable (Yoneda t) Source # | |
Defined in Data.Functor.Yoneda (=>>) :: 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 # |