[Haskell-cafe] what I learnt from my first serious haskell programm

Fawzi Mohamed fmohamed at mac.com
Tue Mar 20 10:37:45 EDT 2007


Bulat Ziganshin wrote:
> Hello Fawzi,
>
> Tuesday, March 20, 2007, 1:47:48 PM, you wrote:
>
>   
>> That was the reason that is spoke of aldor ( http://www.aldor.com ), as
>>     
ehm http://www.aldor.org
>> it has type inference, but yes indeed this makes type inference much 
>> more difficult and undefined in some cases (also haskell extensions make
>> inference in general impossible).
>>     
>
> the problem is not only implementation, but error messages. are you
> want to see a message like "a should be Int, b should String, and ñ
> should be Double; or x should be String and y Int; or ñ should be
> [Int]" ? :)
>   
ambiguous function call at line xxx.
Possible instances are:
    f: Int -> String -> Double -> a
    f: String -> Int -> [Int] -> a
please explicitly annotate the type to disambiguate

Note that you want to use also the type of the result to disambiguate.
Not easy, but doable, and done, again I can understand why haskell did 
not do it.

Fawzi


More information about the Haskell-Cafe mailing list