|
|
|
|
|
by caughtexception
4480 days ago
|
|
I am fed up with these "pure" people. They have hijacked every sane discussion about programming into a condescending -- "Do you have monads and typeclasses ?". It's absolutely unhealthy. State is not Evil. Languages like clojure, scheme take imperative features and give it more beautiful abstractions. In what profession, do you find people complaining about the very foundations and thinking it's cool ? It's like Musicians saying Rhythm is stupid. If you haven't written a State Machine with goto's and never marvelled at it's beauty ... please just try it. |
|
I agree!
You're mistaken if you think Haskell users don't take advantage of state or side effects. They do, you just don't understand the difference.
Try this course:
http://www.seas.upenn.edu/~cis194/lectures.html
Then see LYAH's section on the State monad:
http://learnyouahaskell.com/for-a-few-monads-more
Then reflect on ST:
http://www.haskell.org/haskellwiki/Monad/ST
Then this example using mutable variables and closures:
http://bitemyapp.com/posts/2014-03-25-when-nested-io-actions...
Side-effecting closures mutating variables!
It's not "no state or side effects".
It's about making state and side effects typed and explicit so they can be properly composed and manipulated.