5 years agoGlobally replace "" with ""
Simon Marlow [Mon, 23 Sep 2013 15:03:44 +0000 (16:03 +0100)] 
Globally replace "" with ""

5 years agouse StgWord not StgWord8 for wakeup
Simon Marlow [Tue, 17 Sep 2013 20:49:53 +0000 (21:49 +0100)] 
use StgWord not StgWord8 for wakeup

volatile StgWord8 is not guaranteed to be atomic.

5 years agouse a nat, not StgWord8, for gc_type
Simon Marlow [Tue, 17 Sep 2013 20:48:55 +0000 (21:48 +0100)] 
use a nat, not StgWord8, for gc_type

5 years agoRemove use of R9, and fix associated bugs
Simon Marlow [Tue, 17 Sep 2013 20:48:39 +0000 (21:48 +0100)] 
Remove use of R9, and fix associated bugs

We were passing the function address to stg_gc_prim_p in R9, which was
wrong because the call was a high-level call and didn't declare R9 as
a parameter.  Passing R9 as an argument is the right way, but
unfortunately that exposed another bug: we were using the same macro
in some low-level Cmm, where it is illegal to call functions with
arguments (see Note [syntax of cmm files]).  So we now have low-level
variants of STK_CHK() and STK_CHK_P() for use in low-level Cmm code.

5 years agoExpand the commentary in Note [syntax of cmm files]
Simon Marlow [Tue, 17 Sep 2013 20:42:54 +0000 (21:42 +0100)] 
Expand the commentary in Note [syntax of cmm files]

5 years agoTypos in users' guide
Krzysztof Gogolewski [Tue, 1 Oct 2013 09:44:00 +0000 (11:44 +0200)] 
Typos in users' guide

5 years agoCompare against pRELUDE_NAME instead of "Prelude"
Patrick Palka [Mon, 30 Sep 2013 19:15:42 +0000 (15:15 -0400)] 
Compare against pRELUDE_NAME instead of "Prelude"

