[<<][haskell][>>][..]
Fri Feb 14 17:05:31 EST 2020

redefine classes on top of kleisli arrows

So instead of using functions, use kleisli arrows to define the usual
type class structure.  Does that make any sense?  Does it reduce to
something that exists?

Start with map:

normal:  (a -> b) -> f a -> f b

new:     (a -> m b) -> f a -> m (f b)

That is traverse, where m can be just an applicative, and the functor
f needs to be traversable.  I.e. it needs to have a natural sequential
order.

How does applicative generalize?  E.g. for the special case 2-op:

normal:  (a -> b -> c) -> f a -> f b -> f c

new:     (a -> b -> m c) -> f a -> f b -> m (f c)

Which is traverse2




[Reply][About]
[<<][haskell][>>][..]