I've been reading some materials on free monads and I don't really think I'm much closer to implementation but I think I am closer to understanding what they are!
Given a lot of the above resources, what I understand is that free monads "free" the "monad" (which is a data type) from the "computational" work. In other words free monads provide the interface for things like join
and map
which the client will implement themselves?
data Free f r = ...
, as long asf
is a functor, thenFree f
is a monad, without having to consider exactly whatf
is. – chepner