No line number in implicit parameter error message

Simon Peyton-Jones simonpj at microsoft.com
Thu May 3 05:46:04 EDT 2001


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:reid at cs.utah.edu] 
| Sent: 26 April 2001 21:02
| To: glasgow-haskell-bugs at haskell.org
| 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        reid at cs.utah.edu        
| 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 
| Glasgow-haskell-bugs at haskell.org 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs
| 




More information about the Glasgow-haskell-bugs mailing list