[project @ 2001-02-20 18:40:54 by qrczak]
authorqrczak <unknown>
Tue, 20 Feb 2001 18:40:54 +0000 (18:40 +0000)
committerqrczak <unknown>
Tue, 20 Feb 2001 18:40:54 +0000 (18:40 +0000)
commit8c2df3eadf32517d1c1b7ff3d6d9404f40dfe288
tree2c6dbf8f36e59a7827ab8c30b3349ab4bd076153
parent29920fbc163944859166a6fde6136e6db50982ef
[project @ 2001-02-20 18:40:54 by qrczak]
Apply tweaks needed to let this compile: remove syn_map argument from
typecheckExpr in HscMain, import PrelNum.fromInt to modules which
use integer literals with -fno-implicit-prelude flag.

It crashes later, on Directory.hs:
ghc: panic! (the `impossible' happened):
        srtExpr

I'm not sure if resolving numeric literals to top-level definitions
of fromInt/fromInteger with -fno-implicit-prelude is a good idea.
Using names from whatever module is called Prelude would be IMHO
better, probably when -fglasgow-exts is given. Prel* modules themselves
would import PrelNum as Prelude.

Both schemes break for fromInt, which is non-standard and by default
it's visible neither at the top level nor in the Prelude module. My
proposal for dealing with it is as follows (assuming that fromInteger
is taken from the module locally called Prelude instead of the top
level): when the standard Prelude is used, take fromInt from PrelNum;
when a Prelude replacement is used, use fromInt from it if available,
otherwise use its fromInteger instead. That way Prelude replacements
can ignore this non-standard extension and get the expected behavior,
or they can also choose to use this extension (in a way compatible
with Haskell implementations which allow to replace Prelude but don't
have fromInt).
ghc/compiler/main/HscMain.lhs
ghc/lib/std/PrelByteArr.lhs
ghc/lib/std/PrelIOBase.lhs
ghc/lib/std/PrelST.lhs