Redundancy in implicit parameter error messages

Simon Peyton-Jones simonpj at microsoft.com
Mon Aug 20 07:54:56 EDT 2001


Your wish is my command.   (At least when I'm flying transatlantic.)

Simon

Foo.hs:13:
    Could not deduce (?y :: Int, ?x :: Int) from the context ()
    Probable fix:
	Add (?y :: Int, ?x :: Int) to the type signature(s) for g
    arising from use of `f' at Foo.hs:13
    In the definition of `t': f w

| -----Original Message-----
| From: Alastair David Reid [mailto:reid at cs.utah.edu] 
| Sent: 17 August 2001 02:06
| To: glasgow-haskell-bugs at haskell.org
| Subject: Redundancy in implicit parameter error messages
| 
| 
| 
| If you have a function with several implicit parameters, you 
| get a separate error message for every implicit parameter 
| that is not provided or available.  For example, I routinely 
| see error messages like the following which differ only in 
| the 2nd line of each message (the bit that says what could 
| not be deduced) and the 4th and 6th lines which suggest a fix.
| 
| It'd be easier to understand what I did wrong if I got just 
| one error message.  This is especially so because common 
| changes like factoring out a repeated piece of code into a 
| single function tends to generate implicit parameter errors 
| and generates them in very place that calls the function and 
| in the definition itself - so there's a lot of error messages 
| to wade through.
| 
| 
| ../TcUnits.hs:170:
|     Could not deduce `?fenv :: FlagsEnv' from the context ()
|     Probable fix:
|         Add `?fenv :: FlagsEnv'
|         to the type signature(s) for {bundleIdents, bs', 
| benvty, benvty2, glues', benvty1, benv, ty, imps', exps', oenv}
|         Or add an instance declaration for `?fenv :: FlagsEnv'
|     arising from use of `binding' at ../TcUnits.hs:170
|     In the first argument of `concatMap', namely `binding'
|     in the definition of function `bs'':
|         concatMap binding bs with [(flatten, flatten), 
| (benvty, benvty),
|                                    (benv, benv)]
| 
| ../TcUnits.hs:170:
|     Could not deduce `?btenv :: BTEnv' from the context ()
|     Probable fix:
|         Add `?btenv :: BTEnv'
|         to the type signature(s) for {bundleIdents, bs', 
| benvty, benvty2, glues', benvty1, benv, ty, imps', exps', oenv}
|         Or add an instance declaration for `?btenv :: BTEnv'
|     arising from use of `binding' at ../TcUnits.hs:170
|     In the first argument of `concatMap', namely `binding'
|     in the definition of function `bs'':
|         concatMap binding bs with [(flatten, flatten), 
| (benvty, benvty),
|                                    (benv, benv)]
| 
| ../TcUnits.hs:170:
|     Could not deduce `?uenv :: UnitEnv' from the context ()
|     Probable fix:
|         Add `?uenv :: UnitEnv'
|         to the type signature(s) for {bundleIdents, bs', 
| benvty, benvty2, glues', benvty1, benv, ty, imps', exps', oenv}
|         Or add an instance declaration for `?uenv :: UnitEnv'
|     arising from use of `binding' at ../TcUnits.hs:170
|     In the first argument of `concatMap', namely `binding'
|     in the definition of function `bs'':
|         concatMap binding bs with [(flatten, flatten), 
| (benvty, benvty),
|                                    (benv, benv)]
| 
| 
| 
| -- 
| Alastair Reid        reid at cs.utah.edu        
| http://www.cs.utah.edu/~reid/
| 
| 
| _______________________________________________
| 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