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
PhBastiani
05/17/2020, 5:33 PM
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
Jannis
05/17/2020, 6:08 PM
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