Hi,
I've got a competitor here for most annoying hugs error message :-)

I have a function caculate, that includes a local function alterVal. There
are a
fair number of other local definitions as well.

calculate e = 
 let ...
     alterVal :: ((Int -> Int) -> Int) -> Bool -> Int
     alterVal alter True = alter (+1)
     alterVal alter False = alter (-1)

     ...
 in
 ...

hugs 98 complains 

ERROR "Test.hs" (line 62): Instance of Num (Int -> Int) required for
definition
of calculate

This is fairly useless for trying to track the error down. 
(The subtle error being that the second line of alterVal needs to be
 alterVal alter False = alter (\x -> x - 1), as (-1) :: Num a => a)

I had to strip out every line of the calculate function until I came across
the
error.
Would it be possible in future to get better line number references for
these
sorts of errors?

Thanks
  Meurig

Reply via email to