5 years agoFix AMP warnings for explicit Prelude imports (#8004)
Austin Seipp [Sun, 29 Sep 2013 23:12:13 +0000 (18:12 -0500)] 
Fix AMP warnings for explicit Prelude imports (#8004)

No AMP warnings will be issued anymore when the name is not imported
from Prelude anymore. For example, a local definition of 'join' is now
legal in modules containing 'import Prelude (map)' for example. This
allows better future-proofing of libraries.

See also

Authored-by: David Luposchainsky <>
Signed-off-by: Austin Seipp <>
5 years agoMention the Foldable and Traversable instances for Const r in the user guide
Edward Kmett [Fri, 27 Sep 2013 18:20:45 +0000 (14:20 -0400)] 
Mention the Foldable and Traversable instances for Const r in the user guide

Signed-off-by: Austin Seipp <>
5 years agoAdd a note about Proxy# to the user guide
Edward Kmett [Fri, 27 Sep 2013 18:37:26 +0000 (14:37 -0400)] 
Add a note about Proxy# to the user guide

Signed-off-by: Austin Seipp <>
5 years agoRemove extra space in LIBFFI_CFLAGS (#8349)
Peter Trommler [Sun, 22 Sep 2013 16:55:54 +0000 (18:55 +0200)] 
Remove extra space in LIBFFI_CFLAGS (#8349)

Signed-off-by: Austin Seipp <>
5 years agoFix BCO bitmap generation on 32-bit platforms (#8377)
Takano Akio [Sat, 28 Sep 2013 08:45:47 +0000 (17:45 +0900)] 
Fix BCO bitmap generation on 32-bit platforms (#8377)

On 32-bit platforms, the bitmap should be an array of
32-bit words, not Word64s.

Signed-off-by: Austin Seipp <>
5 years agoMake lazy unlifted bindings an error by default.
Austin Seipp [Tue, 10 Sep 2013 02:50:52 +0000 (21:50 -0500)] 
Make lazy unlifted bindings an error by default.

This was supposed to happen a long time ago, but later is better than
never. This makes `-fwarn-lazy-unlifted-bindings` into a no-op (with its
own warning) to be removed in GHC 7.10.

This fixes #8022.

Signed-off-by: Austin Seipp <>
5 years agoTeach sync-all how to rewrite submodule repo urls
Herbert Valerio Riedel [Sat, 28 Sep 2013 08:15:21 +0000 (10:15 +0200)] 
Teach sync-all how to rewrite submodule repo urls

This applies attachment:sync-all-submodules-locally.diff from #8369

Authored-by: Nathaniel Filardo
Signed-off-by: Herbert Valerio Riedel <>
5 years agoFix typo in sync-all script. (#8375)
Muhaimin Ahsan [Sat, 28 Sep 2013 04:44:58 +0000 (23:44 -0500)] 
Fix typo in sync-all script. (#8375)

5 years agoRnNames.lhs : Reuse existing function.
Erik de Castro Lopo [Fri, 27 Sep 2013 18:50:54 +0000 (04:50 +1000)] 
RnNames.lhs : Reuse existing function.

5 years agoWhitespace only.
Erik de Castro Lopo [Mon, 23 Sep 2013 19:09:02 +0000 (05:09 +1000)] 
Whitespace only.

5 years agoRelease notes: mention -XEmptyCase
Krzysztof Gogolewski [Fri, 27 Sep 2013 06:57:55 +0000 (08:57 +0200)] 
Release notes: mention -XEmptyCase

5 years agoFix manual regarding current state of implicit quantification
Krzysztof Gogolewski [Fri, 27 Sep 2013 06:55:44 +0000 (08:55 +0200)] 
Fix manual regarding current state of implicit quantification

See also #4426

5 years agoMake typeRep_RDR use typeRep# instead of typeRep
Austin Seipp [Thu, 26 Sep 2013 06:42:51 +0000 (01:42 -0500)] 
Make typeRep_RDR use typeRep# instead of typeRep

Authored-by: Edward Kmett <>
Authored-by: Austin Seipp <>
Signed-off-by: Austin Seipp <>
5 years agoImplement an unlifted Proxy type, Proxy#
Austin Seipp [Wed, 25 Sep 2013 07:42:21 +0000 (02:42 -0500)] 
Implement an unlifted Proxy type, Proxy#

A value of type 'Proxy# a' can only be created through the new,
primitive witness 'proxy# :: Proxy# a' - a Proxy# has no runtime
representation and is thus free.

This lets us clean up the internals of TypeRep, as well as Adam's future
work concerning records (by using a zero-width primitive type.)

Authored-by: Edward Kmett <>
Authored-by: Austin Seipp <>
Signed-off-by: Austin Seipp <>
5 years agoUpdate `primitive` and `vector` packages
Herbert Valerio Riedel [Thu, 26 Sep 2013 09:58:25 +0000 (11:58 +0200)] 
Update `primitive` and `vector` packages

 - `primitive` is updated to upstream's HEAD which is essentially
   `primitive-`, plus a core-lint-error workaround for #8355 and
   some minor cleanups.

 - `vector` is updated to upstreams `vector-` release

Note: The upstream repo location has changed to GitHub,
      hence the update in the `packages` file

Signed-off-by: Herbert Valerio Riedel <>
5 years agoFix user guide documentation about unboxed values
Arash Rouhani [Tue, 24 Sep 2013 20:06:18 +0000 (22:06 +0200)] 
Fix user guide documentation about unboxed values

Signed-off-by: Arash Rouhani <>
5 years agoTypo in comment
Gabor Greif [Mon, 23 Sep 2013 19:58:22 +0000 (21:58 +0200)] 
Typo in comment

5 years agoAdd a type-function for subtraction.
Iavor S. Diatchki [Tue, 24 Sep 2013 13:14:15 +0000 (06:14 -0700)] 
Add a type-function for subtraction.

This is used in the definition of `ToNat1` in the `base` library
(module GHC.TypeLits).

5 years agoRelease notes: mention instance Monad (WrappedMonad m) (#8218)
Krzysztof Gogolewski [Mon, 23 Sep 2013 16:21:22 +0000 (18:21 +0200)] 
Release notes: mention instance Monad (WrappedMonad m) (#8218)

5 years agoFix build when PROF_SPIN is unset
Patrick Palka [Sat, 29 Jun 2013 23:58:28 +0000 (19:58 -0400)] 
Fix build when PROF_SPIN is unset

whitehole_spin is only defined when PROF_SPIN is set.

5 years agoFix the definition of cas() on x86 (#8219)
Patrick Palka [Sat, 21 Sep 2013 17:27:13 +0000 (13:27 -0400)] 
Fix the definition of cas() on x86 (#8219)

*p is both read and written to by the cmpxchg instruction, and therefore
should be given the '+' constraint modifier.

(In GCC's extended ASM language, '+' means that the operand is both read
and written to whereas '=' means that it is only written to.)

Otherwise, the compiler is allowed to rewrite something like

SpinLock lock;
initSpinLock(&lock);       /* sets lock = 1 */


SpinLock lock;

because according to the asm statement, the previous value of 'lock' is
not important.

5 years agoRemove fglasgow-exts from ghci --help
Krzysztof Gogolewski [Mon, 23 Sep 2013 11:43:47 +0000 (13:43 +0200)] 
Remove fglasgow-exts from ghci --help

It has been deprecated for long and already removed from ghc --help

5 years agoFix linker_unload now that we are running constructors in the linker (#8291)
Simon Marlow [Sun, 22 Sep 2013 12:08:01 +0000 (13:08 +0100)] 
Fix linker_unload now that we are running constructors in the linker (#8291)

See also #5435.

Now we have to remember the the StablePtrs that get created by the
module initializer so that we can free them again in unloadObj().

5 years agoDiscard unreachable code in the register allocator (#7574)
Simon Marlow [Sat, 21 Sep 2013 17:32:33 +0000 (18:32 +0100)] 
Discard unreachable code in the register allocator (#7574)

The problem with unreachable code is that it might refer to undefined
registers.  This happens accidentally: a block can be orphaned by an
optimisation, for example when the result of a comparsion becomes

The register allocator panics when it finds an undefined register,
because they shouldn't occur in generated code.  So we need to also
discard unreachable code to prevent this panic being triggered by

The register alloator already does a strongly-connected component
analysis, so it ought to be easy to make it discard unreachable code
as part of that traversal.  It turns out that we need a different
variant of the scc algorithm to do that (see Digraph), however the new
variant also generates slightly better code by putting the blocks
within a loop in a better order for register allocation.

5 years agoTypos
Krzysztof Gogolewski [Mon, 23 Sep 2013 09:28:36 +0000 (11:28 +0200)] 

5 years agoCatch potential garbage after -msse.
Geoffrey Mainland [Mon, 23 Sep 2013 04:40:59 +0000 (00:40 -0400)] 
Catch potential garbage after -msse.

5 years agoMerge branch 'wip/simd'
Geoffrey Mainland [Mon, 23 Sep 2013 04:22:19 +0000 (00:22 -0400)] 
Merge branch 'wip/simd'

This merge revises and extends the current SIMD support in GHC. Notable

 * Support for AVX, AVX2, and AVX-512. Support for AVX-512 is untested.

 * SIMD primops are currently LLVM-only and documented in

 * By default only 128-bit wide SIMD vectors are passed in registers, and then
   only on the X86_64 architecture. There is a "hidden" flag,
   -fllvm-pass-vectors-in-regs, that causes GHC to generate LLVM code that
   assumes all vectors are passed in registers by LLVM. This can be used with a
   suitably patched version of LLVM, and if we get LLVM 3.4 patched, we can
   consider turning it on by default for LLVM 3.4+. This would mean that we
   couldn't mix LLVM <3.4-compiled object files with LLVM >=3.4-compiled object
   files, but I don't see that as much of a problem.

 * utils/genprimcode has been hacked up to allow us to write vector operations
   once and have them instantiated at multiple vector types. I'm not thrilled
   with this solution, but after discussing with Simon PJ, what I've implemented
   seems to be the minimal reasonable solution to the problem of exploding
   primop boilerplate. The changes are documented in

 * Error handling is sub-optimal. My patch checks to make sure that vector
   primops can be compiled efficiently based on the current set of dynamic
   flags. For example, if -mavx is not specified and the user tries to use a
   primop that adds together two 256-bit wide vectors of double-precision
   elements, the user will see an error message like:

     ghc-stage2: sorry! (unimplemented feature or known bug)
       (GHC version 7.7.20130916 for x86_64-unknown-linux):
 256-bit wide floating point SIMD vector instructions require at least -mavx.

5 years agoCheck that SIMD vector instructions are compatible with current set of dynamic flags.
Geoffrey Mainland [Mon, 16 Sep 2013 16:48:30 +0000 (12:48 -0400)] 
Check that SIMD vector instructions are compatible with current set of dynamic flags.

SIMD vector instructions currently require the LLVM back-end. The set of
available instructions also depends on the set of architecture flags specified
on the command line.

5 years agoEnable -msse to be specified by itself.
Geoffrey Mainland [Mon, 16 Sep 2013 16:27:37 +0000 (12:27 -0400)] 
Enable -msse to be specified by itself.

This sets the SSE "version" to 1.0.

5 years agoBy default, only pass 128-bit SIMD vectors in registers on X86-64.
Geoffrey Mainland [Mon, 16 Sep 2013 03:43:29 +0000 (23:43 -0400)] 
By default, only pass 128-bit SIMD vectors in registers on X86-64.

LLVM's GHC calling convention only allows 128-bit SIMD vectors to be passed in
machine registers on X86-64. This may change in LLVM 3.4; the hidden flag
-fllvm-pass-vectors-in-regs causes all SIMD vector widths to be passed in
registers on both X86-64 and on X86-32.

5 years agoAdd 512-bit-wide SIMD primitives.
Geoffrey Mainland [Mon, 16 Sep 2013 02:53:39 +0000 (22:53 -0400)] 
Add 512-bit-wide SIMD primitives.

5 years agoPass 512-bit-wide vectors in registers.
Geoffrey Mainland [Mon, 16 Sep 2013 02:41:31 +0000 (22:41 -0400)] 
Pass 512-bit-wide vectors in registers.

5 years agoAdd support for 512-bit-wide vectors.
Geoffrey Mainland [Sun, 15 Sep 2013 21:20:09 +0000 (17:20 -0400)] 
Add support for 512-bit-wide vectors.

5 years agoAdd Cmm support for 512-bit-wide values.
Geoffrey Mainland [Sun, 15 Sep 2013 20:34:23 +0000 (16:34 -0400)] 
Add Cmm support for 512-bit-wide values.

5 years agoAdd support for -mavx512* flags.
Geoffrey Mainland [Sun, 15 Sep 2013 20:24:04 +0000 (16:24 -0400)] 
Add support for -mavx512* flags.

5 years agoAdd 256-bit-wide SIMD primitives.
Geoffrey Mainland [Thu, 22 Aug 2013 10:03:46 +0000 (11:03 +0100)] 
Add 256-bit-wide SIMD primitives.

5 years agoPass 256-bit-wide vectors in registers.
Geoffrey Mainland [Thu, 14 Feb 2013 23:28:39 +0000 (23:28 +0000)] 
Pass 256-bit-wide vectors in registers.

5 years agoFixup stack spills when generating AVX instructions.
Geoffrey Mainland [Sat, 26 Nov 2011 12:45:23 +0000 (12:45 +0000)] 
Fixup stack spills when generating AVX instructions.

LLVM uses aligned AVX moves to spill values onto the stack, which requires
32-bye aligned stacks. Since the stack in only 16-byte aligned, LLVM inserts
extra instructions that munge the stack pointer. This is very very bad for the
GHC calling convention, so we tell LLVM to assume the stack is 32-byte
aligned. This patch rewrites the spill instructions that LLVM generates so they
do not require an aligned stack.

5 years agoSet LLVM option -stack-alignment=32 when compiling AVX instructions.
Geoffrey Mainland [Thu, 14 Feb 2013 21:25:54 +0000 (21:25 +0000)] 
Set LLVM option -stack-alignment=32 when compiling AVX instructions.

5 years agoAdd support for 256-bit-wide vectors.
Geoffrey Mainland [Thu, 14 Feb 2013 18:52:00 +0000 (18:52 +0000)] 
Add support for 256-bit-wide vectors.

5 years agoAdd Cmm support for 256-bit-wide values.
Geoffrey Mainland [Thu, 14 Feb 2013 18:48:25 +0000 (18:48 +0000)] 
Add Cmm support for 256-bit-wide values.

5 years agoAdd support for -mavx and -mavx2 flags.
Geoffrey Mainland [Wed, 13 Feb 2013 16:33:01 +0000 (16:33 +0000)] 
Add support for -mavx and -mavx2 flags.

5 years agoFlesh out 128-bit wide SIMD primops.
Geoffrey Mainland [Wed, 21 Aug 2013 15:55:26 +0000 (16:55 +0100)] 
Flesh out 128-bit wide SIMD primops.

5 years agoSIMD primops are now generated using schemas that are polymorphic in
Geoffrey Mainland [Wed, 21 Aug 2013 15:18:24 +0000 (16:18 +0100)] 
SIMD primops are now generated using schemas that are polymorphic in
width and element type.

SIMD primops are now polymorphic in vector size and element type, but
only internally to the compiler. More specifically, utils/genprimopcode
has been extended so that it "knows" about SIMD vectors. This allows us
to, for example, write a single definition for the "add two vectors"
primop in primops.txt.pp and have it instantiated at many vector types.
This generates a primop in GHC.Prim for each vector type at which "add
two vectors" is instantiated, but only one data constructor for the
PrimOp data type, so the code generator is much, much simpler.

5 years agoDo not expose LLVM-only primops in GHC.PrimopWrappers.
Geoffrey Mainland [Wed, 21 Aug 2013 11:57:54 +0000 (12:57 +0100)] 
Do not expose LLVM-only primops in GHC.PrimopWrappers.

GHC.PrimopWrappers is only used by GHCi, which cannot evaluate LLVM-only
primops in any case.

5 years agoEnable passing vector arguments in xmm registers on x86-32.
Geoffrey Mainland [Thu, 8 Aug 2013 14:59:42 +0000 (15:59 +0100)] 
Enable passing vector arguments in xmm registers on x86-32.

Note that this will only work with the LLVM back end pending LLVM patches to
change the GHC calling convention appropriately.

5 years agoDo not assume that XMM registers are used to pass floating point arguments.
Geoffrey Mainland [Thu, 8 Aug 2013 14:58:42 +0000 (15:58 +0100)] 
Do not assume that XMM registers are used to pass floating point arguments.

On x86-32, the C calling convention specifies that when SSE2 is enabled, vector
arguments are passed in xmm* registers; however, float and double arguments are
still passed on the stack. This patch allows us to make the same choice for
GHC. Even when SSE2 is enabled, we don't want to pass Float and Double arguments
in registers because this would change the ABI and break the ability to link
with code that was compiled without -msse2.

The next patch will enable passing vector arguments in xmm registers on x86-32.

5 years agoEnsure that globalRegMaybe returns accurate information for XMM registers.
Geoffrey Mainland [Fri, 13 Sep 2013 16:00:05 +0000 (12:00 -0400)] 
Ensure that globalRegMaybe returns accurate information for XMM registers.

5 years agoRelease note blurb.
Austin Seipp [Mon, 23 Sep 2013 01:10:31 +0000 (20:10 -0500)] 
Release note blurb.

GHCi now runs constructors for linked libraries.

Signed-off-by: Austin Seipp <>
5 years agoRestructure compilation pipeline to allow hooks
Austin Seipp [Sun, 22 Sep 2013 23:47:35 +0000 (18:47 -0500)] 
Restructure compilation pipeline to allow hooks

This commit exposes GHC's internal compiler pipeline through a `Hooks`
module in the GHC API. It currently allows you to hook:

 * Foreign import/exports declarations
 * The frontend up to type checking
 * The one shot compilation mode
 * Core compilation, and the module iface
 * Linking and the phases in DriverPhases.hs
 * Quasiquotation

Authored-by: Luite Stegeman <>
Authored-by: Edsko de Vries <>
Signed-off-by: Austin Seipp <>
5 years agousers_guide/ghci: Whitespace cleanup (#7501)
Ben Gamari [Fri, 20 Sep 2013 21:08:00 +0000 (17:08 -0400)] 
users_guide/ghci: Whitespace cleanup (#7501)

5 years agoDocument remaining GHCi commands in users_guide (#7501)
Ben Gamari [Fri, 20 Sep 2013 18:28:51 +0000 (14:28 -0400)] 
Document remaining GHCi commands in users_guide (#7501)

Also a small formatting change in GHCi :help

5 years agoAdd release note entry for `{-# MINIMAL #-}` (#7633)
Herbert Valerio Riedel [Thu, 19 Sep 2013 08:54:47 +0000 (10:54 +0200)] 
Add release note entry for `{-# MINIMAL #-}` (#7633)

5 years agoDocument more stolen syntax (#4196)
Krzysztof Gogolewski [Sat, 21 Sep 2013 06:24:11 +0000 (08:24 +0200)] 
Document more stolen syntax (#4196)

5 years agoFix name of vanilla RTS way in the user's guide
Reid Barton [Thu, 12 Sep 2013 17:21:10 +0000 (13:21 -0400)] 
Fix name of vanilla RTS way in the user's guide

5 years agoTypos
Krzysztof Gogolewski [Fri, 20 Sep 2013 20:23:49 +0000 (22:23 +0200)] 

5 years agoUpdate `Cabal` to 1.18.1 final
Herbert Valerio Riedel [Fri, 20 Sep 2013 18:49:25 +0000 (20:49 +0200)] 
Update `Cabal` to 1.18.1 final

5 years agoComments only
Jan Stolarek [Fri, 20 Sep 2013 14:24:52 +0000 (15:24 +0100)] 
Comments only

5 years agoImprove error message for deriving polykinded Typeable (Trac #7800)
Simon Peyton Jones [Fri, 20 Sep 2013 13:51:41 +0000 (14:51 +0100)] 
Improve error message for deriving polykinded Typeable (Trac #7800)

Thanks to Krzysztof Gogolewski (monoidal) for the first draft of this patch

5 years agoNuke tc-trace that makes the typechecker loop
Simon Peyton Jones [Fri, 20 Sep 2013 13:50:32 +0000 (14:50 +0100)] 
Nuke tc-trace that makes the typechecker loop

The trace was being over-eager, which disturbs the typecheckers
careful knot-tying

5 years agoKill Type.isKindTy in favour of Kind.isKind (same code)
Simon Peyton Jones [Fri, 20 Sep 2013 13:49:36 +0000 (14:49 +0100)] 
Kill Type.isKindTy in favour of Kind.isKind (same code)

5 years agoRefactor AMP warnings a bit
Simon Peyton Jones [Fri, 20 Sep 2013 13:48:47 +0000 (14:48 +0100)] 
Refactor AMP warnings a bit

There was a bit of clutter (tryTc stuff) caused by the
fact that tcLookupImported didn't return a MaybeErr.
Now it does.  That finishes up Trac #8004.

5 years agoIgnore Tickish Breakpoints when serialising Core into interface files
Simon Peyton Jones [Fri, 20 Sep 2013 13:46:13 +0000 (14:46 +0100)] 
Ignore Tickish Breakpoints when serialising Core into interface files

This fixes Trac #8333

Thanks to 'klao', who identified the cause and provided the patch

5 years agoComments only
Jan Stolarek [Thu, 19 Sep 2013 10:48:00 +0000 (11:48 +0100)] 
Comments only

5 years agoUpdate release notes for new comparison primops
Jan Stolarek [Thu, 19 Sep 2013 09:50:10 +0000 (10:50 +0100)] 
Update release notes for new comparison primops

5 years agoDocument -floopification flag in user guide
Jan Stolarek [Thu, 19 Sep 2013 09:40:08 +0000 (10:40 +0100)] 
Document -floopification flag in user guide

5 years agoRemove trailing whitespaces in flags.xml
Jan Stolarek [Thu, 19 Sep 2013 09:39:32 +0000 (10:39 +0100)] 
Remove trailing whitespaces in flags.xml

5 years agoFix egregious blunder in extractRelevantInerts
Simon Peyton Jones [Wed, 18 Sep 2013 15:20:28 +0000 (16:20 +0100)] 
Fix egregious blunder in extractRelevantInerts

5 years agoMake Word# a wired-in TyCon (fix Trac #8280)
Simon Peyton Jones [Wed, 18 Sep 2013 11:37:33 +0000 (12:37 +0100)] 
Make Word# a wired-in TyCon (fix Trac #8280)

wordTyCon was treated as wired-in, but
  * It didn't have a WiredInName
  * It didn't appear in the list of wiredInTyCons

I'm not sure how anything worked!

5 years agoComments only
Simon Peyton Jones [Wed, 18 Sep 2013 11:22:44 +0000 (12:22 +0100)] 
Comments only

5 years agoRestore old names of comparison primops
Jan Stolarek [Mon, 16 Sep 2013 14:04:57 +0000 (15:04 +0100)] 
Restore old names of comparison primops

In 6579a6c we removed existing comparison primops and introduced new ones
returning Int# instead of Bool. This commit (and associated commits in
array, base, dph, ghc-prim, integer-gmp, integer-simple, primitive, testsuite and
template-haskell) restores old names of primops. This allows us to keep
our API cleaner at the price of not having backwards compatibility.

This patch also temporalily disables fix for #8317 (optimization of
tagToEnum# at Core level). We need to fix #8326 first, otherwise
our primops code will be very slow.

5 years agoTrailing whitespaces
Jan Stolarek [Tue, 17 Sep 2013 07:55:35 +0000 (08:55 +0100)] 
Trailing whitespaces

5 years agoTidy up and refactor overflow checking for literals
Simon Peyton Jones [Tue, 17 Sep 2013 23:27:19 +0000 (00:27 +0100)] 
Tidy up and refactor overflow checking for literals

It's much easier (and more efficient) to pattern match on
the HsOverLit than on the desugared version!

5 years agoOptimise (case tagToEnum# x of ..) as in Trac #8317
Simon Peyton Jones [Tue, 17 Sep 2013 21:02:27 +0000 (22:02 +0100)] 
Optimise (case tagToEnum# x of ..) as in Trac #8317

See Note [Optimising tagToEnum#] in Simplify

5 years agoAccommodate Derived constraints in two places (fix Trac #8129, #8134)
Simon Peyton Jones [Tue, 17 Sep 2013 19:55:14 +0000 (20:55 +0100)] 
Accommodate Derived constraints in two places (fix Trac #8129, #8134)

If we have
   class (F a ~ b) => C a b
then we can produce *derived* CFunEqCans.  These were not being
treated properly in two places:

a) in TcMType.zonkFlats (Trac #8134)
b) in TcSMonad.prepareInertsForImplications (Trac #8129)

This patch fixes both.

5 years agoA little refactoring
Simon Peyton Jones [Tue, 17 Sep 2013 19:47:21 +0000 (20:47 +0100)] 
A little refactoring

* Make isCFunEqCan_maybe return Maybe (TyCon, [Type])
* Add insertTM, deleteTM to TrieMap

5 years agoAdd flag to control loopification
Jan Stolarek [Wed, 18 Sep 2013 08:25:56 +0000 (09:25 +0100)] 
Add flag to control loopification

It is off by default, which is meant to be a workaround for #8275.
Once #8275 is fixed we will enable this option by default.

5 years agoTweaks to release notes
Gabor Greif [Wed, 18 Sep 2013 08:31:29 +0000 (10:31 +0200)] 
Tweaks to release notes
If someone also feels that credits should better go into the
release announcement, just nuke the last line of that paragraph.

5 years agoImplement checkable "minimal complete definitions" (#7633)
Twan van Laarhoven [Wed, 11 Sep 2013 13:32:33 +0000 (15:32 +0200)] 
Implement checkable "minimal complete definitions" (#7633)

This commit adds a `{-# MINIMAL #-}` pragma, which defines the possible
minimal complete definitions for a class. The body of the pragma is a
boolean formula of names.

The old warning for missing methods is replaced with this new one.

Note: The interface file format is changed to store the minimal complete

Authored-by: Twan van Laarhoven <>
Signed-off-by: Herbert Valerio Riedel <>
5 years agoLimit upper versions of Alex and Happy
Jan Stolarek [Wed, 18 Sep 2013 07:47:58 +0000 (08:47 +0100)] 
Limit upper versions of Alex and Happy

This is temporary until new bool primops have been pushed.

5 years agoFix-up Docbook XML broken in f4046b508a5a7
Herbert Valerio Riedel [Wed, 18 Sep 2013 06:54:45 +0000 (08:54 +0200)] 
Fix-up Docbook XML broken in f4046b508a5a7

5 years agoSuppress unused variable when OS does not support setuid.
Edward Z. Yang [Wed, 18 Sep 2013 02:59:17 +0000 (19:59 -0700)] 
Suppress unused variable when OS does not support setuid.

Signed-off-by: Edward Z. Yang <>
5 years agoChange role annotation syntax.
Richard Eisenberg [Wed, 11 Sep 2013 04:52:56 +0000 (00:52 -0400)] 
Change role annotation syntax.

This fixes bugs #8185, #8234, and #8246. The new syntax is explained
in the comments to #8185, appears in the "Roles" subsection of the
manual, and on the [wiki:Roles] wiki page.

This change also removes the ability for a role annotation on type
synonyms, as noted in #8234.

5 years agoRelease Notes: New printf features in base
Joachim Breitner [Tue, 17 Sep 2013 08:56:42 +0000 (10:56 +0200)] 
Release Notes: New printf features in base

5 years agoAllow branches with / in them (e.g. wip/) in ./sync-all
Joachim Breitner [Tue, 17 Sep 2013 13:45:48 +0000 (15:45 +0200)] 
Allow branches with / in them (e.g. wip/) in ./sync-all

5 years agoAdd warning comment about Mach-O section name hack.
Edward Z. Yang [Tue, 17 Sep 2013 07:55:46 +0000 (00:55 -0700)] 
Add warning comment about Mach-O section name hack.

Signed-off-by: Edward Z. Yang <>
5 years agoImplement ctors support for Linux.
Edward Z. Yang [Tue, 17 Sep 2013 00:17:35 +0000 (17:17 -0700)] 
Implement ctors support for Linux.

Signed-off-by: Edward Z. Yang <>
5 years agoFurther linguistic improvement of that one line
Joachim Breitner [Mon, 16 Sep 2013 16:09:36 +0000 (18:09 +0200)] 
Further linguistic improvement of that one line

now brought to you by Gabor Greif... ;-)

5 years agoTypo in release notes
Joachim Breitner [Mon, 16 Sep 2013 15:48:10 +0000 (17:48 +0200)] 
Typo in release notes

5 years agos/TypeNats/DataKinds/ in release notes.
Austin Seipp [Mon, 16 Sep 2013 15:45:32 +0000 (10:45 -0500)] 
s/TypeNats/DataKinds/ in release notes.

Signed-off-by: Austin Seipp <>
5 years agoMake sure type literals aren't negative (#8306)
Austin Seipp [Mon, 16 Sep 2013 15:05:44 +0000 (10:05 -0500)] 
Make sure type literals aren't negative (#8306)

As Krzysztof pointed out in #8306, with NegativeLiterals and DataKinds,
definitions such as:

  type T = -1

were accepted, although type literals must be greater than zero.

Signed-off-by: Austin Seipp <>
5 years agoRelease Notes: Document Data.Bool.bool (#8302)
Joachim Breitner [Mon, 16 Sep 2013 15:34:35 +0000 (17:34 +0200)] 
Release Notes: Document Data.Bool.bool (#8302)

6 years agoComment typo only
Gabor Greif [Mon, 16 Sep 2013 10:09:37 +0000 (12:09 +0200)] 
Comment typo only