Reputation: 1819
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?
Upvotes: 4
Views: 905
Reputation: 10814
In other words free monads provide the interface for things like join and map which the client will implement themselves?
In a way yes. But I think a better way to say this is: "a free monad provides a language while its instances implement different interpreters of that language."
The monad is free because it is not constraint in any other way than by the monads laws. Its instances are not free as specific interpretations add additional constraints.
Upvotes: 2