Here's a small example of a diagnostic message which misled me today. This
was with Hugs 98 version 990121 beta.
a = check 0.0
b = 0.0
c = 0.0
d = 0.0
e = 0.0
f = 0.0
g = 0.0
x :: Double
x = sum vList
vList = [a,b,c,d,e,f,g] :: Double
check :: Double -> String -> Double
check x msg = if x == 0.0 then x else error msg
The diagnostic was;
ERROR "hugsmsg2.hs" (line 10): Type error in list
*** Expression : [a,b,c,d,e,f,g]
*** Term : b
*** Type : Double
*** Does not match : String -> Double
My actual error occurred with the definition of a.
The diagnostic message was complaining about b. I
expected that the type annotation on the expression
[a,b,c,d,e,f,g] :: Double
would help Hugs pin down the error, since Hugs would
be able to infer that the expression b agreed between
its definition and its context. Instead, Hugs continued
to complain about b and gave no indication of where it
was picking up the idea that b needed to be String -> Double.
--
Scott Turner
[EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner