ghc.git
8 years agoMore CPP removal: pprDynamicLinkerAsmLabel in CLabel
Ian Lynagh [Sun, 2 Oct 2011 00:31:05 +0000 (01:31 +0100)] 
More CPP removal: pprDynamicLinkerAsmLabel in CLabel

And some knock-on changes

8 years agoSome CPP removal
Ian Lynagh [Sun, 2 Oct 2011 00:03:23 +0000 (01:03 +0100)] 
Some CPP removal

8 years agoFix bindist finding gcc on OS X; fixes trac #5397
Ian Lynagh [Sat, 1 Oct 2011 20:00:27 +0000 (21:00 +0100)] 
Fix bindist finding gcc on OS X; fixes trac #5397

$TargetOS_CPP wasn't getting defined in a bindist, which meant the
code to use gcc-4.2 instead of gcc on OS X wasn't working. Now fixed,
by moving some of configure.ac's code into the shared aclocal.m4.

8 years agoHandle newtypes and type functions correctly in FFI types; fixes #3008
Ian Lynagh [Fri, 30 Sep 2011 20:57:53 +0000 (21:57 +0100)] 
Handle newtypes and type functions correctly in FFI types; fixes #3008

You can now use type functions in FFI types.

Newtypes are now only looked through if the constructor is in scope.

8 years agowhitespace only in prelude/PrimOp.lhs
Ian Lynagh [Thu, 29 Sep 2011 23:32:47 +0000 (00:32 +0100)] 
whitespace only in prelude/PrimOp.lhs

8 years agoWhitespace only in TcRnMonad.lhs
Ian Lynagh [Wed, 28 Sep 2011 19:45:24 +0000 (20:45 +0100)] 
Whitespace only in TcRnMonad.lhs

8 years agoFix parenthesisation in conversion from TH.Exp to HsExpr.HsExpr
Simon Peyton Jones [Thu, 29 Sep 2011 15:57:16 +0000 (16:57 +0100)] 
Fix parenthesisation in conversion from TH.Exp to HsExpr.HsExpr

We need to generate enough parens so that -ddump-splices is
correct Haskell.  There is certainly further to go.

8 years agoTidy up the shape-checking for instance types
Simon Peyton Jones [Thu, 29 Sep 2011 15:47:57 +0000 (16:47 +0100)] 
Tidy up the shape-checking for instance types
(in instance and standalone deriving decls)

Fixes Trac #5513.

