News for hackers. Stuff that matters.
Re:Haskell and the "foul stench of cargo cult mathematics" by applicative on Tuesday December 28, 2010 @04:06AM (#2045036)
`xi`, notice that if you substitute `Float` or `Double` for his `Int` throughout his module, you get the same type error he gets, as you would intuitively expect:

    [1 of 1] Compiling Main      
    Ok, modules loaded: Main.
    *Main> p [1,2,3,4,5]
    <interactive>:1:11:
        Ambiguous type variable `t' in the constraints:
 
If however you substitute `Integer` for `Int`, which is after all what he claims to have meant, then suddenly:

    [1 of 1] Compiling Main              
    Ok, modules loaded: Main.
    *Main> p [1,2,3,4,5]
    (5x^4 + 4x^3 + 3x^2 + 2x + 1)
    *Main> :t it
    it :: UnivariatePolynomial Integer
It seems, then, that if he had known that in Haskell the 'integer' type is called Integer, not Int, he wouldn't have had any difficulty, or any blog post, or any occasion unjustly to malign his teachers `conal` and `mauke`, to whom he ought rather to be grateful.

There are no comments on this comment yet.