ghc.git
7 years agoAdd '-freg-liveness' flag to control if STG liveness information
David Terei [Thu, 12 Jan 2012 23:43:12 +0000 (15:43 -0800)] 
Add '-freg-liveness' flag to control if STG liveness information
is used for optimisation. (enabled by default)

7 years agoFormatting fixes to flags.xml
David Terei [Thu, 12 Jan 2012 23:32:51 +0000 (15:32 -0800)] 
Formatting fixes to flags.xml

7 years agoAdd '-fllvm-tbaa' flag for controlling LLVM TBAA opt.
David Terei [Thu, 12 Jan 2012 22:20:25 +0000 (14:20 -0800)] 
Add '-fllvm-tbaa' flag for controlling LLVM TBAA opt.

7 years agoUpdate '.gitignore'
David Terei [Thu, 12 Jan 2012 20:01:10 +0000 (12:01 -0800)] 
Update '.gitignore'

7 years agoImprove LLVM TBAA hierachy (#5567).
David Terei [Thu, 12 Jan 2012 19:58:15 +0000 (11:58 -0800)] 
Improve LLVM TBAA hierachy (#5567).

7 years agoMake "make sdist" generate a testsuite tarball as well as the src tarball
Ian Lynagh [Fri, 13 Jan 2012 00:18:06 +0000 (00:18 +0000)] 
Make "make sdist" generate a testsuite tarball as well as the src tarball

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 12 Jan 2012 17:21:00 +0000 (17:21 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoFix if-def-ery for DEBUG
Simon Peyton Jones [Thu, 12 Jan 2012 17:18:52 +0000 (17:18 +0000)] 
Fix if-def-ery for DEBUG

7 years agoComments only
Simon Peyton Jones [Thu, 12 Jan 2012 17:18:30 +0000 (17:18 +0000)] 
Comments only

7 years agoFix Trac #5658: strict bindings not floated in
Simon Peyton Jones [Thu, 12 Jan 2012 17:17:22 +0000 (17:17 +0000)] 
Fix Trac #5658: strict bindings not floated in

Two changes here

* The main change here is to enhance the FloatIn pass so that it can
  float case-bindings inwards.  In particular the case bindings for
  array indexing.

* Also change the code in Simplify, to allow a case on array
  indexing (ie can_fail is true) to be discarded altogether if its
  results are unused.

Lots of new comments in PrimOp about can_fail and has_side_effects

Some refactoring to share the FloatBind data structure between
FloatIn and FloatOut

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 12 Jan 2012 16:30:43 +0000 (16:30 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 12 Jan 2012 15:11:06 +0000 (15:11 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoImplememt -fdefer-type-errors (Trac #5624)
Simon Peyton Jones [Thu, 12 Jan 2012 15:10:54 +0000 (15:10 +0000)] 
Implememt -fdefer-type-errors (Trac #5624)

This patch implements the idea of deferring (most) type errors to
runtime, instead emitting only a warning at compile time.  The
basic idea is very simple:

 * The on-the-fly unifier in TcUnify never fails; instead if it
   gets stuck it emits a constraint.

 * The constraint solver tries to solve the constraints (and is
   entirely unchanged, hooray).

 * The remaining, unsolved constraints (if any) are passed to
   TcErrors.reportUnsolved.  With -fdefer-type-errors, instead of
   emitting an error message, TcErrors emits a warning, AND emits
   a binding for the constraint witness, binding it
   to (error "the error message"), via the new form of evidence
   TcEvidence.EvDelayedError.  So, when the program is run,
   when (and only when) that witness is needed, the program will
   crash with the exact same error message that would have been
   given at compile time.

Simple really.  But, needless to say, the exercise forced me
into some major refactoring.

 * TcErrors is almost entirely rewritten

 * EvVarX and WantedEvVar have gone away entirely

 * ErrUtils is changed a bit:
     * New Severity field in ErrMsg
     * Renamed the type Message to MsgDoc (this change
       touches a lot of files trivially)

 * One minor change is that in the constraint solver we try
   NOT to combine insoluble constraints, like Int~Bool, else
   all such type errors get combined together and result in
   only one error message!

 * I moved some definitions from TcSMonad to TcRnTypes,
   where they seem to belong more

7 years agoTOP/includes/dist doesn't exist (yet?) and makes ghcpkg05 fail, so remove it
Simon Marlow [Thu, 12 Jan 2012 13:55:42 +0000 (13:55 +0000)] 
TOP/includes/dist doesn't exist (yet?) and makes ghcpkg05 fail, so remove it

7 years agoUse Type Based Alias Analysis (TBAA) in LLVM backend (#5567)
David Terei [Thu, 12 Jan 2012 07:09:40 +0000 (23:09 -0800)] 
Use Type Based Alias Analysis (TBAA) in LLVM backend (#5567)

TBAA allows us to specify a type hierachy in metadata with
the property that nodes on different branches don't alias.
This should somewhat improve the optimizations LLVM does that
rely on alias information.

7 years agoAdd Metadata support to LLVM bindings.
David Terei [Thu, 12 Jan 2012 02:49:22 +0000 (18:49 -0800)] 
Add Metadata support to LLVM bindings.

7 years agoMore improvements to llvm output style (#5750)
David Terei [Wed, 11 Jan 2012 19:49:02 +0000 (11:49 -0800)] 
More improvements to llvm output style (#5750)

7 years agoUse /usr/bin/gcc when making the OS X installer
Ian Lynagh [Wed, 11 Jan 2012 21:00:42 +0000 (21:00 +0000)] 
Use /usr/bin/gcc when making the OS X installer

On XCode 4.1, we use /usr/bin/gcc-4.2 as it makes better code than
/usr/bin/gcc for us. However, gcc-4.2 doesn't exist in XCode 4.2, so we
need to use /usr/bin/gcc there. As the installer can be used on either,
we make it always use /usr/bin/gcc.

7 years agoDon't try to use gcc-4.2 on XCode >= 4.2
Ian Lynagh [Wed, 11 Jan 2012 19:01:55 +0000 (19:01 +0000)] 
Don't try to use gcc-4.2 on XCode >= 4.2

It was removed in 4.2.

7 years agocheck for failed external symbol lookups (partial fix for #5748)
Gregory Wright [Sat, 7 Jan 2012 14:58:00 +0000 (09:58 -0500)] 
check for failed external symbol lookups (partial fix for #5748)

7 years agoClean more files in "make clean"
Ian Lynagh [Wed, 11 Jan 2012 15:54:30 +0000 (15:54 +0000)] 
Clean more files in "make clean"

The libraries get configured during "make", so plain old "make clean"
should clean up the configure droppings.

Also fixed another wildcard/patsubst problem.

7 years agoFix cleaning buildinfo files
Ian Lynagh [Wed, 11 Jan 2012 15:50:02 +0000 (15:50 +0000)] 
Fix cleaning buildinfo files

We were applying $(wildcard ...) to the literal string
libraries/%/*.buildinfo, which of course had no matches.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 11 Jan 2012 08:32:02 +0000 (08:32 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Ian Lynagh [Wed, 11 Jan 2012 01:52:38 +0000 (01:52 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoWhitespace only
Ian Lynagh [Wed, 11 Jan 2012 00:54:56 +0000 (00:54 +0000)] 
Whitespace only

7 years agoAdd prelude rules for encode{Float,Double}Integer and integerTo{Int,Word}64
Ian Lynagh [Wed, 11 Jan 2012 00:24:16 +0000 (00:24 +0000)] 
Add prelude rules for encode{Float,Double}Integer and integerTo{Int,Word}64

7 years agoAdd prelude rules for quotInteger, remInteger
Ian Lynagh [Tue, 10 Jan 2012 22:08:23 +0000 (22:08 +0000)] 
Add prelude rules for quotInteger, remInteger

7 years agoEnable llvm tool paths to be set with ./configure
David Terei [Tue, 10 Jan 2012 19:58:59 +0000 (11:58 -0800)] 
Enable llvm tool paths to be set with ./configure

Patch from Karel Gardas!

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Tue, 10 Jan 2012 14:11:53 +0000 (14:11 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoImprove style of '-ddump-llvm' output. (#5750)
David Terei [Tue, 10 Jan 2012 08:02:17 +0000 (00:02 -0800)] 
Improve style of '-ddump-llvm' output. (#5750)

7 years agoAdd live stg info to Updates.cmm (fixes #4308)
David Terei [Sat, 7 Jan 2012 10:53:31 +0000 (02:53 -0800)] 
Add live stg info to Updates.cmm (fixes #4308)

7 years agoTrack STG live register information for use in LLVM
David Terei [Tue, 3 Jan 2012 07:07:05 +0000 (18:07 +1100)] 
Track STG live register information for use in LLVM

We now carry around with CmmJump statements a list of
the STG registers that are live at that jump site.
This is used by the LLVM backend so it can avoid
unnesecarily passing around dead registers, improving
perfromance. This gives us the framework to finally
fix trac #4308.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Mon, 9 Jan 2012 14:07:03 +0000 (14:07 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoIn mkCast (Coercion c1) c2, check that c2 has (~#) on both sides
Simon Peyton Jones [Mon, 9 Jan 2012 14:06:25 +0000 (14:06 +0000)] 
In mkCast (Coercion c1) c2, check that c2 has (~#) on both sides

Otherwise the RHS is utterly bogus.  I also added some asserts.
Thanks to Max for pointing this out.

7 years agolast_free_capability should never be NULL
Simon Marlow [Mon, 9 Jan 2012 11:52:24 +0000 (11:52 +0000)] 
last_free_capability should never be NULL

7 years agouse (GHC) idiomatic types
Gabor Greif [Sat, 7 Jan 2012 10:25:05 +0000 (11:25 +0100)] 
use (GHC) idiomatic types

7 years agotypo
Simon Marlow [Mon, 9 Jan 2012 10:33:19 +0000 (10:33 +0000)] 
typo

7 years agoMake the RTS linker API use wide-char pathnames on Windows (#5697)
Simon Marlow [Fri, 6 Jan 2012 14:51:40 +0000 (14:51 +0000)] 
Make the RTS linker API use wide-char pathnames on Windows (#5697)

I haven't been able to test whether this works or not due to #5754,
but at least it doesn't appear to break anything.

7 years agoRefactoring
Ian Lynagh [Sun, 8 Jan 2012 19:36:14 +0000 (19:36 +0000)] 
Refactoring

This is working towards being able to put ghcautoconf.h and
ghcplatform.h in includes/dist

7 years agoGenerate the haddock contents/index pages in a dist-haddock subdirectory
Ian Lynagh [Sun, 8 Jan 2012 14:43:46 +0000 (14:43 +0000)] 
Generate the haddock contents/index pages in a dist-haddock subdirectory

This is tidier, and makes it easier to clean and install them correctly

7 years agoDefine prelude rules for floatFromInteger and doubleFromInteger
Ian Lynagh [Sat, 7 Jan 2012 23:03:08 +0000 (23:03 +0000)] 
Define prelude rules for floatFromInteger and doubleFromInteger

7 years agoAdd comments on which integer rules are missing
Ian Lynagh [Sat, 7 Jan 2012 22:36:00 +0000 (22:36 +0000)] 
Add comments on which integer rules are missing

7 years agoconfigure: Don't calle GET_ARM_ISA on x86_64
Ian Lynagh [Sat, 7 Jan 2012 22:19:39 +0000 (22:19 +0000)] 
configure: Don't calle GET_ARM_ISA on x86_64

I assume this was a copy/paste-o or similar.

7 years agoAdd alpha, mips, mipseb, mipsel to the list of ArchUnknown arches
Ian Lynagh [Sat, 7 Jan 2012 22:16:41 +0000 (22:16 +0000)] 
Add alpha, mips, mipseb, mipsel to the list of ArchUnknown arches

7 years agoDoc fix
Ian Lynagh [Thu, 5 Jan 2012 13:44:42 +0000 (13:44 +0000)] 
Doc fix

7 years agoBe explicit about what we import from Data.Monoid
Johan Tibell [Wed, 4 Jan 2012 17:59:22 +0000 (09:59 -0800)] 
Be explicit about what we import from Data.Monoid

7 years agorefactoring
Simon Marlow [Fri, 6 Jan 2012 11:31:31 +0000 (11:31 +0000)] 
refactoring

7 years agosetNumCapabilities: don't barf() if it isn't supported, just print an error
Simon Marlow [Fri, 6 Jan 2012 11:26:31 +0000 (11:26 +0000)] 
setNumCapabilities: don't barf() if it isn't supported, just print an error

7 years agoEnable the threaded RTS when unregisterised too.
Simon Marlow [Fri, 6 Jan 2012 10:45:50 +0000 (10:45 +0000)] 
Enable the threaded RTS when unregisterised too.

It was disabled by me in 1a470c9404950cc6737853309d35798a98ad0c30 (May
2007), but the commit gave no explanation as to why.  Perhaps this was before
we had a separate knob for GhcWithSMP.

Anyway, it looks like threaded works fine with unregisterised, so I'm
enabling it again.

7 years agoFix a crash in STM when unregisterised
Simon Marlow [Fri, 6 Jan 2012 10:42:35 +0000 (10:42 +0000)] 
Fix a crash in STM when unregisterised

Fixes several test failures:
   ../../libraries/stm/tests       2411 [bad exit code] (normal,hpc,profasm,ghci,optllvm)
   ../../libraries/stm/tests       stm046 [bad exit code] (normal,hpc,profasm,ghci,optllvm)
   ../../libraries/stm/tests       stm061 [bad exit code] (normal,hpc,profasm,ghci,optllvm)

7 years agoupdate copyright, cite realistic version numbers, fix a smattering of typos
Gabor Greif [Thu, 5 Jan 2012 02:33:32 +0000 (03:33 +0100)] 
update copyright, cite realistic version numbers, fix a smattering of typos

7 years agoabstract away from the 'build-toolchain'-dependent sizeof(...) operator
Gabor Greif [Thu, 5 Jan 2012 18:41:36 +0000 (19:41 +0100)] 
abstract away from the 'build-toolchain'-dependent sizeof(...) operator

The sizes obtained this way do not work on a target system in general.
So in a future cross-compilable setup we need another way of obtaining
expansions for the macros OFFSET, FIELD_SIZE and TYPE_SIZE.

Guarded against accidental use of 'sizeof' by poisoning.

Verified that the generated *Constants.h/hs files are unchanged.

7 years agoFix crash with +RTS -xc (occasional cgrun057(profthreaded) failure)
Simon Marlow [Fri, 6 Jan 2012 10:19:37 +0000 (10:19 +0000)] 
Fix crash with +RTS -xc  (occasional cgrun057(profthreaded) failure)

Don't try to print a stack trace from raiseAsync() when there's no
exception - we might just be deleting the thread, or suspending
duplicate work.

7 years agoFix haddock validate problem.
David Terei [Fri, 6 Jan 2012 02:14:20 +0000 (18:14 -0800)] 
Fix haddock validate problem.

7 years agoFix validation warning
David Terei [Thu, 22 Dec 2011 23:24:48 +0000 (15:24 -0800)] 
Fix validation warning

7 years agoFormatting fixes
David Terei [Thu, 22 Dec 2011 22:58:10 +0000 (14:58 -0800)] 
Formatting fixes

7 years agoRemove unused arg field of CmmReturn
David Terei [Thu, 22 Dec 2011 22:48:56 +0000 (14:48 -0800)] 
Remove unused arg field of CmmReturn

7 years agoTabs -> Spaces
David Terei [Thu, 22 Dec 2011 22:41:53 +0000 (14:41 -0800)] 
Tabs -> Spaces

7 years agoFormatting wibble
David Terei [Thu, 22 Dec 2011 22:41:34 +0000 (14:41 -0800)] 
Formatting wibble

7 years agoRemove unused argument field on CmmJump
David Terei [Thu, 22 Dec 2011 22:40:22 +0000 (14:40 -0800)] 
Remove unused argument field on CmmJump

7 years agoFormatting fixes
David Terei [Thu, 22 Dec 2011 22:14:49 +0000 (14:14 -0800)] 
Formatting fixes

7 years agoTabs -> Spaces + formatting fixes
David Terei [Thu, 22 Dec 2011 13:11:52 +0000 (05:11 -0800)] 
Tabs -> Spaces + formatting fixes

7 years agoFixup to 4464c92badaedc45ce53d6349f6790f6d2298103
Simon Marlow [Wed, 4 Jan 2012 15:40:41 +0000 (15:40 +0000)] 
Fixup to 4464c92badaedc45ce53d6349f6790f6d2298103

Instead of enterLocalIdLabel we should get the label from the
ClosureInfo, because that knows better whether the label should be
local or not.

Needed by #5357

7 years agosmall refactoring
Simon Marlow [Thu, 5 Jan 2012 14:02:24 +0000 (14:02 +0000)] 
small refactoring

7 years agoWe must emit DELTA pseudo-instructions when moving %esp (#5747)
Simon Marlow [Thu, 5 Jan 2012 14:01:58 +0000 (14:01 +0000)] 
We must emit DELTA pseudo-instructions when moving %esp (#5747)

7 years agoGive the correct type to CCCS
Simon Marlow [Wed, 4 Jan 2012 15:23:27 +0000 (15:23 +0000)] 
Give the correct type to CCCS

Needed by #5357

7 years agoRename struct _CostCentreStack to struct CostCentreStack_ for consistency
Simon Marlow [Wed, 4 Jan 2012 15:23:15 +0000 (15:23 +0000)] 
Rename struct _CostCentreStack to struct CostCentreStack_ for consistency

Needed by #5357

7 years agoFix for unregisterised compilation: we want registers when defined(USE_MINIINTERPRETER)
Simon Marlow [Wed, 4 Jan 2012 15:14:31 +0000 (15:14 +0000)] 
Fix for unregisterised compilation: we want registers when defined(USE_MINIINTERPRETER)

Needed by #5357

7 years agoFix for unregisterised compilation: isStrangeTypeGlobal CCCS = True
Simon Marlow [Wed, 4 Jan 2012 15:13:56 +0000 (15:13 +0000)] 
Fix for unregisterised compilation: isStrangeTypeGlobal CCCS = True

Needed by #5357

7 years agoRename the CCCS field of StgTSO so as not to conflict with the CCCS pseudo-register
Simon Marlow [Wed, 4 Jan 2012 15:13:23 +0000 (15:13 +0000)] 
Rename the CCCS field of StgTSO so as not to conflict with the CCCS pseudo-register

Needed by #5357

7 years agoremove dead code
Simon Marlow [Wed, 4 Jan 2012 13:59:15 +0000 (13:59 +0000)] 
remove dead code

7 years agomkSlowEntryCode: enterLocalIdLabel should be enterIdLabel (#5357)
Simon Marlow [Wed, 4 Jan 2012 13:59:06 +0000 (13:59 +0000)] 
mkSlowEntryCode: enterLocalIdLabel should be enterIdLabel (#5357)

7 years agofix warning
Simon Marlow [Wed, 4 Jan 2012 13:45:35 +0000 (13:45 +0000)] 
fix warning

7 years agodsCImport (CLabel): drop foralls when checking for FunPtr
Simon Marlow [Wed, 4 Jan 2012 13:29:14 +0000 (13:29 +0000)] 
dsCImport (CLabel): drop foralls when checking for FunPtr

We were mislabelling some foreign imports as IsData rather than
IsFunction, because the type was forall a. FunPtr (... a ...).

Eventually this gave rise to these obscure error when compiling
unregisterised:

libraries/base/Foreign/Marshal/Alloc.hc:473:0:
     warning: built-in function ‘free’ declared as non-function

libraries/base/Foreign/Marshal/Alloc.hc:1004:0:
     error: ‘free’ redeclared as different kind of symbol

7 years agoKFreeBSD is also an ELF binary
Joachim Breitner [Sun, 1 Jan 2012 01:17:24 +0000 (02:17 +0100)] 
KFreeBSD is also an ELF binary

Fixes: #5733

7 years agoRestore printing of Rep type family instance with -ddump-deriving
Jose Pedro Magalhaes [Wed, 4 Jan 2012 11:39:03 +0000 (12:39 +0100)] 
Restore printing of Rep type family instance with -ddump-deriving

7 years agoRemove missing archs (mipseb, mipsel, alpha) (#5734)
Simon Marlow [Wed, 4 Jan 2012 11:44:02 +0000 (11:44 +0000)] 
Remove missing archs (mipseb, mipsel, alpha) (#5734)

It doesn't hurt to map these to ArchUnknown since we don't need to
know anything specific about them, and adding them would be a pain
(there are a bunch of places where we have to case-match on all the
arches to avoid warnings).

7 years agoosElfTarget should default to False (#5733)
Simon Marlow [Wed, 4 Jan 2012 11:39:55 +0000 (11:39 +0000)] 
osElfTarget should default to False (#5733)

Another portabilty regression: before Platform we used to use elf_OBJ_FORMAT:

 #if linux_TARGET_OS || freebsd_TARGET_OS || openbsd_TARGET_OS || solaris2_TARGET_OS
 #define elf_OBJ_FORMAT 1
 #endif

which defaults to undefined on unknown platforms.  Defaulting to
non-ELF is correct, it just means that we won't rely on ELF-specific
functionality.  I've added a comment to explain that.

7 years agoStore the word size as determined by configure, in the settings file (#5735)
Simon Marlow [Wed, 4 Jan 2012 11:37:47 +0000 (11:37 +0000)] 
Store the word size as determined by configure, in the settings file (#5735)

Now target32bit works for all targets without any manual intervention,
as it should do.  #5735 was a portability regression.

7 years agoFix the C backend after making CCCS an STG register
Simon Marlow [Tue, 3 Jan 2012 16:21:41 +0000 (16:21 +0000)] 
Fix the C backend after making CCCS an STG register

7 years agoIn the SIGTSTP handler, throw SIGSTOP instead of re-throwing SIGTSTP
Simon Marlow [Tue, 3 Jan 2012 15:35:19 +0000 (15:35 +0000)] 
In the SIGTSTP handler, throw SIGSTOP instead of re-throwing SIGTSTP

7 years agoFix minor bug introduced in e7e771d14ac671904a69abecf9e133d4647026c1
Simon Marlow [Tue, 3 Jan 2012 13:22:23 +0000 (13:22 +0000)] 
Fix minor bug introduced in e7e771d14ac671904a69abecf9e133d4647026c1

7 years agoRefer to Control.Concurrent instead of GHC.Conc
Simon Marlow [Tue, 3 Jan 2012 11:32:10 +0000 (11:32 +0000)] 
Refer to Control.Concurrent instead of GHC.Conc

Modified version of a patch by shelarcy <shelarcy@gmail.com>

7 years agoDon't record outputFile in the hashed flags
Simon Marlow [Tue, 3 Jan 2012 10:28:39 +0000 (10:28 +0000)] 
Don't record outputFile in the hashed flags

We don't want

    ghc --make M -o <file>

to force recompilation of all modules when <file> changes.  The -o
value is already taken into account by the recompilation machinery
when we check the modification time on the object file or the
executable.

7 years agoBe less verbose when printing out Vars
Simon Peyton Jones [Tue, 3 Jan 2012 10:35:46 +0000 (10:35 +0000)] 
Be less verbose when printing out Vars

For some reason we were printing every occurrence with its type
and that is far too much.

7 years agoMajor refactoring of CoAxioms
Simon Peyton Jones [Tue, 3 Jan 2012 10:35:08 +0000 (10:35 +0000)] 
Major refactoring of CoAxioms

This patch should have no user-visible effect.  It implements a
significant internal refactoring of the way that FC axioms are
handled.  The ultimate goal is to put us in a position to implement
"pattern-matching axioms".  But the changes here are only does
refactoring; there is no change in functionality.

Specifically:

 * We now treat data/type family instance declarations very,
   very similarly to types class instance declarations:

   - Renamed InstEnv.Instance as InstEnv.ClsInst, for symmetry with
     FamInstEnv.FamInst.  This change does affect the GHC API, but
     for the better I think.

   - Previously, each family type/data instance declaration gave rise
     to a *TyCon*; typechecking a type/data instance decl produced
     that TyCon.  Now, each type/data instance gives rise to
     a *FamInst*, by direct analogy with each class instance
     declaration giving rise to a ClsInst.

   - Just as each ClsInst contains its evidence, a DFunId, so each FamInst
     contains its evidence, a CoAxiom.  See Note [FamInsts and CoAxioms]
     in FamInstEnv.  The CoAxiom is a System-FC thing, and can relate any
     two types, whereas the FamInst relates directly to the Haskell source
     language construct, and always has a function (F tys) on the LHS.

   - Just as a DFunId has its own declaration in an interface file, so now
     do CoAxioms (see IfaceSyn.IfaceAxiom).

   These changes give rise to almost all the refactoring.

 * We used to have a hack whereby a type family instance produced a dummy
   type synonym, thus
      type instance F Int = Bool -> Bool
   translated to
      axiom FInt :: F Int ~ R:FInt
      type R:FInt = Bool -> Bool
   This was always a hack, and now it's gone.  Instead the type instance
   declaration produces a FamInst, whose axiom has kind
      axiom FInt :: F Int ~ Bool -> Bool
   just as you'd expect.

 * Newtypes are done just as before; they generate a CoAxiom. These
   CoAxioms are "implicit" (do not generate an IfaceAxiom declaration),
   unlike the ones coming from family instance declarations.  See
   Note [Implicit axioms] in TyCon

On the whole the code gets significantly nicer.  There were consequential
tidy-ups in the vectoriser, but I think I got them right.

7 years agoFix typo in Makefile
Ian Lynagh [Tue, 20 Dec 2011 17:36:25 +0000 (17:36 +0000)] 
Fix typo in Makefile

sdist output was being redirected to $src_log, which presumably
evaluated to rc_log.

7 years agoPrint more informative sizes in -dshow-passes,
Simon Peyton Jones [Thu, 29 Dec 2011 10:31:57 +0000 (10:31 +0000)] 
Print more informative sizes in -dshow-passes,
and add intWithCommas to Outputable for printing
large Int/Integers

7 years agoFix Trac #5721; type variables can be quoted in TH
Simon Peyton Jones [Thu, 29 Dec 2011 10:30:34 +0000 (10:30 +0000)] 
Fix Trac #5721; type variables can be quoted in TH

7 years agoDocumentation wibble: kind -> sort
Simon Peyton Jones [Wed, 28 Dec 2011 15:10:35 +0000 (15:10 +0000)] 
Documentation wibble: kind -> sort

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 23 Dec 2011 17:57:13 +0000 (17:57 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoMake RnEnv.lookupBindGroupOcc work on Orig RdrNames
Simon Peyton Jones [Fri, 23 Dec 2011 17:27:24 +0000 (17:27 +0000)] 
Make RnEnv.lookupBindGroupOcc work on Orig RdrNames

Such names can come from Template Haskell; see Trac #5700
Easily fixed, happily.

I also renamed lookupSubBndr to lookupSubBndrOcc, which is
more descriptive.

7 years agoAdd an ASSERT on 'pick'
Simon Peyton Jones [Fri, 23 Dec 2011 17:25:36 +0000 (17:25 +0000)] 
Add an ASSERT on 'pick'

7 years agoImplemnt Trac #5712: show method for infix GADT constructors
Simon Peyton Jones [Fri, 23 Dec 2011 16:16:56 +0000 (16:16 +0000)] 
Implemnt Trac #5712: show method for infix GADT constructors

This is a tiny feature improvement; see the ticket.
I have updated the user manual too.

7 years agoUse HsTupleTy [] for unit tuples, uniformly
Simon Peyton Jones [Fri, 23 Dec 2011 16:05:48 +0000 (16:05 +0000)] 
Use HsTupleTy [] for unit tuples, uniformly

This is just a tidy-up triggered by #5719.  We were parsing () as a
type constructor, rather than as a HsTupleTy, but it's better dealt
with uniformly as the former, I think.  Somewhat a matter of taste.

7 years agoFix an outright bug in the implementation of default decls
Simon Peyton Jones [Fri, 23 Dec 2011 16:03:26 +0000 (16:03 +0000)] 
Fix an outright bug in the implementation of default decls
for associated types (fixes Trac #5719)

The bug was that we ended up quantifying the new AT instance
over the wrong set of type variables, and that led to confusing
chaos.

7 years agoFix the behaviour of the unit unboxed tuple (# #)
Simon Peyton Jones [Fri, 23 Dec 2011 16:01:51 +0000 (16:01 +0000)] 
Fix the behaviour of the unit unboxed tuple (# #)

See Trac #5720: make the unit unboxed tuple (# #) behave uniformly
with the unit boxed tuple ()

This is actually a change in behaviour, but in a very dark corner,
so I don't think this is going to hurt anyone, and the current
behaviour is deeply strange.

7 years agoImprove ASSERT error message
Simon Peyton Jones [Fri, 23 Dec 2011 15:52:32 +0000 (15:52 +0000)] 
Improve ASSERT error message

7 years agoFix :issafe safe haskell ghci command
David Terei [Wed, 21 Dec 2011 23:23:36 +0000 (15:23 -0800)] 
Fix :issafe safe haskell ghci command

7 years agoFix safe imports to work in GHCi.
David Terei [Wed, 21 Dec 2011 22:58:39 +0000 (14:58 -0800)] 
Fix safe imports to work in GHCi.