4 ms·
I think the reason so many people have trouble understanding functors and monads is because they are not complex constructions but look useless when you see the
by WastingMyTime89 5y ago
I think the reason so many people have trouble understanding functors and monads is because they are not complex constructions but look useless when you see them.
There is nothing inherently interesting about functors and monads. Haskell, as a research project, discovered that you could isolate IO in a lazy language inside a type using a monadic construction to chain them which allows you to track side effects. That was interesting, the rest less so.
Now the Haskell community somewhat fetishized these abstractions for reasons which are their own. They must be apparent to the community at large. They are not to me.
- hu3 5y ago> Haskell, as a research project, discovered that you could isolate IO in a lazy language inside a type using a monadic construction to chain them which allows you to track side effects. Sounds like LINQ in C#. I wonder if there's any correlation.
- loopz 5y agoLINQ is being worked on by the same people developing/designing Haskell. These methods are slowly being injected. LINQ is monadic and has a bind function that generalize beyond IEnumerable.
- zem 5y agothe reason for "fetishizing abstractions" is that you can write libraries that work with the generic structure of those abstractions, and are therefore automatically useful for all the specific cases. the design of ruby's "Enumerable" library in the standard lib is a good example, it's a huge collection of methods that works for anything that supplies an 'each' iterator.
- WastingMyTime89 5y agoI was specifically talking about these abstractions as monads and functors not abstraction in general. Enumerable is a lot less abstract than both monads and functors. I personally don't think Haskell stand at the right level of abstraction but that's a personal opinion.
- zem 5y ago'do' notation is a good example of where the monad abstraction comes in handy.