All examples in the post is Haskell. I think static typing is good, but Haskell is bad. Let me quote Ben Lippmeier's words in his PhD thesis:
"I am thinking of a data structure for managing collections of objects. It provides O(1) insert and update operations. It has native hardware support on all modern platforms. It has a long history of use. It's proven, and it's lightning fast.
Unfortunately, support for it in my favourite language, Haskell, appears to be somewhat lacking. There are people that would tell me that it's not needed, that there are other options, that it's bad for parallelism and bad for computer science in general. They say that without it, programs are easier to understand and reason about. Yet, it seems that every time I start to write a program I find myself wanting for it. It's called the store.
The mutable store, that is. I want for real destructive update in a real functional language. I wanted it for long enough that I decided I should take a PhD position and spend the next several years of my life trying to get it."
With great reluctance, I am over the last year starting to agree with your position on Haskell.
For many years I have had a lot of fun with Haskell, doing some NLP, and web stuff with Yesod and Scotty.
However, I am so much more production in a concise dynamic language like Ruby that I am re-evaluating my fondness for Haskell. Also, to a small degree, good IDEs like RubyMine catch some simple errors for you.
I, like Elben Shira, hope for radical new technologies that make me feel like I am developing in Ruby with the safety and speed of Haskell. I am looking forward to the future.
Well, Haskell does certainly have mutable storage. They just all live at the IO monad, because they are mutable...
Anyway, code that patches immutable data compiled by GHC behaves much like the plain mutable storage you'd write in C. It may not be always simpler to write (but for complex data, it normally is - and why are you writing so much simple data anyway? is it because of your language limitations?) but is checked by the compiler, what's a great bonus.
Well, er, Haskell does have destructive update. You are misunderstanding Ben's point is somewhat. "We present a type based mutability, effect and data sharing analysis for reasoning about such programs [containing mutable data]".
How am I misunderstanding? I am quoting exact words, after all. Re IORef and STRef, let's quote some more:
"Representing effects in value types is a double edged sword (p. 42). Haskell has fractured into monadic and non-monadic sub-languages (p. 44). Monad transformers produce a layered structure (p. 45)." These are section titles, be sure to read the entire sections which explain in details what the title means.
I can't work out why you're being downvoted. Kneejerk reaction for anything that is critical of Haskell maybe? Unfortunately that does seem to be very common on HN.
Ben Lippmeier makes a very good point and is being quoted in full here. Haskell does have issues, and people are trying to fix those issues. If they can be resolved isn't known yet, and the resulting language may be different from Haskell. Haskell is a long way from some pinnacle of perfection, and it is very much not a silver bullet to solving problems. Not that anything in computer software is a silver bullet [1].
"I am thinking of a data structure for managing collections of objects. It provides O(1) insert and update operations. It has native hardware support on all modern platforms. It has a long history of use. It's proven, and it's lightning fast.
Unfortunately, support for it in my favourite language, Haskell, appears to be somewhat lacking. There are people that would tell me that it's not needed, that there are other options, that it's bad for parallelism and bad for computer science in general. They say that without it, programs are easier to understand and reason about. Yet, it seems that every time I start to write a program I find myself wanting for it. It's called the store.
The mutable store, that is. I want for real destructive update in a real functional language. I wanted it for long enough that I decided I should take a PhD position and spend the next several years of my life trying to get it."
http://benl.ouroborus.net/papers/thesis/lippmeier-impure-wor...
While I admire him, I think the better solution is to give up Haskell.