I have a few questions about Haskell — Tail Recursion, Varibles and Functions, and Immutable Varibles.
For the last few days I have been messing with functional programming, mostly in Haskell. And I have a few questions Haskell does not have loops, instead it uses tail recursion. But isn't standard looping better than tail recursion because there is no chance for a stack overflow. I also would make the case that a 'while' loop in C/C++ reads better than tail recursion. Variables are functions in haskell that immediately return a value. What is the advantage of doing this rather than making functions expressions like in ocaml (let add = fun x y -> x + y;; VS. add x y = x + y) and using standard variables. Why is everything immutable? I actually find it quite useful to be able to manipulate the value of something. So what is the philosophical (and practical) reason for making everything immutable.
Submitted July 17, 2017 at 05:59AM by bashisbest
via reddit http://ift.tt/2t86gJs