GHC 6.4 release candidates available

Keean Schupke k.schupke at imperial.ac.uk
Mon Mar 7 04:33:06 EST 2005


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.




More information about the Glasgow-haskell-users mailing list