ghc.git
7 years agoMerge remote-tracking branch 'origin/unboxed-tuple-arguments2'
Paolo Capriotti [Tue, 5 Jun 2012 15:47:02 +0000 (16:47 +0100)] 
Merge remote-tracking branch 'origin/unboxed-tuple-arguments2'

7 years agoMerge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Ian Lynagh [Tue, 5 Jun 2012 14:21:15 +0000 (15:21 +0100)] 
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc

7 years agoAdd sensible locations to record-selector bindings
Simon Peyton Jones [Tue, 5 Jun 2012 12:35:07 +0000 (13:35 +0100)] 
Add sensible locations to record-selector bindings

7 years agoPretty-printing improvements
Simon Peyton Jones [Tue, 5 Jun 2012 12:34:00 +0000 (13:34 +0100)] 
Pretty-printing improvements

7 years agoUse checkNoErrs around calls to the renamer in TcSplice
Simon Peyton Jones [Tue, 5 Jun 2012 10:44:18 +0000 (11:44 +0100)] 
Use checkNoErrs around calls to the renamer in TcSplice

See Note [Renamer errors].  Fixes Trac #6114

7 years agoModify error message slightly
Simon Peyton Jones [Tue, 5 Jun 2012 10:43:44 +0000 (11:43 +0100)] 
Modify error message slightly

7 years agoUse a *constructor* name when promoting a type
Simon Peyton Jones [Tue, 5 Jun 2012 10:43:31 +0000 (11:43 +0100)] 
Use a *constructor* name when promoting a type

This is when converting from TH -> HsSyn
Thanks to Richard Eisenberg

7 years agoChange how macros like ASSERT are defined
Ian Lynagh [Mon, 4 Jun 2012 23:52:01 +0000 (00:52 +0100)] 
Change how macros like ASSERT are defined

By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we
don't need to kludge things to keep the warning checker happy etc.

