3 ms·
> although hard-core Haskellers will object that it hides what really is going on I've never seen anybody say this. Many people say that when learning you must
by marcosdumay 6y ago
> although hard-core Haskellers will object that it hides what really is going on
I've never seen anybody say this. Many people say that when learning you must avoid it a few times to understand it, but I never saw anybody claiming it hides things for experienced developers.
Also, I think the idea is very far fetched, expanding do notation on your head when reading code is one of the minimum skills to make proper use of the language, thus it can't hide anything to hard-core Haskellers. Anyway, if you think your program is better structure using do, use it and don't stop to listen to criticism.
- hanslub42 6y agoI agree 100%. But see: https://wiki.haskell.org/Do_notation_considered_harmful https://wiki.haskell.org/Do_notation_considered_harmful
- danidiaz 6y agoI believe that negative view of do notation is not popular nowadays. The tendency is to lean more on it. There are language extensions like ApplicativeDo and the newer QualifiedDo which expand the reach of the notation.
- marcosdumay 6y agoOh, but notice that all those reported problems either have the "newcomers" word on them or are cases of your code having a worse structure due to it. Also GHC now has features to revert all the bad structure problems cited there. There is no wildcard advice of "use do notation" or "avoid do notation" possible. It's an incredibly handy tool, but you need to decide for yourself if it improves your code or not.
- The_rationalist 6y agoMy "teacher" (a cargo cult "craftman") banned the use of do among other ivory tower extremisms.