simonpj@microsoft.com [Wed, 2 Apr 2008 15:34:10 +0000 (15:34 +0000)]
Fix Trac #2137: report correct location for shadowed binding
The error message generation for a shadowed binding was
plain wrong, at least where the shadowed binding isn't
top-level. Just a typo really -- the fix is trivial.
simonpj@microsoft.com [Wed, 2 Apr 2008 13:20:57 +0000 (13:20 +0000)]
Fix Trac #2141: invalid record update
See Note [Record field lookup] in TcEnv. The fix here
is quite straightforward.
Simon Marlow [Wed, 2 Apr 2008 05:14:12 +0000 (05:14 +0000)]
Do not #include external header files when compiling via C
This has several advantages:
- -fvia-C is consistent with -fasm with respect to FFI declarations:
both bind to the ABI, not the API.
- foreign calls can now be inlined freely across module boundaries, since
a header file is not required when compiling the call.
- bootstrapping via C will be more reliable, because this difference
in behavour between the two backends has been removed.
There is one disadvantage:
- we get no checking by the C compiler that the FFI declaration
is correct.
So now, the c-includes field in a .cabal file is always ignored by
GHC, as are header files specified in an FFI declaration. This was
previously the case only for -fasm compilations, now it is also the
case for -fvia-C too.
Ian Lynagh [Sun, 30 Mar 2008 18:28:13 +0000 (18:28 +0000)]
Derive a valid Ix instance for data Foo = Foo Int Int
The old one didn't satisfy the axioms. See trac #2158 for details.
Tim Chevalier [Sat, 29 Mar 2008 22:39:48 +0000 (22:39 +0000)]
Revive External Core parser
Huzzah, the External Core parser will now parse External Core generated by
the HEAD.
Most notably, I rewrote the parser in Parsec, but the old Happy version
remains in the repository.
I checked all the nofib benchmarks and most of the ghc-prim, base and integer
libraries to make sure they parsed; one known bug:
- Strings like "\x0aE", in which a hex escape code is followed by a
letter that could be a hex digit, aren't handled properly. I'm
investigating whether this is a bug in Parsec or expected behavior.
The checker and interpreter still don't work, but should compile.
Please mess around with the parser, report bugs, improve my code, etc.,
if you're so inclined.
Tim Chevalier [Sat, 29 Mar 2008 22:11:09 +0000 (22:11 +0000)]
Fix big character literal printing in External Core
Characters bigger than '\xff' should be represented as int
literals in External Core. (This was originally fixed five years ago
and broken again four and a half years ago...)
Tim Chevalier [Sat, 29 Mar 2008 19:46:29 +0000 (19:46 +0000)]
External Core: don't print superfluous parens in case types
The External Core printer was parenthesizing the scrutinee type in case expressions. Since this type is required to be atomic, the parens aren't necessary.
Ian Lynagh [Sat, 29 Mar 2008 18:50:43 +0000 (18:50 +0000)]
Don't import FastString in HsVersions.h
Modules that need it import it themselves instead.
Ian Lynagh [Sat, 29 Mar 2008 17:11:35 +0000 (17:11 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 17:10:13 +0000 (17:10 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 17:09:35 +0000 (17:09 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 17:03:41 +0000 (17:03 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 17:02:27 +0000 (17:02 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 16:54:12 +0000 (16:54 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 16:53:03 +0000 (16:53 +0000)]
Fix typo; spotted by Bdh in #ghc
Ian Lynagh [Sat, 29 Mar 2008 16:48:49 +0000 (16:48 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 16:44:20 +0000 (16:44 +0000)]
DEBUG removal
Ian Lynagh [Sat, 29 Mar 2008 16:42:09 +0000 (16:42 +0000)]
Remove a DEBUG use
Ian Lynagh [Sat, 29 Mar 2008 16:39:36 +0000 (16:39 +0000)]
Remove a DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:57:16 +0000 (14:57 +0000)]
Remove more #ifdef DEBUGs
Ian Lynagh [Sat, 29 Mar 2008 14:55:08 +0000 (14:55 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:52:44 +0000 (14:52 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:48:44 +0000 (14:48 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:46:58 +0000 (14:46 +0000)]
Remove a #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:45:44 +0000 (14:45 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:42:26 +0000 (14:42 +0000)]
Remove some redundant code
Ian Lynagh [Sat, 29 Mar 2008 14:39:14 +0000 (14:39 +0000)]
prelude/PrimOp is now mostly warning-free
commutableOp seems to be unused, so we're no 100% there yet.
Ian Lynagh [Sat, 29 Mar 2008 14:26:37 +0000 (14:26 +0000)]
Fix warnings from primops.txt.pp
Ian Lynagh [Sat, 29 Mar 2008 14:25:08 +0000 (14:25 +0000)]
Use _ rather than "other" in generated code
Ian Lynagh [Sat, 29 Mar 2008 14:22:19 +0000 (14:22 +0000)]
Fix some warnings
Ian Lynagh [Sat, 29 Mar 2008 14:18:09 +0000 (14:18 +0000)]
Remove some redundant imports
Ian Lynagh [Sat, 29 Mar 2008 14:17:33 +0000 (14:17 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:16:29 +0000 (14:16 +0000)]
Remove an #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:11:45 +0000 (14:11 +0000)]
Remove some unnecessary imports
Ian Lynagh [Sat, 29 Mar 2008 14:10:47 +0000 (14:10 +0000)]
Remove an unnecessary #ifdef DEBUG
Ian Lynagh [Sat, 29 Mar 2008 14:01:26 +0000 (14:01 +0000)]
Another debugIsOn use
Ian Lynagh [Sat, 29 Mar 2008 13:59:50 +0000 (13:59 +0000)]
Convert some DEBUG uses to debugIsOn
Ian Lynagh [Sat, 29 Mar 2008 13:57:55 +0000 (13:57 +0000)]
Put debugIsOn in Util, rather than rely on it being CPPed in
Tim Chevalier [Fri, 28 Mar 2008 22:26:30 +0000 (22:26 +0000)]
External Core: print function types correctly, improve newtype pretty-printing
- In a previous patch I broke the printing of fully-applied arrow
types (e.g., "a -> b" was "(ghczmprim:GHCziPrim a b)") by z-encoding
package names and not updating the primitive module name as defined in
External Core accordingly. Fixed. (Mega sigh...)
- Make newtype decls print slightly more readably.
Tim Chevalier [Fri, 28 Mar 2008 21:19:19 +0000 (21:19 +0000)]
Print out rational literals correctly in External Core
The External Core printer was printing out rational literals of the
form:
2.0e-2
when the External Core grammar doesn't allow this. (This
bug has apparently been there since the beginning...)
It's now printing rationals in the same form that (show (r::Rational))
does. This requires a parser change as well (soon to come.)
Tim Chevalier [Thu, 27 Mar 2008 18:54:36 +0000 (18:54 +0000)]
Change syntax for qualified names in External Core
Two changes that make the ext-core code uglier but the parser easier:
- Prefix qualified names with "^" so that we can more easily
distinguish a qualified name:
^a:Foo.Bar.quux
from an unqualified name:
a
- z-encode package names ("ghc-prim" was the culprit.)
Ian Lynagh [Wed, 26 Mar 2008 17:53:06 +0000 (17:53 +0000)]
Make use of the SDoc type synonym
Ian Lynagh [Wed, 26 Mar 2008 17:46:57 +0000 (17:46 +0000)]
Fix warnings in rename/RnTypes
Ian Lynagh [Wed, 26 Mar 2008 17:00:14 +0000 (17:00 +0000)]
Fix warnings in basicTypes/IdInfo
Ian Lynagh [Wed, 26 Mar 2008 16:51:39 +0000 (16:51 +0000)]
Fix warnings in basicTypes/NameEnv
Ian Lynagh [Wed, 26 Mar 2008 16:48:37 +0000 (16:48 +0000)]
Fix warnings in basicTypes/NameSet
Ian Lynagh [Wed, 26 Mar 2008 16:00:17 +0000 (16:00 +0000)]
Fix warning in basicTypes/NewDemand
Ian Lynagh [Wed, 26 Mar 2008 15:54:12 +0000 (15:54 +0000)]
Fix warnings in basicTypes/VarEnv
Ian Lynagh [Wed, 26 Mar 2008 15:51:05 +0000 (15:51 +0000)]
Fix warnings in basicTypes/VarSet
Ian Lynagh [Wed, 26 Mar 2008 15:47:47 +0000 (15:47 +0000)]
main/BreakArray has no warnings
Ian Lynagh [Wed, 26 Mar 2008 14:10:30 +0000 (14:10 +0000)]
In validate settings, make -Werror easier to override
Ian Lynagh [Wed, 26 Mar 2008 00:49:32 +0000 (00:49 +0000)]
Remove a redundant type sig
Ian Lynagh [Tue, 25 Mar 2008 23:58:28 +0000 (23:58 +0000)]
Fix warnings in main/DriverPhases
Ian Lynagh [Tue, 25 Mar 2008 23:58:01 +0000 (23:58 +0000)]
Remove redundant type sig
Ian Lynagh [Tue, 25 Mar 2008 23:41:10 +0000 (23:41 +0000)]
Fix warnings in main/HscStats
Ian Lynagh [Tue, 25 Mar 2008 23:30:34 +0000 (23:30 +0000)]
Fix warnings in main/Constants
Ian Lynagh [Tue, 25 Mar 2008 23:01:53 +0000 (23:01 +0000)]
Fix warnings in main/InteractiveEval
Ian Lynagh [Tue, 25 Mar 2008 22:44:44 +0000 (22:44 +0000)]
Fix warnings in main/Packages
Ian Lynagh [Tue, 25 Mar 2008 22:31:04 +0000 (22:31 +0000)]
Fix warnings in main/PprTyThing
Ian Lynagh [Tue, 25 Mar 2008 22:16:32 +0000 (22:16 +0000)]
Fix warnings in main/StaticFlags
Tim Chevalier [Tue, 25 Mar 2008 17:02:18 +0000 (17:02 +0000)]
Change syntax for newtypes in External Core
The way that newtype declarations were printed in External Core files was
incomplete, since there was no declaration for the coercion introduced by a
newtype.
For example, the Haskell source:
newtype T a = MkT (a -> a)
foo (MkT x) = x
got printed out in External Core as (roughly):
%newtype T a = a -> a;
foo :: %forall t . T t -> t -> t =
%cast (\ @ t -> a1 @ t)
(%forall t . T t -> ZCCoT t);
There is no declaration anywhere in the External Core program for :CoT, so
that's bad.
I changed the newtype decl syntax so as to include the declaration for the
coercion axiom introduced by the newtype. Now, it looks like:
%newtype T a ^ (ZCCoT :: ((T a) :=: (a -> a))) = a -> a;
And an external typechecker could conceivably typecheck code that uses this.
The major changes are to MkExternalCore and PprExternalCore (as well as
ExternalCore, to change the External Core AST.) I also corrected some typos in
comments in other files.
Documentation and external tool changes to follow.
Ian Lynagh [Tue, 25 Mar 2008 16:03:14 +0000 (16:03 +0000)]
Fix warnings in the RTS
For some reason this causes build failures for me in my 32-bit chroot,
Ian Lynagh [Mon, 24 Mar 2008 22:40:06 +0000 (22:40 +0000)]
Another change for GHC.PrimopWrappers moving from base to ghc-prim
Ian Lynagh [Mon, 24 Mar 2008 21:23:19 +0000 (21:23 +0000)]
Update darcs-boring
Tim Chevalier [Mon, 24 Mar 2008 01:43:11 +0000 (01:43 +0000)]
Fix primMname in External Core printer
My earlier changes broke printing of function types in .hcr files.
In other words: the z-encoding must die.
Tim Chevalier [Mon, 24 Mar 2008 00:52:46 +0000 (00:52 +0000)]
Fix primMname in External Core printer
My earlier changes broke printing of function types in .hcr files.
In other words: the z-encoding must die.
Ian Lynagh [Sun, 23 Mar 2008 18:25:57 +0000 (18:25 +0000)]
Follow library changes
Integer, Bool and Unit/Inl/Inr are now in new packages integer
and ghc-prim.
Ian Lynagh [Thu, 20 Mar 2008 19:58:36 +0000 (19:58 +0000)]
CgTicky now doesn't know about the Integer data constructors
Ian Lynagh [Sat, 22 Mar 2008 14:06:41 +0000 (14:06 +0000)]
-DDEBUG build fix
Ian Lynagh [Thu, 20 Mar 2008 22:19:15 +0000 (22:19 +0000)]
Rename rebuild to remake, and define rebuild to "clean; build"
Tim Chevalier [Thu, 20 Mar 2008 01:44:49 +0000 (01:44 +0000)]
Handle hierarchical module names in External Core tools
I updated the parser to handle hierarchical module names (with package names)
the way GHC is currently printing them out in External Core.
Beware kludgy use of z-encoding and gratutious copy-pasta from GHC.
You can now use the stand-alone Core parser to parse a very simple
GHC-generated .hcr file (progress!) but not to typecheck or interpret it
(the typechecker/interpreter don't snarf in the right libraries yet, among
other things.) And, the parser is still incomplete in that it doesn't handle
programs with newtypes/GADTs/etc. whose syntax has changed since 2003. In
other words: probably don't try to use this yet.
Tim Chevalier [Wed, 19 Mar 2008 19:04:29 +0000 (19:04 +0000)]
Improve hierarchical module name handling in MkExternalCore
It's easier for the External Core parser if MkExternalCore prints
module names like:
base:GHCziBase
rather than like:
base:GHC.Base
(which it was doing before.)
So now we z-encode the hierarchical module-name part of a module
name, but don't z-encode the ':'.
I also removed some old comments that don't seem relevant anymore.
Tim Chevalier [Wed, 19 Mar 2008 18:25:21 +0000 (18:25 +0000)]
Fixed remaining warning in coreSyn/MkExternalCore
There was a (suppressed) warning about an incomplete pattern match in make_alt. This was because the DEFAULT alt never has variable bindings. I thought it would be better to check that case and panic if it happens than to have an incomplete pattern. It's still not great, but at least now we don't have to suppress any warnings in this file.
Ian Lynagh [Mon, 17 Mar 2008 20:01:30 +0000 (20:01 +0000)]
Revert an accidental change
Ian Lynagh [Mon, 17 Mar 2008 18:50:32 +0000 (18:50 +0000)]
Print some extra debugging info when doing --show-iface
Ian Lynagh [Mon, 17 Mar 2008 18:01:50 +0000 (18:01 +0000)]
Eliminate a global variable
Very little parameter passing is needed without it, so there was no real
benefit to it.
Ian Lynagh [Mon, 17 Mar 2008 10:36:17 +0000 (10:36 +0000)]
Follow changes in editline
Ian Lynagh [Sun, 16 Mar 2008 06:04:07 +0000 (06:04 +0000)]
Use editline instead of readline
Roman Leshchinskiy [Mon, 17 Mar 2008 03:34:36 +0000 (03:34 +0000)]
Vectorise tuple constructorsn
keller@cse.unsw.edu.au [Mon, 17 Mar 2008 02:55:53 +0000 (02:55 +0000)]
Added double divide and unzipP
keller@cse.unsw.edu.au [Tue, 11 Mar 2008 12:50:35 +0000 (12:50 +0000)]
Added 'div' to set of vectorising functions
Ian Lynagh [Sun, 16 Mar 2008 21:41:04 +0000 (21:41 +0000)]
If unregisterised, link with -optl-Wl,--relax on IA64
This fixes part of trac #856
Ian Lynagh [Sat, 15 Mar 2008 14:17:51 +0000 (14:17 +0000)]
When concatenating variables in Makefile, strip spaces in case one is empty
Otherwise "$(A) $(B)" will not be equal to "" even if A and B are empty.
Trac #856.
Ian Lynagh [Sun, 16 Mar 2008 21:17:48 +0000 (21:17 +0000)]
Fix a space leak in :trace (trac #2128)
We were doing lots of cons'ing and tail'ing without forcing the tails,
so were building up lots of thunks.
Ian Lynagh [Sun, 16 Mar 2008 19:56:36 +0000 (19:56 +0000)]
If we are failing due to a warning and -Werror, say so
Fixes trac #1893, based on a patch from Daniel Franke.
Ian Lynagh [Sat, 15 Mar 2008 19:42:20 +0000 (19:42 +0000)]
Remove leftover NoteTy/FTVNote bits
Ian Lynagh [Sat, 15 Mar 2008 15:50:27 +0000 (15:50 +0000)]
Remove uses of addFreeTyVars
This optimisation actually make things a bit slower on average, as
measured by nofib. The example in #1136 in particular suffers from high
memory usage. Therefore we no longer do the optimisation.
Simon Marlow [Thu, 13 Mar 2008 18:29:36 +0000 (18:29 +0000)]
parsing tweak for :break
Simon Marlow [Thu, 7 Feb 2008 12:24:45 +0000 (12:24 +0000)]
Tweaks to stack squeezing
1. We weren't squeezing two frames if one of them was a marked update
frame. This is easy to fix.
2. The heuristic to decide whether to squeeze was a little
conservative. It's worth copying 3 words to save an update frame.
Manuel M T Chakravarty [Thu, 13 Mar 2008 06:52:20 +0000 (06:52 +0000)]
Some cleanup in TcSimplify.reduceContext
- Makes this horrid function a bit better - and shorter!
- Also gets rid of another API function of TcTyFuns
Manuel M T Chakravarty [Thu, 13 Mar 2008 05:17:08 +0000 (05:17 +0000)]
Properly normalise reduced dicts
- Another chapter in the never-ending TcSimplify.reduceContext saga: after
context reduction of wanted dicts it is not sufficient to normalise them
wrt to the wanted equalities. We also need to take top-level equalities
into account. (In fact, we probably also have to normalise wrt to given
equalities, but I have left that open for the moment - but added a TODO
note.)
- This finally eliminates substEqInDictInsts from TcTyFuns interface and
suggest some further possible clean up (which will be in a separate patch).
Thanks to Roman for the intricate example that uncovered this bug.
Roman Leshchinskiy [Thu, 13 Mar 2008 06:14:11 +0000 (06:14 +0000)]
Bump mAX_NDP_PROD to 5
Simon Marlow [Wed, 12 Mar 2008 21:57:24 +0000 (21:57 +0000)]
#2050: save the GHCi history in ~/.ghc/ghci_history
Modified version of Judah's patch
Roman Leshchinskiy [Wed, 12 Mar 2008 03:49:05 +0000 (03:49 +0000)]
Make sure we generate PA dictionaries for tuples up to mAX_NDP_PROD
Roman Leshchinskiy [Wed, 12 Mar 2008 03:02:45 +0000 (03:02 +0000)]
Bump mAX_NDP_PROD to 4
Tim Chevalier [Mon, 10 Mar 2008 02:58:21 +0000 (02:58 +0000)]
First cut at reviving the External Core tools
I updated the External Core AST to be somewhat closer to reality (where reality is defined by the HEAD), and got all the code to compile under GHC 6.8.1. (That means it works, right?)
Major changes:
- Added a Makefile.
- Core AST:
- Represented package names and qualified module names.
- Added type annotation on Case exps.
- Changed Coerce to Cast.
- Cleaned up representation of qualified/unqualified names.
- Fixed up wired-in module names (no more "PrelGHC", etc.)
- Updated parser/interpreter/typechecker/prep for the new AST.
- Typechecker:
- Used a Reader monad to pass around the global environment and top module name.
- Added an entry point to check a single expression.
- Prep:
- Got rid of typeofExp; it's now defined in terms of the typechecker.
Roman Leshchinskiy [Sun, 9 Mar 2008 22:59:14 +0000 (22:59 +0000)]
Remove ndpFlatten
This patch removes the ndpFlatten directory and the -fflatten static flag.
This code has never worked and has now been superceded by vectorisation.
iavor.diatchki@gmail.com [Sun, 9 Mar 2008 19:19:11 +0000 (19:19 +0000)]
documentation fix: change flag -frules-off to -fno-rewrite-rules
simonpj@microsoft.com [Thu, 6 Mar 2008 13:50:26 +0000 (13:50 +0000)]
Don't expose the unfolding of dictionary selectors without -O
When compiling without -O we were getting code like this
f x = case GHC.Base.$f20 of
:DEq eq neq -> eq x x
But because of the -O the $f20 dictionary is not available, so exposing
the dictionary selector was useless. Yet it makes the code bigger!
Better to get
f x = GHC.Base.== GHC.Bsae.$f20 x x
This patch suppresses the implicit unfolding for dictionary selectors
when compiling without -O. We could do the same for other implicit
Ids, but this will do for now.
There should be no effect when compiling with -O. Programs should
be smaller without -O and may run a tiny bit slower.
simonpj@microsoft.com [Thu, 6 Mar 2008 13:47:34 +0000 (13:47 +0000)]
Fix Trac #783: improve short-cutting literals in the type checker
The Inst.shortCutIntLit mechanism in the type checker was missing cases
where a floating-point literal was given without an explicit decimal point.
As a result, programs with lots of floating-point literals (without decimals)
ended up with massive Static Reference Tables. This is not cool. See
comments with Trac #783 for details.