3 ms·
The author is really more accurately talking about free monads. With free monads, you make the nomadic structure clear and defer the interpretation of monastic
by kccqzy 5y ago
The author is really more accurately talking about free monads. With free monads, you make the nomadic structure clear and defer the interpretation of monastic structure for later.
Even in Haskell free monads are used pretty sparingly, so it's definitely not every day defining their own bind or return as data.
- dllthomas 5y ago> definitely not every day defining their own bind or return as data. I mean, thunks? But yeah, certainly not at the level we usually think of when we talk about defining data in Haskell. But I can see labeling that an implementation issue. You need to get your dictionary to the right place somehow, and lacking the automatic type-driven threading of type classes I don't know that writing an interpreter for each is the wrong choice. For a lot of monads (reader, state, etc) you want an "interpreter" anyway. It does mean that regular values can't happen to have a relevant monad that you can use to stitch them together in a way that wasn't noticed by the person who created the value.