Is it possible to change the kind of a Monad? Let’...
# arrow
g
Is it possible to change the kind of a Monad? Let’s say I have
Kind<F, A>
and I want a function that turns it into
Kind<G, A>
. Or even to
Kind<G, B>
p
Yes... In category theory, this kind of transformation is called 'natural transformation'. Not really promoted in Arrow. Consider also the use of MTL typeclasses (Arrow monad transformers are in incubation)
j
A natural transformation in arrow is implemented as
FunctionK
iirc. Outside of free monads or other special uses its usually not what one needs. If your use case is something special or free monads by all means go for it but otherwise there are likely easier methods to do specific transformations
☝🏼 1
you need to know how to go from F to G to get an exhaustive transformation
this essentially let’s you compose ADTs
is A -> B at the kind level
g
Thanks everyone. I’ll have a look at
FunctionK
.