Open turion opened 6 years ago
The corresponding Arrow
type class would look something like:
class CategoryEffect (cat :: k -> * -> * -> *) where
type Unit cat :: k
type Plus cat (f :: k) (g :: k) :: k
type Inv cat (f :: k) (g :: k) :: Constraint
type Inv cat f g = ()
id :: cat (Unit cat) a a
(>>>) :: Inv cat f g => cat f a b -> cat g b c -> cat (Plus cat f g) a c
class CategoryEffect a => ArrowEffect (a :: k -> * -> * -> *) where
arr :: (b -> c) -> a (Unit a) b c
first :: a f b c -> a f (b, d) (c, d)
Cool idea! Let's do it! Do you want to a PR or should I move this code into a new module?
I can make a PR.
We could define
Kleisli
as:It would be an instance of a generalised
Arrow
instance which would yet have to be defined.