Good point.  I've dramatically improved the error message to:

      Foo.hs:8:
        Couldn't match `Int' against `[(String, Int)]'
            Expected type: Int
            Inferred type: [(String, Int)]
        When using functional dependencies to combine
          ?env :: Int, arising from a type signature at Foo.hs:7
          ?env :: [(String, Int)],
            arising from use of implicit parameter `?env' at Foo.hs:8
        When generalising the types for ident

Simon

| -----Original Message-----
| From: Alastair Reid [mailto:[EMAIL PROTECTED]] 
| Sent: 26 April 2001 21:02
| To: [EMAIL PROTECTED]
| Subject: No line number in implicit parameter error message
| 
| 
| 
| GHC 5.0 doesn't tell me which line the error is on in the 
| attached program.
| 
| $ rm -f T.o && ghc -c -fglasgow-exts T.hs 
| 
| Couldn't match `Int' against `[(String, Int)]'
|     Expected type: Int
|     Inferred type: [(String, Int)]
| 
| The type error itself is correct: the type of ?env in the 
| signature for ident should be Env not Int.
| 
| -- 
| Alastair Reid        [EMAIL PROTECTED]        
| http://www.cs.utah.edu/~reid/
| 
| module T where
| 
| import Maybe
| 
| 
| type Env = [(String,Int)]
| 
| ident :: (?env :: Int) => String -> Int
| ident x = fromJust (lookup x ?env)
| 
| _______________________________________________
| Glasgow-haskell-bugs mailing list 
| [EMAIL PROTECTED] 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs
| 

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to