3 ms·
I think there's a lot of people confusing the bricks of functional programming with what you can build with them. The interesting thing about 'monads' isn't bi
by jerf 5y ago
I think there's a lot of people confusing the bricks of functional programming with what you can build with them.
The interesting thing about 'monads' isn't bind and return. The interesting thing is the Control.Monad functions that build on them, and by making something that conforms to the monadic interface, you get to use them: https://hackage.haskell.org/package/base-4.15.0.0/docs/Control-Monad.html#g:5 https://hackage.haskell.org/package/base-4.15.0.0/docs/Contr...
Just like the special thing about iterators isn't that you can get the "next" thing. That's not impressive on its own. The magic is in the tools you get that can generically use and manipulate iterators if they conform to a particular interface.
- lalaithion 5y agoExample of a time when the Control.Monad functions were useful to me: https://lalaithion.xyz/posts/practical_monad.html https://lalaithion.xyz/posts/practical_monad.html
- endgame 5y agoExactly this. The power of an abstraction is roughly the product of two metrics: 1. How many things "fit" this abstraction? 2. What does this abstraction let me say? The abstraction "Monad" has many inhabitants, and the Control.Monad module shows that it lets you say many things -> it is a very useful abstraction. The abstraction "Applicative" has many more inhabitants, but lets you say fewer things -> it is still a useful abstraction.