mix-arrows-1.0: Mixing effects of one arrow into another one

Safe HaskellNone

Control.Arrow.Mix.Category

Synopsis

Documentation

type :~> f g = forall i o. f i o -> g i oSource

Arrow morphism

type :~~> f g = forall i o. (i -> o) -> f i o -> g i oSource

Refined arrow morphism

type Along f input output i o = f (input, i) (output, o)Source

Sometimes we need to refine our morphism a bit; therefore, we use Along f i o instead of just f.

class AlMonad m whereSource

Something like a monad - but for arrows

Methods

alRet :: Arrow b => b :~> m bSource

alLift :: (Arrow b, Arrow c) => (Along b i1 o1 :~~> Along (m c) i2 o2) -> m b i1 o1 -> m c i2 o2Source

Instances

AlMonad f => AlMonad (:$~ f) 
Arrow a => AlMonad (Mix a) 

(~>>=) :: (AlMonad m, Arrow b, Arrow c) => m b i1 o1 -> (Along b i1 o1 :~> Along (m c) i2 o2) -> m c i2 o2Source

Most of time we don't need refined morphisms. That's why we would want a simpler combinator.

class AlFunctor f whereSource

Something like a functor - again, for arrows

Methods

alMap :: (Arrow b, Arrow c) => (Along b i1 o1 :~> Along c i2 o2) -> f b i1 o1 -> f c i2 o2Source

Instances

AlMonad m => AlFunctor (:$~ m) 

newtype (f :$~ a) input output Source

Declarations like instance Monad m => Functor m don't work well in Haskell. That's why we need a newtype.

Constructors

Apply 

Fields

runApply :: a input output `Strike` f a input output
 

Instances

AlMonad m => AlFunctor (:$~ m) 
AlMonad f => AlMonad (:$~ f) 
(AlMonad m, Arrow a) => Arrow (:$~ m a) 
(AlMonad m, ArrowChoice a) => ArrowChoice (:$~ m a) 
(AlMonad m, ArrowLoop a) => ArrowLoop (:$~ m a) 
(AlMonad m, Arrow a) => Category (:$~ m a)