Add minimal pragmas.

This commit is contained in:
Paweł Nowak 2014-12-11 16:29:03 +01:00
parent 67c1554771
commit c97679d0e3
2 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,8 @@ class Category cat => Products cat where
(***) :: cat a b -> cat c d -> cat (a, c) (b, d)
a *** b = first a >>> second b
{-# MINIMAL (***) | first, second #-}
instance Monad m => Products (Kleisli m) where
(***) = (BadArrow.***)
@ -45,6 +47,8 @@ class Category cat => Coproducts cat where
(+++) :: cat a b -> cat c d -> cat (Either a c) (Either b d)
a +++ b = left a >>> right b
{-# MINIMAL (+++) | left, right #-}
instance Monad m => Coproducts (Kleisli m) where
(+++) = (BadArrow.+++)
@ -52,9 +56,13 @@ class Category cat => CatPlus cat where
cempty :: cat a b
(/+/) :: cat a b -> cat a b -> cat a b
{-# MINIMAL cempty, (/+/) #-}
instance MonadPlus m => CatPlus (Kleisli m) where
cempty = BadArrow.zeroArrow
(/+/) = (BadArrow.<+>)
class CategoryTrans t where
clift :: Category cat => cat a b -> t cat a b
{-# MINIMAL clift #-}

View File

@ -41,6 +41,8 @@ class (Products cat, Coproducts cat, CatPlus cat) => SIArrow cat where
simany :: cat () b -> cat () [b]
simany v = sisome v /+/ sipure _Empty
{-# MINIMAL siarr #-}
instance MonadPlus m => SIArrow (Kleisli m) where
siarr ai = Kleisli $ either fail return . apply ai