8 years agoGive a better error message for unterminated quasiquotations (fixes #5204).
Geoffrey Mainland [Thu, 29 Sep 2011 11:31:49 +0000 (12:31 +0100)] 
Give a better error message for unterminated quasiquotations (fixes #5204).

8 years agoEliminate alleged optimisation that means we bogusly did NoGen
Simon Peyton Jones [Thu, 29 Sep 2011 15:06:17 +0000 (16:06 +0100)] 
Eliminate alleged optimisation that means we bogusly did NoGen

Fixes Trac #5514.  The fix is simply to delete some code.

8 years agoA tiny bit more debug info
Simon Peyton Jones [Thu, 29 Sep 2011 15:05:31 +0000 (16:05 +0100)] 
A tiny bit more debug info

8 years agoFix scoping for RHS of associated type decls (fixes Trac #5515)
Simon Peyton Jones [Thu, 29 Sep 2011 15:05:16 +0000 (16:05 +0100)] 
Fix scoping for RHS of associated type decls (fixes Trac #5515)

We should not allow things like

class C a b where
  type F a :: *

instance C (p,q) r where
  type F (p,q) = r   -- No! fvs(rhs) should be a subset
                     --     of fvs(lhs)

8 years agoMake Outputable.quotes do what the comments say
Simon Peyton Jones [Thu, 29 Sep 2011 08:45:42 +0000 (09:45 +0100)] 
Make Outputable.quotes do what the comments say

Outputable.quotes claimed to drop the quotes if the enclosed thing has
a trailing single quote; but its implementation checked for
a *leading* quote.

Fixes Trac #5509

8 years agoDocument :kind! in GHCi
Simon Peyton Jones [Thu, 29 Sep 2011 08:43:04 +0000 (09:43 +0100)] 
Document :kind! in GHCi

8 years agoDocument -fsimpl-tick-count
Simon Peyton Jones [Thu, 29 Sep 2011 08:42:53 +0000 (09:42 +0100)] 
Document -fsimpl-tick-count

8 years agoFix warnings in ghci/ByteCodeLink.lhs
Ian Lynagh [Tue, 27 Sep 2011 20:59:06 +0000 (21:59 +0100)] 
Fix warnings in ghci/ByteCodeLink.lhs

8 years agoWhitespace only in ghci/ByteCodeLink.lhs
Ian Lynagh [Tue, 27 Sep 2011 20:46:00 +0000 (21:46 +0100)] 
Whitespace only in ghci/ByteCodeLink.lhs

8 years agoFix warnings in coreSyn/CoreUtils.lhs
Ian Lynagh [Tue, 27 Sep 2011 20:44:51 +0000 (21:44 +0100)] 
Fix warnings in coreSyn/CoreUtils.lhs

8 years agoWhitespace only in coreSyn/CoreUtils.lhs
Ian Lynagh [Tue, 27 Sep 2011 20:13:53 +0000 (21:13 +0100)] 
Whitespace only in coreSyn/CoreUtils.lhs

8 years agoReenable a couple of assertions
Ian Lynagh [Tue, 27 Sep 2011 20:07:24 +0000 (21:07 +0100)] 
Reenable a couple of assertions

The comment explaining why they were disabled seemed to be out-of-date.
It claimed we need to be able to write (intToWord# 0xffff0000#) whereas
we can just write 0xffff0000##.

Validate goes through with
    GhcStage1HcOpts   += -O0 -DDEBUG
    GhcStage2HcOpts   += -O0 -DDEBUG

8 years agoUpdate docs: n+k is now disabled by default
Ian Lynagh [Mon, 26 Sep 2011 22:55:07 +0000 (23:55 +0100)] 
Update docs: n+k is now disabled by default

8 years agoDocument TraditionalRecordSyntax
Ian Lynagh [Mon, 26 Sep 2011 22:54:08 +0000 (23:54 +0100)] 
Document TraditionalRecordSyntax

8 years agoDefine a TraditionalRecordSyntax extension; fixes #3356
Ian Lynagh [Mon, 26 Sep 2011 22:32:04 +0000 (23:32 +0100)] 
Define a TraditionalRecordSyntax extension; fixes #3356

This allows the extension (which is on by default) to be turned off,
which gets us a small step closer to replacing Haskell98 records with
something better.

8 years agoWhitespace only in parser/RdrHsSyn.lhs
Ian Lynagh [Mon, 26 Sep 2011 18:04:25 +0000 (19:04 +0100)] 
Whitespace only in parser/RdrHsSyn.lhs

8 years agoWhitespace only in deSugar/DsForeign.lhs
Ian Lynagh [Sun, 25 Sep 2011 18:33:17 +0000 (19:33 +0100)] 
Whitespace only in deSugar/DsForeign.lhs

8 years agoChange the way IfExtName is serialized so (most) wired-in names get special represent...
Max Bolingbroke [Sat, 10 Sep 2011 09:16:38 +0000 (10:16 +0100)] 
Change the way IfExtName is serialized so (most) wired-in names get special representation

This lets IfaceType be dumber, with fewer special cases, because deserialization for more
wired-in names will work. Once we have polymorphic kinds we will be able to replace IfaceTyCon
with a simple IfExtName.

8 years agoKind check associated type synonym defaults earlier to avoid <<loop>> in some situations
Max Bolingbroke [Mon, 26 Sep 2011 08:31:44 +0000 (09:31 +0100)] 
Kind check associated type synonym defaults earlier to avoid <<loop>> in some situations

8 years agoUpdate to time 1.4
Ian Lynagh [Sun, 25 Sep 2011 13:22:07 +0000 (14:22 +0100)] 
Update to time 1.4

8 years agoAdd a comment to CorePrep that it does the Integer conversion
Ian Lynagh [Sun, 25 Sep 2011 13:17:54 +0000 (14:17 +0100)] 
Add a comment to CorePrep that it does the Integer conversion

8 years agoAdd some more Integer rules
Ian Lynagh [Sat, 24 Sep 2011 20:35:06 +0000 (21:35 +0100)] 
Add some more Integer rules

Also renumbered the IDs and alined some things properly

8 years agoMake a new type synonym CoreProgram = [CoreBind]
Simon Peyton Jones [Fri, 23 Sep 2011 08:57:42 +0000 (09:57 +0100)] 
Make a new type synonym CoreProgram = [CoreBind]
and comment its invariants in Note [CoreProgram] in CoreSyn

I'm not totally convinced that CoreProgram is the right name
(perhaps CoreTopBinds might better), but it is useful to have
a clue that you are looking at the top-level bindings.

This is only a matter of a type synonym change; no deep
refactoring here.

8 years agoImplement GHCi command :kind! which normalises its type
Simon Peyton Jones [Fri, 23 Sep 2011 06:45:20 +0000 (07:45 +0100)] 
Implement GHCi command :kind! which normalises its type

   type family F a
   type instance F Int = Bool
   type instance F Bool = Char

In GHCi
   *TF> :kind (F Int, F Bool)
   (F Int, F Bool) :: *
   *TF> :kind! F Int
   (F Int, F Bool) :: *
   = (Bool, Char)

We could call it ":normalise" but it seemed quite nice to have an
eager version of :kind

8 years agoMove tcLookupFamInst, tcLookupDataFamInst from TcEnv to FamInst
Simon Peyton Jones [Fri, 23 Sep 2011 05:59:52 +0000 (06:59 +0100)] 
Move tcLookupFamInst, tcLookupDataFamInst from TcEnv to FamInst

This is just a refactoring

8 years agoA little refactoring of TcIface on LitInteger
Simon Peyton Jones [Fri, 23 Sep 2011 05:49:41 +0000 (06:49 +0100)] 
A little refactoring of TcIface on LitInteger

8 years agoComments and functions renaming only
Simon Peyton Jones [Fri, 23 Sep 2011 05:47:03 +0000 (06:47 +0100)] 
Comments and functions renaming only

8 years agoAdd a transformation limit to the simplifier (Trac #5448)
Simon Peyton Jones [Fri, 23 Sep 2011 05:46:30 +0000 (06:46 +0100)] 
Add a transformation limit to the simplifier (Trac #5448)

This addresses the rare cases where the simplifier diverges
(see the above ticket).  We were already counting how many simplifier
steps were taking place, but with no limit.  This patch adds a limit;
at which point we halt compilation, and print out useful stats. The
stats show what is begin inlined, and how often, which points you
directly to the problem.  The limit is set based on the size of the
program.

Instead of halting compilation, we could instead just inhibit
inlining, which would let compilation of the module complete. This is
a bit harder to implement, and it's likely to mean that you unrolled
the function 1143 times and then ran out of ticks; you probably don't
want to complete parsing on this highly-unrolled program.

Flags: -dsimpl-tick-factor=N.  Default is 100 (percent).
       A bigger number increases the allowed maximum tick count.

8 years agoTake account of the mk_integer in a LitInteger when computing CAF-hood
Simon Peyton Jones [Fri, 23 Sep 2011 05:13:30 +0000 (06:13 +0100)] 
Take account of the mk_integer in a LitInteger when computing CAF-hood

This is a follow-on to Ian's Integer-literal patch.
In effect the mk_integer Id is a free variable of a LitInteger literal.

I've also added some comments (Note [Integer literals]) in Literal.

8 years agoadd a ToDo
Simon Marlow [Wed, 21 Sep 2011 08:51:25 +0000 (09:51 +0100)] 
add a ToDo

8 years agoshow bindings in the order they were defined
Simon Marlow [Wed, 21 Sep 2011 08:51:13 +0000 (09:51 +0100)] 
show bindings in the order they were defined

8 years agofix warnings
Simon Marlow [Wed, 21 Sep 2011 08:50:48 +0000 (09:50 +0100)] 
fix warnings

8 years agomove AvailInfo and related things into its own module
Simon Marlow [Sat, 17 Sep 2011 18:05:43 +0000 (19:05 +0100)] 
move AvailInfo and related things into its own module

8 years agofix bug in :show bindings when a variable is bound to an exception
Simon Marlow [Sat, 17 Sep 2011 12:06:36 +0000 (13:06 +0100)] 
fix bug in :show bindings when a variable is bound to an exception

8 years agoAdd support for all top-level declarations to GHCi
Simon Marlow [Fri, 16 Sep 2011 12:40:53 +0000 (13:40 +0100)] 
Add support for all top-level declarations to GHCi

  This is work mostly done by Daniel Winograd-Cort during his
  internship at MSR Cambridge, with some further refactoring by me.

This commit adds support to GHCi for most top-level declarations that
can be used in Haskell source files.  Class, data, newtype, type,
instance are all supported, as are Type Family-related declarations.

The current set of declarations are shown by :show bindings.  As with
variable bindings, entities bound by newer declarations shadow earlier
ones.

Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054.
Documentation to follow.

8 years agoIn :load, call GHC.guessTarget on the new targets before unloading
Simon Marlow [Tue, 13 Sep 2011 09:33:41 +0000 (10:33 +0100)] 
In :load, call GHC.guessTarget on the new targets before unloading

Fixes this problem:

Prelude> :l foo
target `foo' is not a module name or a source file
>

8 years agoParenthesise type operators in -ddump-minimal-imports output; trac #4239
Ian Lynagh [Sat, 17 Sep 2011 21:32:11 +0000 (22:32 +0100)] 
Parenthesise type operators in -ddump-minimal-imports output; trac #4239

8 years agoWhitespace only in hsSyn/HsImpExp.lhs
Ian Lynagh [Sat, 17 Sep 2011 21:11:39 +0000 (22:11 +0100)] 
Whitespace only in hsSyn/HsImpExp.lhs

8 years agoImprove the handling of Integer literals
Ian Lynagh [Sat, 17 Sep 2011 17:29:12 +0000 (18:29 +0100)] 
Improve the handling of Integer literals

LitInteger now carries around the id of mkInteger, which it uses
to construct the core to build Integer literals. This way we don't
have to build in info about lots of Ids.

We also no longer have any special-casing for integer-simple, so
there is less code involved.

8 years agoFix etags output; trac #4256
Ian Lynagh [Sat, 17 Sep 2011 12:10:58 +0000 (13:10 +0100)] 
Fix etags output; trac #4256

We had an off-by-one bug in column numbers, causing first characters
of identifiers to be duplicated.

8 years agoGentoo's scanelf program found executable stack in many resulting binaries:
Sergei Trofimovich [Sat, 17 Sep 2011 10:29:44 +0000 (11:29 +0100)] 
Gentoo's scanelf program found executable stack in many resulting binaries:
* RWX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/ghc
* !WX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/libHSrts.a:AdjustorAsm.o

More info can be found here: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
8 years agoFix typo
Ian Lynagh [Fri, 16 Sep 2011 16:06:31 +0000 (17:06 +0100)] 
Fix typo

8 years agoAdd some missing dependencies; should fix make after re-configure
Simon Marlow [Tue, 13 Sep 2011 12:49:15 +0000 (13:49 +0100)] 
Add some missing dependencies; should fix make after re-configure

Every Haskell compilation in a package should depend on the
package-data.mk file for that package.  Then, if a package's version
number is bumped, we will recompile all the modules in the package so
that their interface files get the new version number.

This should mean that a simple 'make' will succeed in a couple of
scenarios where it didn't before:

  1. re-configuring bumps the version number of GHC, so everything
     in the ghc package (stages 1 & 2) must be recompiled.

  2. bumping the version of one of the boot packages does not require
     a make clean any more.

I have tested (1) but not (2).

LAX_DEPENDENCIES=YES disabled these new dependencies too.

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 16 Sep 2011 10:34:05 +0000 (11:34 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoCorrect a back-to-front coercion (fixes Trac #5490)
Simon Peyton Jones [Fri, 16 Sep 2011 08:59:37 +0000 (09:59 +0100)] 
Correct a back-to-front coercion (fixes Trac #5490)

This bug has been present for ages, but it only shows up in view
patterns where coercions are also involved.  Easy to fix!

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Ian Lynagh [Thu, 15 Sep 2011 13:45:37 +0000 (14:45 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoHack: add noCafIdInfo to shiftIntegerL and friends
Simon Peyton Jones [Thu, 15 Sep 2011 08:11:18 +0000 (09:11 +0100)] 
Hack: add noCafIdInfo to shiftIntegerL and friends

It's a hack becuase we have no good reason to be sure that
these functions don't have any CAFs.  We're working on
something better, but this should fix the build (Trac #5485)

8 years agoLLVM pre-mangler files should be considered cish
David Terei [Thu, 15 Sep 2011 01:37:03 +0000 (18:37 -0700)] 
LLVM pre-mangler files should be considered cish

8 years agoTighten up the side-condition testing for deriving (again)
Simon Peyton Jones [Wed, 14 Sep 2011 14:28:25 +0000 (15:28 +0100)] 
Tighten up the side-condition testing for deriving (again)

Fixes Trac #5478

8 years agoFix integer stuff (fixes Trac #5485)
Simon Peyton Jones [Wed, 14 Sep 2011 11:03:17 +0000 (12:03 +0100)] 
Fix integer stuff (fixes Trac #5485)

In particular, use mkConApp when building the (S# i)
constructors in CorePrep

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 14 Sep 2011 08:38:27 +0000 (09:38 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoRemove some (probably bit-rotted) .NET cases
Ian Lynagh [Tue, 13 Sep 2011 21:18:00 +0000 (22:18 +0100)] 
Remove some (probably bit-rotted) .NET cases

8 years agoRemove an old "ToDo" comment
Ian Lynagh [Tue, 13 Sep 2011 18:47:28 +0000 (19:47 +0100)] 
Remove an old "ToDo" comment

8 years agochange how Integer's are handled in Core
Ian Lynagh [Mon, 12 Sep 2011 22:24:53 +0000 (23:24 +0100)] 
change how Integer's are handled in Core

We now treat them as literals until CorePrep, when we finally
convert them into the real Core representation. This makes it a lot
simpler to implement built-in rules on them.

8 years agoGHC does build with Alex 3 now - remove the configure trap
Simon Marlow [Tue, 13 Sep 2011 09:59:59 +0000 (10:59 +0100)] 
GHC does build with Alex 3 now - remove the configure trap

However, one perf test fails (parsing001) due to extra allocation.  I
want to look into this so I'm not bumping it just yet.

8 years agoWhen checking FFI types are IO, don't look through abstract newtypes; #3008
Ian Lynagh [Sun, 11 Sep 2011 19:53:18 +0000 (20:53 +0100)] 
When checking FFI types are IO, don't look through abstract newtypes; #3008

8 years agoFix associated type default instantiation check (#5481)
Max Bolingbroke [Sun, 11 Sep 2011 16:09:31 +0000 (17:09 +0100)] 
Fix associated type default instantiation check (#5481)

8 years agoFix warnings in codeGen/CgUtils.hs
Ian Lynagh [Fri, 9 Sep 2011 00:49:54 +0000 (01:49 +0100)] 
Fix warnings in codeGen/CgUtils.hs

8 years agoWhitespace only in codeGen/CgUtils.hs
Ian Lynagh [Thu, 8 Sep 2011 23:02:04 +0000 (00:02 +0100)] 
Whitespace only in codeGen/CgUtils.hs

8 years agoFix warnings in basicTypes/Literal.lhs
Ian Lynagh [Thu, 8 Sep 2011 22:11:37 +0000 (23:11 +0100)] 
Fix warnings in basicTypes/Literal.lhs

8 years agoWhitespace only in basicTypes/Literal.lhs
Ian Lynagh [Thu, 8 Sep 2011 21:59:21 +0000 (22:59 +0100)] 
Whitespace only in basicTypes/Literal.lhs

8 years agoSolve irreducible evidence from itself
Max Bolingbroke [Sat, 10 Sep 2011 13:31:08 +0000 (14:31 +0100)] 
Solve irreducible evidence from itself

8 years agoAdapt vectoriser to disappearing PredTy
Manuel M T Chakravarty [Sat, 10 Sep 2011 07:53:30 +0000 (17:53 +1000)] 
Adapt vectoriser to disappearing PredTy

8 years agoReport bindings that cannot be vectorised
Manuel M T Chakravarty [Sat, 10 Sep 2011 06:55:21 +0000 (16:55 +1000)] 
Report bindings that cannot be vectorised

- Toplevel bindings that cannot be vectorised are reported as a warning
- '-ddump-vt-trace' has even more information about unvectorised code
- Fixed some documentation

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 15:57:10 +0000 (16:57 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoMerge branch 'no-pred-ty'
Max Bolingbroke [Fri, 9 Sep 2011 12:45:41 +0000 (13:45 +0100)] 
Merge branch 'no-pred-ty'

Conflicts:
compiler/iface/BuildTyCl.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/Class.lhs
compiler/utils/Util.lhs

8 years agoMove exprIsConApp_maybe to CoreSubst so we can use it in VSO. Fix VSO bug with unlift...
Max Bolingbroke [Fri, 9 Sep 2011 12:31:43 +0000 (13:31 +0100)] 
Move exprIsConApp_maybe to CoreSubst so we can use it in VSO. Fix VSO bug with unlifted let bindings.

8 years agoRecord selectors should be Exported Ids
Simon Peyton Jones [Fri, 9 Sep 2011 11:50:07 +0000 (12:50 +0100)] 
Record selectors should be Exported Ids

We don't want to drop record selectors as dead code, even if they
aren't exported in the module header.  The data type decl in the
inteface file advertises their presenece, and we may get at them via
Template Haskell.

   module M( f ) where
     data T = MkT { boo :: Int }
     f :: T -> T
     f = <blah>

We don't want to drop the record selector for 'boo'.

See Trac #4946

8 years agoComments, and rename FactTuple to ConstraintTuple
Simon Peyton Jones [Fri, 9 Sep 2011 09:54:32 +0000 (10:54 +0100)] 
Comments, and rename FactTuple to ConstraintTuple

8 years agoRefactoring and code moving-around, following Max's AT-default patch
Simon Peyton Jones [Fri, 9 Sep 2011 09:52:13 +0000 (10:52 +0100)] 
Refactoring and code moving-around, following Max's AT-default patch

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 09:18:02 +0000 (10:18 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 09:07:46 +0000 (10:07 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoObey the exprArity invariants! Fixes Trac #5441
Simon Peyton Jones [Fri, 9 Sep 2011 09:04:55 +0000 (10:04 +0100)] 
Obey the exprArity invariants!  Fixes Trac #5441

We were giving arity 2 to a function whose type was
    Int -> Any
That contradicts the exprArity invariant
(see Note [exprArity invariant] in CoreArity), and
in turn led to function whose actually code-generated arity
was different that advertised in the interface file.
Result: seg-fault city.

8 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 9 Sep 2011 08:12:48 +0000 (09:12 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

8 years agoDocumentation for associated type instance defaults
Max Bolingbroke [Tue, 6 Sep 2011 14:14:06 +0000 (15:14 +0100)] 
Documentation for associated type instance defaults

8 years agoImplement associated type defaults
Max Bolingbroke [Tue, 6 Sep 2011 08:04:37 +0000 (09:04 +0100)] 
Implement associated type defaults

Basically, now you can write:

  class Cls a where
    type Typ a
    type Typ a = Just a

And now if an instance does not specify an explicit associated type
instance, one will be generated afresh based on that default. So for
example this instance:

  instance Cls Int where

Will be equivalent to this one:

  instance Cls Int where
    type Typ Int = Just Int

8 years agoRevert "Get rid of associated-type default declarations"
Max Bolingbroke [Sun, 4 Sep 2011 18:09:01 +0000 (19:09 +0100)] 
Revert "Get rid of associated-type default declarations"

This reverts commit 5e102e64d6e581e3ea1f290547fc4be6fce20a00.

8 years agoAdd deepseq as a core package; part of #5468
Ian Lynagh [Thu, 8 Sep 2011 11:09:42 +0000 (12:09 +0100)] 
Add deepseq as a core package; part of #5468

8 years agoAdd deepseq as a core package
Ian Lynagh [Wed, 7 Sep 2011 18:49:24 +0000 (19:49 +0100)] 
Add deepseq as a core package

8 years agoFix typos in comments
Ian Lynagh [Tue, 6 Sep 2011 22:12:56 +0000 (23:12 +0100)] 
Fix typos in comments

8 years agoCorrect a few typos
Daniel Fischer [Wed, 7 Sep 2011 22:48:18 +0000 (00:48 +0200)] 
Correct a few typos

8 years agoAdded repack command to sync-all
Daniel Fischer [Wed, 7 Sep 2011 17:56:59 +0000 (19:56 +0200)] 
Added repack command to sync-all

8 years agoWhitespace only
Daniel Fischer [Wed, 7 Sep 2011 17:52:00 +0000 (19:52 +0200)] 
Whitespace only

8 years agoNuke isCertainlyPredReprTy
Simon Peyton Jones [Wed, 7 Sep 2011 16:44:52 +0000 (17:44 +0100)] 
Nuke isCertainlyPredReprTy

8 years agoComments and layout
Simon Peyton Jones [Wed, 7 Sep 2011 16:44:35 +0000 (17:44 +0100)] 
Comments and layout

8 years agoAdd Constraint as a legitmiate tycon in Kinds
Simon Peyton Jones [Wed, 7 Sep 2011 15:23:00 +0000 (16:23 +0100)] 
Add Constraint as a legitmiate tycon in Kinds

8 years agoConstraintKind -> ConstraintKinds
Simon Peyton Jones [Wed, 7 Sep 2011 15:22:46 +0000 (16:22 +0100)] 
ConstraintKind -> ConstraintKinds

8 years agoMinor refactoring of dsLCoercion, plus comments
Simon Peyton Jones [Wed, 7 Sep 2011 15:19:22 +0000 (16:19 +0100)] 
Minor refactoring of dsLCoercion, plus comments

8 years agoRemove dead code
Simon Peyton Jones [Wed, 7 Sep 2011 08:33:21 +0000 (09:33 +0100)] 
Remove dead code

8 years agoWibble in tickyDynAlloc (only affects -ticky)
Simon Peyton Jones [Wed, 7 Sep 2011 08:33:08 +0000 (09:33 +0100)] 
Wibble in tickyDynAlloc (only affects -ticky)

Fall-out from codegen refactoring, undiscovered because
we don't usually build with -ticky

8 years agoImplement -XConstraintKind
Max Bolingbroke [Tue, 6 Sep 2011 16:22:47 +0000 (17:22 +0100)] 
Implement -XConstraintKind

Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
this patch adds a new kind Constraint such that:

  Show :: * -> Constraint
  (?x::Int) :: Constraint
  (Int ~ a) :: Constraint

And you can write *any* type with kind Constraint to the left of (=>):
even if that type is a type synonym, type variable, indexed type or so on.

The following (somewhat related) changes are also made:
 1. We now box equality evidence. This is required because we want
    to give (Int ~ a) the *lifted* kind Constraint
 2. For similar reasons, implicit parameters can now only be of
    a lifted kind. (?x::Int#) => ty is now ruled out
 3. Implicit parameter constraints are now allowed in superclasses
    and instance contexts (this just falls out as OK with the new
    constraint solver)

Internally the following major changes were made:
 1. There is now no PredTy in the Type data type. Instead
    GHC checks the kind of a type to figure out if it is a predicate
 2. There is now no AClass TyThing: we represent classes as TyThings
    just as a ATyCon (classes had TyCons anyway)
 3. What used to be (~) is now pretty-printed as (~#). The box
    constructor EqBox :: (a ~# b) -> (a ~ b)
 4. The type LCoercion is used internally in the constraint solver
    and type checker to represent coercions with free variables
    of type (a ~ b) rather than (a ~# b)

8 years agoMake an import unconditional
Ian Lynagh [Tue, 6 Sep 2011 16:25:01 +0000 (17:25 +0100)] 
Make an import unconditional

Fixes build on non-Intel/PPC platforms