Re:The general value of typed functional programming lies in...
by BoiledCabbage on Monday February 24, 2020 @03:07PM
(#22407883)
No, but it's the difference between implicit and explicit stupidity. All of us do implicit stupidity all of the time - it's human nature (or more accurately a side effect of working in a difficult field). When transformed into a choice between explicit stupidity, or doing things the right way, we instead usually choose to to do things the right way -- or at minimum do it the wrong way to test something out then change it to the write way. Being explicit is what makes that change likely to happen, rather than just be ignored.
Re:The general value of typed functional programming lies in...
by dmitriid on Tuesday February 25, 2020 @02:54PM
(#22416732)
No. No matter how much you dress it with words, technology is not magic. Monads are not magic. Haskell is not magic.
If your data and/or problem is modeled as "if 0 then N/A" no amount of "human nature implicitly explicitly transformed" will help you.
Dealing with non-existent data as opposed to "value = 0" is just as natural in Java, C++ or Javascript as it is in Haskell. And yet, that didn't help.
If you encompass it this way. Literally nothing stops you from encoding this behavior in Haskell. Because the behavior you described is *if revenue is equal to zero, display it as N/A".
No magic monad will prevent this.