by skwirl · 13y ago · 0 comments
In actuality the author is trying to sell Haskell because he sells Haskell IDEs.
I'm not knocking Haskell, but let's not pretend that this is a useful piece of journalism.
The shallowness of the article combined with the background of the author can be reconciled if you understand the article as an advertisement.
The difference is that Haskell is a very principled language. All of the claims and excitement are actually backed up by mathematical proofs. Pure functions really do make your code easier to maintain.
And no, it's not the case that Haskell is the only language which allows you to write pure functions. People who try to claim that are being silly and dishonest. Haskell's advantage is that its type system allows you to know at a glance whether or not a function is pure.
I disagree. You can make objective measurements of maintainability. You can look at cyclomatic complexity and reusability (both wins for pure functions). You can test how often changes lead to bugs and how often the errors are caught. There are many instances of Haskell code where there is only one sensible implementation of a function, given its type. Hell, some Haskell libraries have even been formally verified though admittedly that is done with external packages.
I will agree on one thing, though: you do run into trouble when you throw around the word all (or indeed any absolute) without actually meaning it.
Allowing the type of value to to depend on the value itself. A common example being a list that can expresses whether it is empty or not in its type. These types allow one to write functions with signatures like: `safeHead :: SafeList a NonEmpty -> a`. Uses of this function will fail to compile if I can not prove that my list will always be non-empty.
Combine this with the well known Curry-Howard Correspondence [3] which shows that types have a direct correspondence to proofs. The logical extension of this is computer theorem proving languages like Coq, Agda, Epigram, Idris.
For example Coq[4] uses a dependently typed lambda calculus as its proof term language, and sees wide spread use in the formal verification of software. It is not a stretch to say that less powerful types systems like Haskell's allow us to encode some forms of proof. If you view the type checker as an proof checker, one provides propositions to it (in the form of types) and then supplies proof (in the form of terms). These can be trivial propositions like `a :: Int`, which in Haskell there are 2^31 correct answers.
[1] (http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf)
[2] (http://en.wikipedia.org/wiki/Dependent_type)
[3] (http://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspond...)
[4] (http://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspond...)
I found it really interesting to see how a large team can deal with a real haskell project.
[1]: http://www.haskellcast.com/episode/002-don-stewart-on-real-w...