3 ms·
I agree 100%. But see: https://wiki.haskell.org/Do_notation_considered_harmful https://wiki.haskell.org/Do_notation_considered_harmful
by hanslub42 6y ago
I 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.