diff options
author | simonpj <unknown> | 2001-03-13 14:58:28 +0000 |
---|---|---|
committer | simonpj <unknown> | 2001-03-13 14:58:28 +0000 |
commit | 788faebb40b51d37e73ed94dfc99460d39a1a811 (patch) | |
tree | 5aed135958315fcb297c1c4908440775fdbdf1ad /ghc/compiler/main/CodeOutput.lhs | |
parent | 6a44ce76861d73d59badc8f8c17ffbd52eff17ba (diff) | |
download | haskell-788faebb40b51d37e73ed94dfc99460d39a1a811.tar.gz |
[project @ 2001-03-13 14:58:25 by simonpj]
----------------
Nuke ClassContext
----------------
This commit tidies up a long-standing inconsistency in GHC.
The context of a class or instance decl used to be restricted
to predicates of the form
C t1 .. tn
with
type ClassContext = [(Class,[Type])]
but everywhere else in the compiler we used
type ThetaType = [PredType]
where PredType can be any sort of constraint (= predicate).
The inconsistency actually led to a crash, when compiling
class (?x::Int) => C a where {}
I've tidied all this up by nuking ClassContext altogether, and using
PredType throughout. Lots of modified files, but all in
more-or-less trivial ways.
I've also added a check that the context of a class or instance
decl doesn't include a non-inheritable predicate like (?x::Int).
Other things
* rename constructor 'Class' from type TypeRep.Pred to 'ClassP'
(makes it easier to grep for)
* rename constructor HsPClass => HsClassP
HsPIParam => HsIParam
Diffstat (limited to 'ghc/compiler/main/CodeOutput.lhs')
-rw-r--r-- | ghc/compiler/main/CodeOutput.lhs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 1e33654169..33357fcbc2 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -35,6 +35,7 @@ import CmdLineOpts ( DynFlags, HscLang(..), dopt_OutName ) import TmpFiles ( newTempName ) import IO ( IOMode(..), hClose, openFile, Handle ) +import IO ( hPutStr, stderr) -- Debugging \end{code} @@ -81,7 +82,8 @@ codeOutput dflags mod_name tycons core_binds stg_binds doOutput :: String -> (Handle -> IO ()) -> IO () doOutput filenm io_action - = (do handle <- openFile filenm WriteMode + = (do hPutStr stderr ("Writing to" ++ filenm) + handle <- openFile filenm WriteMode io_action handle hClose handle) `catch` (\err -> pprPanic "Failed to open or write code output file" |