Re:Monads Schmonads: Functional Input Without Tears (PYFL)
by przemo_li on Wednesday June 02, 2021 @04:59AM
(#27366481)
That's because every single line of code is about side effect.
That means that you have already eliminated all the unnecessary side effects (in both cases), and there is no extra work that could be made pure (also in both cases).
Haskell gives you good tools to limit number of side effects to minimum necessary and verify that it is so.
JavaScript? It's free for all and people talk all the time how developer discipline leads to more maintainance codebases. Examples give for that discipline? (Almost) all are about more purity.
Re:Monads Schmonads: Functional Input Without Tears (PYFL)
by tome on Tuesday June 01, 2021 @02:28AM
(#27351264)
I wrote down the properties that we acutally care about when we talk about purity at https://news.ycombinator.com/item?id=27261487
Haskell have the feature that the type system can statically verify if functions are pure or not. This is very cool, but it does not change the semantics or purity of a function, it just verifies it statically.