constrained-categories-0.3.0.1: Constrained clones of the category-theory type classes, using ConstraintKinds.

Copyright(c) 2013 Justus Sagemüller
LicenseGPL v3 (see COPYING)
Maintainer(@) sagemueller $ geo.uni-koeln.de
Safe HaskellTrustworthy
LanguageHaskell2010

Control.Applicative.Constrained

Contents

Description

 

Synopsis

Documentation

Monoidal / applicative functors

class (Functor f r t, Cartesian r, Cartesian t) => Monoidal f r t where Source

Methods

pureUnit :: UnitObject t `t` f (UnitObject r) Source

fzipWith :: (ObjectPair r a b, Object r c, ObjectPair t (f a) (f b), Object t (f c)) => r (a, b) c -> t (f a, f b) (f c) Source

Instances

Applicative f => Monoidal f (->) (->) Source 

class (Monoidal f r t, Curry r, Curry t) => Applicative f r t where Source

Minimal complete definition

pure

Methods

pure :: (Object r a, Object t (f a)) => a `t` f a Source

Note that this tends to make little sense for non-endofunctors. Consider using constPure instead.

(<*>) :: (ObjectMorphism r a b, ObjectMorphism t (f a) (f b), Object t (t (f a) (f b)), ObjectPair r (r a b) a, ObjectPair t (f (r a b)) (f a), Object r a, Object r b) => f (r a b) `t` t (f a) (f b) infixl 4 Source

Instances

Applicative f => Applicative f (->) (->) Source 

Helper for constrained categories

constrainedFZipWith :: (Category r, Category t, o a, o b, o (a, b), o c, o (f a, f b), o (f c)) => (r (a, b) c -> t (f a, f b) (f c)) -> ConstrainedCategory r o (a, b) c -> ConstrainedCategory t o (f a, f b) (f c) Source

Utility functions

constPure :: (WellPointed r, Monoidal f r t, ObjectPoint r a, Object t (f a)) => a -> t (UnitObject t) (f a) Source

fzip :: (Monoidal f r t, ObjectPair r a b, ObjectPair t (f a) (f b), Object t (f (a, b))) => t (f a, f b) (f (a, b)) Source

(<**>) :: (Applicative f r (->), ObjectMorphism r a b, ObjectPair r (r a b) a) => f a -> f (r a b) -> f b infixl 4 Source

liftA :: (Applicative f r t, Object r a, Object r b, Object t (f a), Object t (f b)) => (a `r` b) -> f a `t` f b Source

liftA2 :: (Applicative f r t, Object r c, ObjectMorphism r b c, Object t (f c), ObjectMorphism t (f b) (f c), ObjectPair r a b, ObjectPair t (f a) (f b)) => (a `r` (b `r` c)) -> f a `t` (f b `t` f c) Source

liftA3 :: (Applicative f r t, Object r c, Object r d, ObjectMorphism r c d, ObjectMorphism r b (c `r` d), Object r (r c d), ObjectPair r a b, ObjectPair r (r c d) c, Object t (f c), Object t (f d), Object t (f a, f b), ObjectMorphism t (f c) (f d), ObjectMorphism t (f b) (t (f c) (f d)), Object t (t (f c) (f d)), ObjectPair t (f a) (f b), ObjectPair t (t (f c) (f d)) (f c), ObjectPair t (f (r c d)) (f c)) => (a `r` (b `r` (c `r` d))) -> f a `t` (f b `t` (f c `t` f d)) Source