3 ms·
> functional languages like Haskell where you're forced to use functional algorithms for all computation No you're not. Haskell supports mutable, imperative,
by tome 10y ago
> functional languages like Haskell where you're forced to use functional algorithms for all computation
No you're not. Haskell supports mutable, imperative, algorithms just fine.
https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-IORef.html https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-I...
https://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-ST.html https://hackage.haskell.org/package/base-4.9.0.0/docs/Contro...
https://hackage.haskell.org/package/stm-2.4.4.1/docs/Control-Concurrent-STM-TVar.html https://hackage.haskell.org/package/stm-2.4.4.1/docs/Control...
- ZenoArrow 10y agoThanks. If anything that backs up my main point that most programming languages are multi-paradigm.
- codygman 10y agoYes, but it doesn't bolster your argument as much as you think. The state monad in Haskell offers a more principled (some say annoying) way of dealing with mutation. IORef's if I recall correctly offer the type of mutation similar to what is colloquially thought of as mutation. These add to your argument a bit, but they're usually seen more of a last resort
- tome 10y agoSort of. My very opinionated point of view would be that Haskell demonstrates that the functional paradigm is the correct setting for the imperative style.