[1,2,3,4,5] :: [Int] problem solved!
[1,2,3,4,5] :: [Int] problem solved!
I appreciate that his goals were more mathematically oriented than not, but surely he would've seen something like this coming?
In GHCi (the interpreter) this doesn't happen. It has some defaulting rules to alleviate this, but I don't quite understand them, so I can't say why they didn't kick in in this case.
One of the first things you learn as a Haskell programmer is to treat type inference with suspicion.
The sad thing about the original article is that the writer is throwing his hands up and raging over what is really a small implementation hiccup. I kind of like that the compiler withholds judgment on whether '5' is a Float, Int, or Integer. It means that I no longer need to type ".0" after every Float.