
| >If you could specify overlapping on a per-instance basis, then that | >would be a way around the problem. Yes, that's the solution I prefer. The only question is when to action it.... | This worked in all GHCi before 6.4 - so something has broken the (in mu | opinion) correct | behavior. Was this a deliberate decision - or has something just changed | without anyone realising? I explained in an earlier message in this thread why the new behaviour was an accidental consequence of lazy reporting of overlapping instances. Simon

Simon Peyton-Jones wrote:
I explained in an earlier message in this thread why the new behaviour was an accidental consequence of lazy reporting of overlapping instances.
So, {-# OPTIONS -f<anything except overlapping instances> #-} works as expected, only overlapping instances is affected. I don't see why it requires a per-instance fix (although that would be nice). If I start ghci with multiple source files: ghci A.hs B.hs C.hs we get: *C> as the prompt - in this case why not just let the options pragma's from 'C.hs' be in force in the interpreter. This fix is quick, and intuitive as the interpreter is telling you what it thinks is the context. Consider the situation where ghci is used as an embedded interpreter in another project. In the case where we do not know what options a given script may require. The only other solution I can think of is to have a wrapper script: #!/bin/csh if (`grep '^{-# OPTIONS -fallow-overlapping-instances #-} $1` != "") then ghci_real -fallow-overlapping-instances $1 else ghci_real $1 endif I suppose you could check all top level .hs files given on the command line for a more thorough check. Keean.
participants (2)
-
Keean Schupke
-
Simon Peyton-Jones