7 years agoImprove error message for invalid package db file (#6133).
Paolo Capriotti [Mon, 4 Jun 2012 10:59:25 +0000 (11:59 +0100)] 
Improve error message for invalid package db file (#6133).

Use `reads` instead of `read` to parse package configuration files, and
report a meaningful error when the parsing fails.

7 years agoavoid name clash
Simon Marlow [Mon, 4 Jun 2012 10:06:26 +0000 (11:06 +0100)] 
avoid name clash

7 years agoFix the dynlib build on Windows
Ian Lynagh [Fri, 1 Jun 2012 23:29:55 +0000 (00:29 +0100)] 
Fix the dynlib build on Windows

I have no idea why this worked when Word was in base, but doesn't
after it moved to ghc-prim.

7 years agoImprove the size-change detection heuristics in the compare tool
Ian Lynagh [Wed, 30 May 2012 15:04:17 +0000 (16:04 +0100)] 
Improve the size-change detection heuristics in the compare tool

7 years agoRemove some commented out code
Ian Lynagh [Tue, 29 May 2012 20:37:30 +0000 (21:37 +0100)] 
Remove some commented out code

7 years agoFix whitespace in coreSyn/CorePrep.lhs
Ian Lynagh [Tue, 29 May 2012 19:37:35 +0000 (20:37 +0100)] 
Fix whitespace in coreSyn/CorePrep.lhs

7 years agoFix whitespace in main/TidyPgm.lhs
Ian Lynagh [Tue, 29 May 2012 19:31:52 +0000 (20:31 +0100)] 
Fix whitespace in main/TidyPgm.lhs

7 years agohsSyn/HsTypes.lhs is already tab-free, so remove the warning kludge
Ian Lynagh [Tue, 29 May 2012 17:00:41 +0000 (18:00 +0100)] 
hsSyn/HsTypes.lhs is already tab-free, so remove the warning kludge

7 years agocmm/MkGraph.hs is already tab-free, so remove the warning kludge
Ian Lynagh [Tue, 29 May 2012 16:58:44 +0000 (17:58 +0100)] 
cmm/MkGraph.hs is already tab-free, so remove the warning kludge

7 years agoRemove a couple of old wrapper functions
Ian Lynagh [Tue, 29 May 2012 16:48:07 +0000 (17:48 +0100)] 
Remove a couple of old wrapper functions

7 years agoRemove some disabled code
Ian Lynagh [Tue, 29 May 2012 12:31:32 +0000 (13:31 +0100)] 
Remove some disabled code

7 years agoRemove some more stdout/stderr uses
Ian Lynagh [Tue, 29 May 2012 12:30:52 +0000 (13:30 +0100)] 
Remove some more stdout/stderr uses

7 years agoRemove more uses of stdout and stderr
Ian Lynagh [Tue, 29 May 2012 12:21:12 +0000 (13:21 +0100)] 
Remove more uses of stdout and stderr

7 years agoReplace printDump with a new Severity
Ian Lynagh [Tue, 29 May 2012 00:46:07 +0000 (01:46 +0100)] 
Replace printDump with a new Severity

We now use log_action with severity SevDump, rather than calling
printDump. This means that what happens to dumped info is now under
the control of the GHC API user, rather than always going to stdout.

7 years agoRemove an unused import
Ian Lynagh [Mon, 28 May 2012 22:26:06 +0000 (23:26 +0100)] 
Remove an unused import

7 years agoRemove printOutput; it's not used.
Ian Lynagh [Mon, 28 May 2012 22:25:03 +0000 (23:25 +0100)] 
Remove printOutput; it's not used.

7 years agoRmove printErrs
Ian Lynagh [Mon, 28 May 2012 22:23:58 +0000 (23:23 +0100)] 
Rmove printErrs

It's no longer used

7 years agoUse log_action rather than printErrs in TcRnMonad
Ian Lynagh [Mon, 28 May 2012 22:22:29 +0000 (23:22 +0100)] 
Use log_action rather than printErrs in TcRnMonad

We used to write directly to stderr, which couldn't be overridden.

7 years agoRemove printSDoc; it's now unused
Ian Lynagh [Mon, 28 May 2012 22:16:17 +0000 (23:16 +0100)] 
Remove printSDoc; it's now unused

7 years agoMake traceBinIFaceReading use log_action
Ian Lynagh [Mon, 28 May 2012 22:14:58 +0000 (23:14 +0100)] 
Make traceBinIFaceReading use log_action

It was printing directly to stdout

7 years agoAdd defaultLogActionHPrintDoc to DynFlags
Ian Lynagh [Mon, 28 May 2012 22:09:20 +0000 (23:09 +0100)] 
Add defaultLogActionHPrintDoc to DynFlags

We now use this function rather than Outputable.{printSDoc,printErrs}.

Outputable is arguably a better home for the function, but putting it
in DynFlags should dissuade people from using it inappropriately (in
particular, nothing other than the default hooks should have stdout
or stderr hardcoded).

Not exporting it at all would also be an option, but exporting it with
an ungainly name will make it slightly easier for people who want to
send output to other Handles for some reason.

7 years agoBe less aggressive about the result discount
Simon Peyton Jones [Mon, 28 May 2012 16:33:42 +0000 (17:33 +0100)] 
Be less aggressive about the result discount

This patch fixes Trac #6099 by reducing the result discount in CoreUnfold.conSize.
See Note [Constructor size and result discount] in CoreUnfold.

The existing version is definitely too aggressive. Simon M found it an
"unambiguous win" but it is definitely what led to the bloat. In a function
with a lot of case branches, all returning a constructor, the discount could
grow arbitrarily large.

I also had to increase the -funfolding-creation-threshold from 450 to 750,
otherwise some functions that should inline simply never get an unfolding.
(The massive result discount was allow the unfolding to appear before.)

The nofib results are these, picking a handful of outliers to show.

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
         fulsom          -0.5%     -1.6%     -2.8%     -2.6%    +31.1%
       maillist          -0.2%     -0.0%      0.09      0.09     -3.7%
         mandel          -0.4%     +6.6%      0.12      0.12     +0.0%
       nucleic2          -0.2%    +18.5%      0.11      0.11     +0.0%
        parstof          -0.4%     +4.0%      0.00      0.00     +0.0%
--------------------------------------------------------------------------------
            Min          -0.9%     -1.6%    -19.7%    -19.7%     -3.7%
            Max          +0.3%    +18.5%     +2.7%     +2.7%    +31.1%
 Geometric Mean          -0.3%     +0.4%     -3.0%     -3.0%     +0.2%

Turns out that nucleic2 has a function
  Main.$wabsolute_pos =
    \ (ww_s4oj :: Types.Tfo) (ww1_s4oo :: Types.FloatT)
      (ww2_s4op :: Types.FloatT) (ww3_s4oq :: Types.FloatT) ->
      case ww_s4oj
      of _
      { Types.Tfo a_a1sS b_a1sT c_a1sU d_a1sV e_a1sW f_a1sX g_a1sY h_a1sZ i_a1t0 tx_a1t1 ty_a1t2 tz_a1t3 ->
      (# case ww1_s4oo of _ { GHC.Types.F# x_a2sO ->
         case a_a1sS of _ { GHC.Types.F# y_a2sS ->
         case ww2_s4op of _ { GHC.Types.F# x1_X2y9 ->
         case d_a1sV of _ { GHC.Types.F# y1_X2yh ->
         case ww3_s4oq of _ { GHC.Types.F# x2_X2yj ->
         case g_a1sY of _ { GHC.Types.F# y2_X2yr ->
         case tx_a1t1 of _ { GHC.Types.F# y3_X2yn ->
         GHC.Types.F#
           (GHC.Prim.plusFloat#
              (GHC.Prim.plusFloat#
                 (GHC.Prim.plusFloat#
                    (GHC.Prim.timesFloat# x_a2sO y_a2sS)
                    (GHC.Prim.timesFloat# x1_X2y9 y1_X2yh))
                 (GHC.Prim.timesFloat# x2_X2yj y2_X2yr))
              y3_X2yn)
         } } }}}}},

        <similar>,
        <similar> )

This is pretty big, but inlining it does get rid of that F# allocation.
But we'll also get rid of it with deep CPR: Trac #2289. For now we just
accept the change.

7 years agoAdd a setByteArray# primop
Ian Lynagh [Mon, 28 May 2012 09:55:28 +0000 (10:55 +0100)] 
Add a setByteArray# primop

Essentially, this is a wrapper around memset

7 years agoAccept -package-conf so cabal-install works
Ian Lynagh [Sun, 27 May 2012 16:38:52 +0000 (17:38 +0100)] 
Accept -package-conf so cabal-install works

Really we ought to support all the old flags, but warn that they
are deprecated.

7 years agoTest USE_MINIINTERPRETER rather than GhcUnregisterised
Ian Lynagh [Sun, 27 May 2012 12:02:24 +0000 (13:02 +0100)] 
Test USE_MINIINTERPRETER rather than GhcUnregisterised

7 years agoSpecify the libdir to use when building libffi
Ian Lynagh [Sat, 26 May 2012 18:04:45 +0000 (19:04 +0100)] 
Specify the libdir to use when building libffi

Fixes the build on platforms that default to using a directory called
lib64. Reported by Gabriel Dos Reis.

7 years agoUpdates for haskeline-0.7's new MonadException API.
Judah Jacobson [Tue, 22 May 2012 02:42:18 +0000 (19:42 -0700)] 
Updates for haskeline-0.7's new MonadException API.

7 years agoFix problems with getMonotonicNSec on OS X
Ian Lynagh [Sat, 26 May 2012 10:41:12 +0000 (11:41 +0100)] 
Fix problems with getMonotonicNSec on OS X

We were incorrectly multiplying by 1e9, which (a) meant we were
getting values that were far too large, and (b) meant that when
we casted from double to StgWord64 the result was 0, as the value
was out of range.

We now do all the work as StgWord64.

7 years agoImprove occurs-check error reporting (fix Trac #6123)
Simon Peyton Jones [Fri, 25 May 2012 10:45:53 +0000 (11:45 +0100)] 
Improve occurs-check error reporting (fix Trac #6123)

We were wrongly reporting (a ~ F a) as an occurs-check error
when F is a type function.

7 years agoTidy up the treatment of signatures (incl fixity)
Simon Peyton Jones [Thu, 24 May 2012 11:28:58 +0000 (12:28 +0100)] 
Tidy up the treatment of signatures (incl fixity)

This fixes Trac #6120.  I've added comments to explain.
Turns out there was another lurking bug, also fixed,
and tested in (an extended version of) th/T2713.

7 years agoFix an assertion failure in the stage2 compiler
Simon Peyton Jones [Thu, 24 May 2012 11:27:12 +0000 (12:27 +0100)] 
Fix an assertion failure in the stage2 compiler

Rather an unsavory fix, but will go away when we do the major
TH reorganisation from my blog post.

7 years agoWibbles from 'Fix scoping of kind variables in instance declarations'
Simon Peyton Jones [Thu, 24 May 2012 11:26:31 +0000 (12:26 +0100)] 
Wibbles from 'Fix scoping of kind variables in instance declarations'

This earlier commit
  6a8b4290 * Fix scoping of kind variables in instance declarations
make became a bit more rigourous about ensuring that the kind-variable
field of LHsTyVarBndrs was properly filled after renaming.  This patch
fixed DsMeta to follow suit.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 24 May 2012 11:21:37 +0000 (12:21 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoescape(): don't forget the final '\0'
Simon Marlow [Wed, 23 May 2012 11:30:38 +0000 (06:30 -0500)] 
escape(): don't forget the final '\0'

Hopefully should fix random "bad heap profile" failures in the nightly
builds.

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Tue, 22 May 2012 14:15:26 +0000 (15:15 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoComments only
Simon Peyton Jones [Tue, 22 May 2012 14:14:58 +0000 (15:14 +0100)] 
Comments only

7 years agoFix scoping of kind variables in instance declarations
Simon Peyton Jones [Tue, 22 May 2012 14:14:48 +0000 (15:14 +0100)] 
Fix scoping of kind variables in instance declarations

Fixes Trac #6118

7 years agoFix build
Ian Lynagh [Tue, 22 May 2012 13:46:44 +0000 (14:46 +0100)] 
Fix build

7 years agoFix warning
Ian Lynagh [Tue, 22 May 2012 13:01:01 +0000 (14:01 +0100)] 
Fix warning

7 years agoFix path to ar on Windows
Ian Lynagh [Tue, 22 May 2012 12:46:57 +0000 (13:46 +0100)] 
Fix path to ar on Windows

7 years agocheckStability: respect -fforce-recomp (#6105)
Simon Marlow [Tue, 22 May 2012 11:30:36 +0000 (12:30 +0100)] 
checkStability: respect -fforce-recomp (#6105)

7 years agoAccept the old -package-conf flags for backwards compatibility
Simon Marlow [Tue, 22 May 2012 11:11:59 +0000 (12:11 +0100)] 
Accept the old -package-conf flags for backwards compatibility

7 years agoRead the source file timestamp *before* preprocessing (#6106)
Simon Marlow [Tue, 22 May 2012 10:51:46 +0000 (11:51 +0100)] 
Read the source file timestamp *before* preprocessing (#6106)

7 years agoDon't remove the thread from interruptTargetThread on ^C (#6116)
Simon Marlow [Tue, 22 May 2012 10:39:03 +0000 (11:39 +0100)] 
Don't remove the thread from interruptTargetThread on ^C (#6116)

7 years agoFollow the move of the Word type to ghc-prim
Ian Lynagh [Mon, 21 May 2012 22:20:22 +0000 (23:20 +0100)] 
Follow the move of the Word type to ghc-prim

7 years agoFix ar detection
Ian Lynagh [Sun, 20 May 2012 20:50:38 +0000 (21:50 +0100)] 
Fix ar detection

7 years agoFix dblatex and xml* tool detection on Windows
Ian Lynagh [Sun, 20 May 2012 20:28:37 +0000 (21:28 +0100)] 
Fix dblatex and xml* tool detection on Windows

We now normalise their paths, so that native Windows paths rather than
cygwin paths. This means that we are able to execute them from Cabal
or python.

I've also abstracted out the normalisation code into an m4 function.

7 years agoFull validates now install transformers rather than mtl
Ian Lynagh [Sat, 19 May 2012 12:43:27 +0000 (13:43 +0100)] 
Full validates now install transformers rather than mtl

7 years agoUse transformers directly, rather than using mtl
Ian Lynagh [Sat, 19 May 2012 11:27:26 +0000 (12:27 +0100)] 
Use transformers directly, rather than using mtl

This means we no longer need mtl in a GHC tree.

7 years agoRemove a couple of unnecessary lines of CPP
Ian Lynagh [Fri, 18 May 2012 17:25:24 +0000 (18:25 +0100)] 
Remove a couple of unnecessary lines of CPP

7 years agoFix #6109 : error Unknown mingw32 arch.
Erik de Castro Lopo [Fri, 18 May 2012 11:59:17 +0000 (21:59 +1000)] 
Fix #6109 : error Unknown mingw32 arch.

7 years agoMerge branch 'master' of win:c:/m64/reg13/.
Ian Lynagh [Fri, 18 May 2012 16:55:30 +0000 (17:55 +0100)] 
Merge branch 'master' of win:c:/m64/reg13/.

7 years agoMore Win64 adjustor fixes
Ian Lynagh [Fri, 18 May 2012 11:32:21 +0000 (12:32 +0100)] 
More Win64 adjustor fixes

7 years agoWibbles to lunaris's patch for promoted kinds
Simon Peyton Jones [Fri, 18 May 2012 09:10:28 +0000 (10:10 +0100)] 
Wibbles to lunaris's patch for promoted kinds

7 years agoAllow INLINABLE pragmas in TH
Simon Peyton Jones [Fri, 18 May 2012 09:10:02 +0000 (10:10 +0100)] 
Allow INLINABLE pragmas in TH

Thanks to mikhail.vorozhtsov for doing the work

7 years agoApplied lunaris's patch to allow promoted types and rich kinds in Template Haskell
Richard Eisenberg [Tue, 15 May 2012 17:42:46 +0000 (13:42 -0400)] 
Applied lunaris's patch to allow promoted types and rich kinds in Template Haskell

7 years agoFix the stub C files we generate on Win64
Ian Lynagh [Fri, 18 May 2012 01:16:43 +0000 (02:16 +0100)] 
Fix the stub C files we generate on Win64

7 years agoFix the way the adjustor puts things on the stack on Win64
Ian Lynagh [Fri, 18 May 2012 01:16:05 +0000 (02:16 +0100)] 
Fix the way the adjustor puts things on the stack on Win64

7 years agoFix freeHaskellFunctionPtr on Win64
Ian Lynagh [Thu, 17 May 2012 22:03:26 +0000 (23:03 +0100)] 
Fix freeHaskellFunctionPtr on Win64

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Ian Lynagh [Thu, 17 May 2012 01:01:42 +0000 (02:01 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoSet the context_switch flag in yield#
Simon Marlow [Wed, 16 May 2012 08:56:12 +0000 (09:56 +0100)] 
Set the context_switch flag in yield#

yieldThread hasn't been working for a while: unless we set the
context_switch flag to indicate that the current time slice is over,
the RTS scheduler just runs the same thread again.  Spotted by Andreas
Voellmy (thanks!).

7 years agoDon't use stdcall on Win64: It isn't supported; ccall is used instead
Ian Lynagh [Wed, 16 May 2012 14:14:36 +0000 (15:14 +0100)] 
Don't use stdcall on Win64: It isn't supported; ccall is used instead

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 16 May 2012 10:14:21 +0000 (11:14 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoBe careful to instantiate kind variables when dealing with functional dependencies
Simon Peyton Jones [Wed, 16 May 2012 10:13:52 +0000 (11:13 +0100)] 
Be careful to instantiate kind variables when dealing with functional dependencies

There were really two bugs
  a) When the fundep fires we must apply the matching
     substitution to the kinds of the remaining type vars
     (This happens in FunDeps.checkClsFD, when we create meta_tvs)

  b) When instantiating the un-matched type variables we must
     instantiate their kinds properly
     (This happens in TcSMonad.instFlexiTcS)

This fixes #6068 and #6015 (second reported bug).

7 years agoWhen comparing Case expressions, take account of empty alternatives
Simon Peyton Jones [Wed, 16 May 2012 09:50:36 +0000 (10:50 +0100)] 
When comparing Case expressions, take account of empty alternatives

After the recent change that allows empty case alternatives, we
were accidentally saying that these two were equal:
   Case x _ Int  []
   Case x _ Bool []
Usually if the alternatives are equal so is the result type -- but
not if the alternatives are empty!

There are two places to fix:
  CoreUtils.eqExpr
  TrieMap with CoreExpr key

Fixes #6096, #6097

7 years agoSupport code generation for unboxed-tuple function arguments
Max Bolingbroke [Sun, 18 Mar 2012 00:00:38 +0000 (00:00 +0000)] 
Support code generation for unboxed-tuple function arguments

This is done by a 'unarisation' pre-pass at the STG level which
translates away all (live) binders binding something of unboxed
tuple type.

This has the following knock-on effects:
  * The subkind hierarchy is vastly simplified (no UbxTupleKind or ArgKind)
  * Various relaxed type checks in typechecker, 'foreign import prim' etc
  * All case binders may be live at the Core level

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Ian Lynagh [Tue, 15 May 2012 17:18:19 +0000 (18:18 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoRemove StgTypeArg since it was never used and is probably broken anyway
Max Bolingbroke [Sat, 17 Mar 2012 11:17:38 +0000 (11:17 +0000)] 
Remove StgTypeArg since it was never used and is probably broken anyway

7 years agoRemove the unused Type field from StgLam
Max Bolingbroke [Sat, 17 Mar 2012 11:14:53 +0000 (11:14 +0000)] 
Remove the unused Type field from StgLam

7 years agoFollow changes in Cabal.
Paolo Capriotti [Tue, 15 May 2012 09:32:58 +0000 (10:32 +0100)] 
Follow changes in Cabal.

7 years agoAdd a fixity environment to InteractiveContext (#2947)
Paolo Capriotti [Wed, 2 May 2012 18:22:10 +0000 (19:22 +0100)] 
Add a fixity environment to InteractiveContext (#2947)

7 years agoSimplify the behavior of package db flags.
Paolo Capriotti [Thu, 10 May 2012 15:18:21 +0000 (16:18 +0100)] 
Simplify the behavior of package db flags.

Previously, the `-no-user-package` and `-no-global-package` flags
affected the "initial" stack only, while `user-package` and
`global-packages` appended to the end of the stack.

This commit changes the behavior of those flags, so that they are always
applied to the stack as a whole.

The effect of the GHC_PACKAGE_PATH environment variable has also been
changed: terminating it with a separator now adds the default package
dbs (user and global) instead of the initial stack.

7 years agoUpdate documentation of the package db flags.
Paolo Capriotti [Fri, 4 May 2012 14:56:36 +0000 (15:56 +0100)] 
Update documentation of the package db flags.

7 years agoRename package-conf flags to package-db.
Paolo Capriotti [Fri, 4 May 2012 12:04:43 +0000 (13:04 +0100)] 
Rename package-conf flags to package-db.

Rename package database flags in both GHC and ghc-pkg so that they are
consistent with Cabal nomenclature.

Add a version check to the build system so that the correct set of
package db flags are used when the bootstrapping GHC has version < 7.5.

7 years agoAdd flags to manipulate package db stack (#5977)
Paolo Capriotti [Thu, 3 May 2012 10:29:51 +0000 (11:29 +0100)] 
Add flags to manipulate package db stack (#5977)

Introduce new flags to allow any package database stack to be set up.
The `-no-user-package-conf` and `-no-global-package-conf` flags remove
the corresponding package db from the initial stack, while
`-user-package-conf` and `-global-package-conf` push it back on top of
the stack.

7 years agoTweak the lexer: In particular, improve notFollowedBy and friends
Ian Lynagh [Mon, 14 May 2012 23:16:59 +0000 (00:16 +0100)] 
Tweak the lexer: In particular, improve notFollowedBy and friends

We were hitting a problem when reading the LANGUAGE/OPTIONS pragmas
from GHC.TypeLits, where the buffer ended "{-". The rules for the
start-comment lexeme check that "{-" is not followed by "#", but the
test returned False when there was no next character. Therefore we
were lexing this as as an open-curly lexeme (only consuming the "{",
and not reaching the end of the buffer),
which meant the options parser think that it had reached the end of
the options.

Now we correctly lex as "{-".

7 years agoUse pprInfixName in pprInfo (#6091)
Paolo Capriotti [Mon, 14 May 2012 12:37:14 +0000 (13:37 +0100)] 
Use pprInfixName in pprInfo (#6091)

Surround a name in backticks when printing an infix declaration in GHCi.

7 years agoFix the the pure unifier so that it unifies kinds
Simon Peyton Jones [Mon, 14 May 2012 13:05:48 +0000 (14:05 +0100)] 
Fix the the pure unifier so that it unifies kinds

When unifying two type variables we must unify their kinds.
The pure *matcher* was doing so, but the pure *unifier* was not.
This patch fixes Trac #6015, where an instance lookup was failing
when it should have succeeded.

I removed a bunch of code aimed at support sub-kinding. It's
tricky, ad-hoc, and I don't think its necessary any more.
Anything we can do to simplify the sub-kinding story is welcome!

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 11 May 2012 17:03:01 +0000 (18:03 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoDelete dead code mkIParamTyCon
Simon Peyton Jones [Fri, 11 May 2012 17:02:47 +0000 (18:02 +0100)] 
Delete dead code mkIParamTyCon

7 years agoRefactor LHsTyVarBndrs to fix Trac #6081
Simon Peyton Jones [Fri, 11 May 2012 17:02:18 +0000 (18:02 +0100)] 
Refactor LHsTyVarBndrs to fix Trac #6081

This is really a small change, but it touches a lot of files quite
significantly. The real goal is to put the implicitly-bound kind
variables of a data/class decl in the right place, namely on the
LHsTyVarBndrs type, which now looks like

  data LHsTyVarBndrs name
    = HsQTvs { hsq_kvs :: [Name]
             , hsq_tvs :: [LHsTyVarBndr name]
      }

This little change made the type checker neater in a number of
ways, but it was fiddly to push through the changes.

7 years agoHandle cases with no alternatives in GHCi
Simon Marlow [Fri, 11 May 2012 09:26:28 +0000 (10:26 +0100)] 
Handle cases with no alternatives in GHCi

Fixes cgrun045(ghci) amongst others

7 years agoFix bug in expandTypeSynonyms that could rarely cause problems
Max Bolingbroke [Thu, 10 May 2012 08:46:04 +0000 (09:46 +0100)] 
Fix bug in expandTypeSynonyms that could rarely cause problems

7 years agoComments only
Simon Peyton Jones [Thu, 10 May 2012 08:45:16 +0000 (09:45 +0100)] 
Comments only

7 years agoFix build on Win64
Ian Lynagh [Wed, 9 May 2012 23:53:28 +0000 (00:53 +0100)] 
Fix build on Win64

7 years agoMerge branch 'master' of http://darcs.haskell.org//ghc
Simon Peyton Jones [Wed, 9 May 2012 16:52:24 +0000 (17:52 +0100)] 
Merge branch 'master' of darcs.haskell.org//ghc

7 years agoFix build on Win64
Ian Lynagh [Wed, 9 May 2012 15:45:40 +0000 (16:45 +0100)] 
Fix build on Win64

7 years agoRe-do the "function application discount" (fixes Trac #6048)
Simon Peyton Jones [Wed, 9 May 2012 15:22:49 +0000 (16:22 +0100)] 
Re-do the "function application discount" (fixes Trac #6048)

* Undoes Max's very aggressive function-inlining change
  (see comments with Trac #6048)

* Resticts function application discount to functions
  that occur just once in the body. It was the multiple
  occurrences that led to the exponential behavour in
  Trac #6048.

See Note [Function application discount] in CoreUnfold.

Module binary sizes are down 2% on average, which is good.
Allocations wobble about a bit, but only on a few benchmarks
and not by much, so it seems a price worth paying to avoid
exponential behaviour!

                         Allocs
            Min           -1.2%
            Max           +2.8%
 Geometric Mean           +0.0%

7 years agoTake care not to mix polymorphic and unlifted bindings in a group
Simon Peyton Jones [Wed, 9 May 2012 14:23:25 +0000 (15:23 +0100)] 
Take care not to mix polymorphic and unlifted bindings in a group

Fixes Trac #6078

7 years agoWibbles to 'simplify the SimplCont data type'
Simon Peyton Jones [Tue, 8 May 2012 09:25:22 +0000 (10:25 +0100)] 
Wibbles to 'simplify the SimplCont data type'

7 years agoSimplify the SimplCont data type
Simon Peyton Jones [Fri, 4 May 2012 22:02:46 +0000 (23:02 +0100)] 
Simplify the SimplCont data type

* Put the result type in the Stop continuation
* No need for the alts type in Select

The result is a modest but useful simplification

7 years agoMerge branch 'ghc-new-flavor'
Simon Peyton Jones [Wed, 9 May 2012 14:50:54 +0000 (15:50 +0100)] 
Merge branch 'ghc-new-flavor'