pgj-freebsd-amd64-stable (amd64 FreeBSD STABLE), build 755, Success

2012-12-06 Thread Builder
pgj-freebsd-amd64-stable (amd64 FreeBSD STABLE), build 755

Build succeeded
Details: 
http://darcs.haskell.org/ghcBuilder/builders/pgj-freebsd-amd64-stable/755.html

git clone| Success
create mk/build.mk   | Success
get subrepos | Success
repo versions| Success
touching clean-check files   | Success
setting version date | Success
booting  | Success
configuring  | Success
creating check-remove-before | Success
compiling| Success
creating check-remove-after  | Success
compiling testremove | Success
simulating clean | Success
checking clean   | Success
making bindist   | Success
publishing bindist   | Success
testing bindist  | Success
testing  | Success
testsuite summary| Success

Build succeeded
Details: 
http://darcs.haskell.org/ghcBuilder/builders/pgj-freebsd-amd64-stable/755.html

File not deleted:compiler/ghc.cabal.old
File not deleted:inplace
File not deleted:libraries/base/include/EventConfig.h
Deleted before file: libraries/time/include/HsTimeConfig.h
File not deleted:mk/config.mk.old
File not deleted:mk/project.mk.old
File not deleted:rts/libs.depend
File not deleted:rts/package.conf.inplace
File not deleted:rts/package.conf.inplace.raw

OVERALL SUMMARY for test run started at Thu Dec  6 07:46:59 UTC 2012
3402 total tests, which gave rise to
   14436 test cases, of which
  10 caused framework failures
   11363 were skipped

2961 expected passes
  48 had missing libraries
  35 expected failures
   0 unexpected passes
  29 unexpected failures

Unexpected failures:
   ../../libraries/directory/tests  getPermissions001 [bad exit code] 
(normal)
   ../../libraries/process/testsprocess007 [bad stdout] (normal)
   ../../libraries/unix/tests/libposix  posix005 [bad stdout] (normal)
   driver   dynHelloWorld [bad exit code] (dyn)
   driver/recomp011 recomp011 [bad stdout] (normal)
   dynlibs  T3807 [bad exit code] (normal)
   dynlibs  T5373 [bad stdout] (normal)
   ghci/scripts T5979 [bad stderr] (ghci)
   perf/compilerT6048 [stat not good enough] (optasm)
   perf/haddock haddock.Cabal [stat not good enough] 
(normal)
   perf/haddock haddock.base [stat not good enough] 
(normal)
   perf/haddock haddock.compiler [stat not good enough] 
(normal)
   plugins  plugins01 [bad exit code] (normal)
   plugins  plugins02 [stderr mismatch] (normal)
   plugins  plugins03 [stderr mismatch] (normal)
   rts  T2615 [bad stdout] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly01 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly02 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly03 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly04 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly05 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly06 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly07 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly08 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly09 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly10 [exit code non-0] (normal)
   safeHaskell/check/pkg01  safePkg01 [bad exit code] (normal)
   typecheck/should_failT5300 [stderr mismatch] (normal)
   typecheck/should_failT5691 [stderr mismatch] (normal)

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: GHC 7.6 failes to build

2012-12-06 Thread Simon Peyton-Jones
| The HEAD version of DPH might work with ghc-7.6 right now, but we don't
| expect it to in the future.

Indeed. That's entirely reasonable. I started off building the ghc-7.6 branch 
by saying
sync-all checkout ghc-7.6
to get compatible compilers and libraries.  But for
dph
vector
random
there *is* no ghc-7.6 branch, so I had to use master.

So the question (for Ben, Manuel) is this: which branch of DPH should one use 
with ghc-7.6?  Maybe the answer is none, in which case we can be careful
  a) to ignore DPH when testing the ghc-7.6 branch
  b) to tell users that they should not attempt to use DPH with ghc 7.6

Is that the idea? Or is there a version that should work? 

For vector and random the same questions apply, but since we simply have 
lagging git repos for them we can create a ghc-7.6 branch.  Did you 
deliberately not do that, Ian?

Simon


| -Original Message-
| From: Ben Lippmeier [mailto:b...@ouroborus.net]
| Sent: 06 December 2012 02:06
| To: Ian Lynagh
| Cc: cvs-ghc@haskell.org list; Simon Peyton-Jones; Manuel M T Chakravarty
| Subject: Re: GHC 7.6 failes to build
| 
| 
| On 06/12/2012, at 5:19 AM, Ian Lynagh wrote:
| 
|  On Wed, Dec 05, 2012 at 05:49:03PM +, Simon Peyton-Jones wrote:
| 
|  validate from scratch on Linux on the 7.6 branch fails thus in dph.
|  My validate.mk is htis
| 
|  I will move dph out of the way for now, but what's wrong?
| 
|  Hmm, we don't build DPH in the 7.6 branch by default, and I recently
|  bumped HEAD's base version and updated DPH to match. For some reason
|  all the DPH deps are of the form x.y.*, which means 7.6's base doesn't
|  satisfy the dependency.
| 
|  Ben, Manuel, is there a reason the dependencies are in that form? Is
|  the HEAD DPH supposed to work with the GHC 7.6 branch?
| 
| No. The DPH libraries for a particular GHC branch are only expected to
| work with that branch. The DPH libraries are tied to a particular
| version of GHC, because they depend so much on properties of the
| vectoriser.
| 
| I've been using a dependency on the base package as a proxy for the GHC
| version number. If you bump the base package version then you'll need to
| make a ghc-7.6 branch for DPH, like you've been doing for the other
| libraries.
| 
| The HEAD version of DPH might work with ghc-7.6 right now, but we don't
| expect it to in the future.
| 
| Is that ok?
| 
| Ben.


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: The end of an era, and the dawn of a new one

2012-12-06 Thread Simon Peyton-Jones
(Narrowing to cvs-ghc for now.)

Speaking for myself, I would welcome a code-ownership model along the lines 
that Ben suggests. If it works well it would
  a) spread the load
  b) broaden a genuine sense of ownership
  c) because of (a) and (b), perhaps encourage more people to participate

What do others think?

Simon

| -Original Message-
| From: Ben Lippmeier [mailto:b...@ouroborus.net]
| Sent: 06 December 2012 10:57
| To: Simon Peyton-Jones
| Cc: haskell; glasgow-haskell-us...@haskell.org; Haskell Cafe (haskell-
| c...@haskell.org); Simon Marlow
| Subject: Re: The end of an era, and the dawn of a new one
| 
| 
| On 06/12/2012, at 3:56 , Simon Peyton-Jones wrote:
| 
|  Particularly valuable are offers to take responsibility for a
|  particular area (eg the LLVM code generator, or the FFI).  I'm hoping
|  that this sea change will prove to be quite empowering, with GHC
|  becoming more and more a community project, more resilient with fewer
|  single points of failure.
| 
| The LLVM project has recently come to the same point. The codebase has
| become too large for Chris Lattner to keep track of it all, so they've
| moved to a formal Code Ownership model. People own particular
| directories of the code base, and the code owners are expected to review
| patches for those directories.
| 
| The GHC project doesn't have a formal patch review process, I think
| because the people with commit access on d.h.o generally know who owns
| what. Up until last week I think it was SPJ owns the type checker and
| simplifier, and SM owns everything else. :-)
| 
| 
| At this stage, I think it would help if we followed the LLVM approach of
| having a formal CODE_OWNERS file in the root path of the repo explicitly
| listing the code owners. That way GHC HQ knows what's covered and what
| still needs a maintainer. The LLVM version is here [1].
| 
| Code owners would:
| 1) Be the go-to person when other developers have questions about that
| code.
| 2) Fix bugs in it that no-one else has claimed.
| 3) Generally keep the code tidy, documented and well-maintained.
| 
| Simon: do you want a CODE_OWNERS file? If so then I can start it. I
| think it's better to have it directly in the repo than on the wiki, that
| way no-one that works on the code can miss it.
| 
| I suppose I'm the default owner of the register allocators and non-LLVM
| native code generators.
| 
| Ben.
| 
| [1] http://llvm.org/viewvc/llvm-
| project/llvm/trunk/CODE_OWNERS.TXT?view=markup
| 
| 


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: GHC 7.6 failes to build

2012-12-06 Thread Ben Lippmeier

On 06/12/2012, at 23:19 , Simon Peyton-Jones wrote:

 | The HEAD version of DPH might work with ghc-7.6 right now, but we don't
 | expect it to in the future.
 
 there *is* no ghc-7.6 branch, so I had to use master.

I think there should be a ghc-7.6 branch for DPH.


 So the question (for Ben, Manuel) is this: which branch of DPH should one use 
 with ghc-7.6?  Maybe the answer is none, in which case we can be careful
  a) to ignore DPH when testing the ghc-7.6 branch
  b) to tell users that they should not attempt to use DPH with ghc 7.6
 
 Is that the idea? Or is there a version that should work? 

I think Ian should branch DPH along with the other libraries as part of the 
release process. From then on I'll test it with the current GHC version and 
ship it via Hackage as I've been doing. Ian doesn't have to wait for me once 
the branch has been made.


 For vector and random the same questions apply, but since we simply have 
 lagging git repos for them we can create a ghc-7.6 branch.  Did you 
 deliberately not do that, Ian?

I expect Ian didn't branch DPH because it's not his job to test it with the GHC 
RC and ship it as part of the GHC source tarball. I can do the release part, 
but if Ian branches DPH as well then it is effectively zero-overhead to his 
existing workflow, and we won't hit this breakage again (I think?).

Ian: let us know if you have a better idea for it.

Ben.


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: GHC 7.6 failes to build

2012-12-06 Thread Simon Peyton-Jones
OK.  Will you (Ben) create the ghc-7.6 branch?  In future I guess Ian can do so 
when he forks.

Simon

| -Original Message-
| From: Ben Lippmeier [mailto:b...@ouroborus.net]
| Sent: 06 December 2012 12:41
| To: Simon Peyton-Jones
| Cc: Ian Lynagh; cvs-ghc@haskell.org list; Manuel M T Chakravarty
| Subject: Re: GHC 7.6 failes to build
| 
| 
| On 06/12/2012, at 23:19 , Simon Peyton-Jones wrote:
| 
|  | The HEAD version of DPH might work with ghc-7.6 right now, but we
|  | don't expect it to in the future.
| 
|  there *is* no ghc-7.6 branch, so I had to use master.
| 
| I think there should be a ghc-7.6 branch for DPH.
| 
| 
|  So the question (for Ben, Manuel) is this: which branch of DPH should
|  one use with ghc-7.6?  Maybe the answer is none, in which case we
|  can be careful
|   a) to ignore DPH when testing the ghc-7.6 branch
|   b) to tell users that they should not attempt to use DPH with ghc 7.6
| 
|  Is that the idea? Or is there a version that should work?
| 
| I think Ian should branch DPH along with the other libraries as part of
| the release process. From then on I'll test it with the current GHC
| version and ship it via Hackage as I've been doing. Ian doesn't have to
| wait for me once the branch has been made.
| 
| 
|  For vector and random the same questions apply, but since we simply
| have lagging git repos for them we can create a ghc-7.6 branch.  Did you
| deliberately not do that, Ian?
| 
| I expect Ian didn't branch DPH because it's not his job to test it with
| the GHC RC and ship it as part of the GHC source tarball. I can do the
| release part, but if Ian branches DPH as well then it is effectively
| zero-overhead to his existing workflow, and we won't hit this breakage
| again (I think?).
| 
| Ian: let us know if you have a better idea for it.
| 
| Ben.


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


HEAD can't find stg_gc_ut

2012-12-06 Thread Simon Peyton-Jones
Simon, Ian, anyone

I'm getting this on today's  HEAD:

~/5builds/HEAD/inplace/bin/ghc-stage2 --make T7445.hs -package syb
[1 of 2] Compiling T7445a   ( T7445a.hs, T7445a.o )
[2 of 2] Compiling T7445( T7445.hs, T7445.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package syb-0.3.7 ... linking ... ghc-stage2: 
/home/simonpj/.cabal/lib/syb-0.3.7/ghc-7.7/HSsyb-0.3.7.o: unknown symbol 
`stg_gc_ut'
ghc-stage2: unable to load package `syb-0.3.7'
simonpj@cam-05-unx:~/tmp$

Indeed, that symbol is generated in StgCmmHeap (line 631). But it doesn't seem 
to be defined anywhere in the RTS.  Things like stg_gc_pp are defined in 
Linker.c

Any ideas?

Simon
___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: Computing the final representation type of a TyCon (Was: Unpack primitive types by default in data)

2012-12-06 Thread Simon Peyton-Jones
Johan

Yes broadly that looks like the right kind of thing.

I think it'd be better to look more like can_unbox. So first check for a 
product tycon (ie one data constructor), then deal with newtypes, and *then* do 
something different, namely check whether the (single) data con has zero or one 
fields, and recurse.

Since it's all flag-controlled you could push and I can subsequently edit

Simoin


| -Original Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-
| users-boun...@haskell.org] On Behalf Of Johan Tibell
| Sent: 29 November 2012 18:13
| To: glasgow-haskell-users
| Subject: Re: Computing the final representation type of a TyCon (Was:
| Unpack primitive types by default in data)
| 
| Hi,
| 
| I've created an initial implementation that seems to work. I'd
| appreciate it if someone could review the code (it's short!) to tell me
| if it's sane, can be improved, etc:
| 
| https://github.com/tibbe/ghc/commit/6b44024173eae3029b7b43f7cc9fc7d9d801
| c367
| 
| On Thu, Nov 29, 2012 at 12:27 AM, Johan Tibell johan.tib...@gmail.com
| wrote:
|  I've decided to try to implement the proposal included in the end of
|  this message. To do so I need to write a function
| 
|  hasPointerSizedRepr :: TyCon - Bool
| 
|  This function would check that that the TyCon is either
| 
|   * a newtype, which representation type has a pointer-sized
|  representation, or
|   * an algebraic data type, with one field that has a pointer-sized
|  representation.
| 
|  I'm kinda lost in all the data types that GHC defines to represent
|  types. I've gotten no further than
| 
|  hasPointerSizedRepr :: TyCon - Bool
|  hasPointerSizedRepr tc@(AlgTyCon {}) = case algTcRhs tc of
|   DataTyCon{ data_cons =
| [data_con] }
|   - ...
|   NewTyCon { data_con =
| [data_con] }
|   - ...
|   _   - False
|  hasPointerSizedRepr _= False
| 
|  I could use some pointers (no pun intended!) at this point. The
|  function ought to return True for all the following types:
| 
|  data A = A Int#
|  newtype B = B A
|  data C = C !B
|  data D = D !C
|  data E = E !()
|  data F = F !D
| 
|  One part that confuses me is figuring out the representation type of a
|  data constructor after unpacking. For example, the function should not
|  return true if called on G in this example:
| 
|  data G = G !H
|  data H = H {-# UNPACK #-} !I
|  data I = I !Int !Int
| 
|  because if we unpacked H into G's constructor it would take up two
|  words, due to I being unpacked.
| 
|  Does DataCon contain the unpacked representation of the data
|  constructor or only the before-optimizations representation?
| 
| ___
| Glasgow-haskell-users mailing list
| glasgow-haskell-us...@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: HEAD can't find stg_gc_ut

2012-12-06 Thread Simon Marlow
It looks like you have an old syb package installed in your .cabal/lib, 
getting rid of that should fix it.


Cheers,
Simon

On 06/12/12 13:53, Simon Peyton-Jones wrote:

Simon, Ian, anyone

I’m getting this on today’s  HEAD:

~/5builds/HEAD/inplace/bin/ghc-stage2 --make T7445.hs -package syb

[1 of 2] Compiling T7445a   ( T7445a.hs, T7445a.o )

[2 of 2] Compiling T7445( T7445.hs, T7445.o )

Loading package ghc-prim ... linking ... done.

Loading package integer-gmp ... linking ... done.

Loading package base ... linking ... done.

Loading package syb-0.3.7 ... linking ... ghc-stage2:
/home/simonpj/.cabal/lib/syb-0.3.7/ghc-7.7/HSsyb-*0.3.7.o: unknown
symbol `stg_gc_ut'*

ghc-stage2: unable to load package `syb-0.3.7'

simonpj@cam-05-unx:~/tmp$

Indeed, that symbol is generated in StgCmmHeap (line 631). But it
doesn’t seem to be defined anywhere in the RTS.  Things like stg_gc_pp
are defined in Linker.c

Any ideas?

Simon




___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: The end of an era, and the dawn of a new one

2012-12-06 Thread Johan Tibell
On Dec 6, 2012 4:39 AM, Simon Peyton-Jones simo...@microsoft.com wrote:

 (Narrowing to cvs-ghc for now.)

 Speaking for myself, I would welcome a code-ownership model along the
lines that Ben suggests. If it works well it would
   a) spread the load
   b) broaden a genuine sense of ownership
   c) because of (a) and (b), perhaps encourage more people to participate

 What do others think?

Sounds like a good idea.
___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: HEAD can't find stg_gc_ut

2012-12-06 Thread Simon Peyton-Jones
OK SimonM helped me past this.  Just for your info

* The code generator does not actually mention stg_gc_ut; that
  is in commented-out code.

* TH was loading HSsyb-0.3.7.o, which was an old .o file created back in 
  August.  I'd just installed syb, but cabal had created libHSsyb-0.3.7.a.
  Sadly TH ignored the new .a and took the old .o.

Solution: delete the out of date .o file.

Simon

| -Original Message-
| From: Simon Marlow [mailto:marlo...@gmail.com]
| Sent: 06 December 2012 14:41
| To: Simon Peyton-Jones
| Cc: cvs-ghc@haskell.org
| Subject: Re: HEAD can't find stg_gc_ut
| 
| It looks like you have an old syb package installed in your .cabal/lib,
| getting rid of that should fix it.
| 
| Cheers,
|   Simon
| 
| On 06/12/12 13:53, Simon Peyton-Jones wrote:
|  Simon, Ian, anyone
| 
|  I'm getting this on today's  HEAD:
| 
|  ~/5builds/HEAD/inplace/bin/ghc-stage2 --make T7445.hs -package syb
| 
|  [1 of 2] Compiling T7445a   ( T7445a.hs, T7445a.o )
| 
|  [2 of 2] Compiling T7445( T7445.hs, T7445.o )
| 
|  Loading package ghc-prim ... linking ... done.
| 
|  Loading package integer-gmp ... linking ... done.
| 
|  Loading package base ... linking ... done.
| 
|  Loading package syb-0.3.7 ... linking ... ghc-stage2:
|  /home/simonpj/.cabal/lib/syb-0.3.7/ghc-7.7/HSsyb-*0.3.7.o: unknown
|  symbol `stg_gc_ut'*
| 
|  ghc-stage2: unable to load package `syb-0.3.7'
| 
|  simonpj@cam-05-unx:~/tmp$
| 
|  Indeed, that symbol is generated in StgCmmHeap (line 631). But it
|  doesn't seem to be defined anywhere in the RTS.  Things like stg_gc_pp
|  are defined in Linker.c
| 
|  Any ideas?
| 
|  Simon
| 


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: HEAD can't find stg_gc_ut

2012-12-06 Thread Simon Marlow
One thing you can do to make this less likely to happen is to make sure 
the build system can see your .git directory, then it will give your 
build a dated version like 7.7.20121206 instead of just 7.7.  Then any 
packages you install won't clash with older ones.  Or alternatively use 
cabal-dev to install packages in a sandbox.


Cheers,
Simon

On 06/12/12 15:17, Simon Peyton-Jones wrote:

OK SimonM helped me past this.  Just for your info

* The code generator does not actually mention stg_gc_ut; that
   is in commented-out code.

* TH was loading HSsyb-0.3.7.o, which was an old .o file created back in
   August.  I'd just installed syb, but cabal had created libHSsyb-0.3.7.a.
   Sadly TH ignored the new .a and took the old .o.

Solution: delete the out of date .o file.

Simon

| -Original Message-
| From: Simon Marlow [mailto:marlo...@gmail.com]
| Sent: 06 December 2012 14:41
| To: Simon Peyton-Jones
| Cc: cvs-ghc@haskell.org
| Subject: Re: HEAD can't find stg_gc_ut
|
| It looks like you have an old syb package installed in your .cabal/lib,
| getting rid of that should fix it.
|
| Cheers,
|   Simon
|
| On 06/12/12 13:53, Simon Peyton-Jones wrote:
|  Simon, Ian, anyone
| 
|  I'm getting this on today's  HEAD:
| 
|  ~/5builds/HEAD/inplace/bin/ghc-stage2 --make T7445.hs -package syb
| 
|  [1 of 2] Compiling T7445a   ( T7445a.hs, T7445a.o )
| 
|  [2 of 2] Compiling T7445( T7445.hs, T7445.o )
| 
|  Loading package ghc-prim ... linking ... done.
| 
|  Loading package integer-gmp ... linking ... done.
| 
|  Loading package base ... linking ... done.
| 
|  Loading package syb-0.3.7 ... linking ... ghc-stage2:
|  /home/simonpj/.cabal/lib/syb-0.3.7/ghc-7.7/HSsyb-*0.3.7.o: unknown
|  symbol `stg_gc_ut'*
| 
|  ghc-stage2: unable to load package `syb-0.3.7'
| 
|  simonpj@cam-05-unx:~/tmp$
| 
|  Indeed, that symbol is generated in StgCmmHeap (line 631). But it
|  doesn't seem to be defined anywhere in the RTS.  Things like stg_gc_pp
|  are defined in Linker.c
| 
|  Any ideas?
| 
|  Simon
| 




___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Stop attempting to trim data types in interface files (9a20e54)

2012-12-06 Thread Simon Peyton Jones
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/9a20e540754fc2af74c2e7392f2786a81d8d5f11

---

commit 9a20e540754fc2af74c2e7392f2786a81d8d5f11
Author: Simon Peyton Jones simo...@microsoft.com
Date:   Thu Dec 6 16:03:16 2012 +

Stop attempting to trim data types in interface files

Without -O, we previously tried to make interface files smaller
by not including the data constructors of data types.  But
there are a lot of exceptions, notably when Template Haskell is
involved or, more recently, DataKinds.

However Trac #7445 shows that even without TemplateHaskell, using
the Data class and invoking Language.Haskell.TH.Quote.dataToExpQ
is enough to require us to expose the data constructors.

So I've given up on this optimisation -- it's probably not
important anyway.  Now I'm simply not attempting to trim off
the data constructors.  The gain in simplicity is worth the
modest cost in interface file growth, which is limited to the
bits reqd to describe those data constructors.

 compiler/main/TidyPgm.lhs |  207 -
 1 files changed, 109 insertions(+), 98 deletions(-)


Diff suppressed because of size. To see it, use:

git show 9a20e540754fc2af74c2e7392f2786a81d8d5f11

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: The end of an era, and the dawn of a new one

2012-12-06 Thread Simon Marlow

On 06/12/12 15:08, Johan Tibell wrote:

On Dec 6, 2012 4:39 AM, Simon Peyton-Jones simo...@microsoft.com
mailto:simo...@microsoft.com wrote:
 
  (Narrowing to cvs-ghc for now.)
 
  Speaking for myself, I would welcome a code-ownership model along the
lines that Ben suggests. If it works well it would
a) spread the load
b) broaden a genuine sense of ownership
c) because of (a) and (b), perhaps encourage more people to participate
 
  What do others think?

Sounds like a good idea.


Yes, I think it's a great idea.  I'm happy to be listed as the owner for 
my bits for the time being, until/unless others are able to take over.


Cheers,
Simon


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: [commit: ghc] master: Stop attempting to trim data types in interface files (9a20e54)

2012-12-06 Thread Simon Marlow

On 06/12/12 16:03, Simon Peyton Jones wrote:

Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/9a20e540754fc2af74c2e7392f2786a81d8d5f11


---


commit 9a20e540754fc2af74c2e7392f2786a81d8d5f11
Author: Simon Peyton Jones simo...@microsoft.com
Date:   Thu Dec 6 16:03:16 2012 +

 Stop attempting to trim data types in interface files

 Without -O, we previously tried to make interface files smaller
 by not including the data constructors of data types.  But
 there are a lot of exceptions, notably when Template Haskell is
 involved or, more recently, DataKinds.

 However Trac #7445 shows that even without TemplateHaskell, using
 the Data class and invoking Language.Haskell.TH.Quote.dataToExpQ
 is enough to require us to expose the data constructors.

 So I've given up on this optimisation -- it's probably not
 important anyway.  Now I'm simply not attempting to trim off
 the data constructors.  The gain in simplicity is worth the
 modest cost in interface file growth, which is limited to the
 bits reqd to describe those data constructors.


That's a shame - it wasn't so much a reduction in interface file size we 
gained by doing this, but less recompilation.  Oh well...


Cheers,
Simon



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: The end of an era, and the dawn of a new one

2012-12-06 Thread Ian Lynagh
On Thu, Dec 06, 2012 at 12:32:05PM +, Simon Peyton-Jones wrote:
 (Narrowing to cvs-ghc for now.)
 
 Speaking for myself, I would welcome a code-ownership model along the lines 
 that Ben suggests. If it works well it would
   a) spread the load
   b) broaden a genuine sense of ownership
   c) because of (a) and (b), perhaps encourage more people to participate
 
 What do others think?

owner is a very strong word: I think other projects have had problems
where e.g. owners have found themselves without time to deal with
patches submitted, but have been unwilling to let anyone else touch
their code.

Perhaps we could have maintainers instead?


We actually already have something similar to this proposal here:
http://hackage.haskell.org/trac/ghc/wiki/Contributors
although it's quite out-of-date, mostly because people tend to fade away
rather than have a definite date on which they stop maintaining
something.


Thanks
Ian


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Remove some tabs the commit hook is complaining about (7b68eb7)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/7b68eb7d761fbf288e74f2fe300bf132cb6bfb97

---

commit 7b68eb7d761fbf288e74f2fe300bf132cb6bfb97
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Oct 4 15:08:44 2012 +0100

Remove some tabs the commit hook is complaining about

---

 compiler/supercompile/Supercompile/Drive/Split2.hs |3 +++
 compiler/typecheck/TcInstDcls.lhs  |6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Split2.hs 
b/compiler/supercompile/Supercompile/Drive/Split2.hs
index 3af1f52..51b412e 100644
--- a/compiler/supercompile/Supercompile/Drive/Split2.hs
+++ b/compiler/supercompile/Supercompile/Drive/Split2.hs
@@ -208,6 +208,9 @@ data Context = HeapContext Var
  | FocusContext
  deriving (Eq, Ord)
 
+instance Show Context where
+show = showPpr
+
 instance Outputable Context where
 pprPrec prec (HeapContext x') = pprPrec prec x'
 pprPrec prec (StackContext i) = pprPrec prec i
diff --git a/compiler/typecheck/TcInstDcls.lhs 
b/compiler/typecheck/TcInstDcls.lhs
index 2106da1..4bb8b6b 100644
--- a/compiler/typecheck/TcInstDcls.lhs
+++ b/compiler/typecheck/TcInstDcls.lhs
@@ -511,7 +511,7 @@ cyclicDeclErr :: Outputable d = [Located d] - TcRn ()
 cyclicDeclErr inst_decls
   = setSrcSpan (getLoc (head sorted_decls)) $
 addErr (sep [ptext (sLit Cycle in type declarations: data constructor 
used (in a type) before it is defined),
-nest 2 (vcat (map ppr_decl sorted_decls))])
+ nest 2 (vcat (map ppr_decl sorted_decls))])
   where
 sorted_decls = sortLocated inst_decls
 ppr_decl (L loc decl) = ppr loc  colon + ppr decl
@@ -585,8 +585,8 @@ tcLocalInstDecl (L loc (ClsInstD { cid_poly_ty = poly_ty, 
cid_binds = binds
 -- Dfun location is that of instance *header*
 
 ; overlap_flag - getOverlapFlag
-; let dfun = mkDictFunId dfun_name tyvars theta clas inst_tys
-  ispec= mkLocalInstance dfun overlap_flag
+; let dfun  = mkDictFunId dfun_name tyvars theta clas inst_tys
+  ispec = mkLocalInstance dfun overlap_flag
   inst_info = InstInfo { iSpec  = ispec, iBinds = VanillaInst 
binds uprags False }
 
 ; return ( [inst_info], fam_insts0 ++ concat fam_insts1) }



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix MSG not preserving global-idness (ea23213)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/ea232136c947a1d68da35809ea62a2d3074e48e4

---

commit ea232136c947a1d68da35809ea62a2d3074e48e4
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Oct 4 16:30:16 2012 +0100

Fix MSG not preserving global-idness

---

 compiler/supercompile/Supercompile.hs   |1 -
 compiler/supercompile/Supercompile/Drive/MSG.hs |   20 ++--
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs 
b/compiler/supercompile/Supercompile.hs
index 5f59e69..5e52e96 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -147,7 +147,6 @@ mkLiftedTupleSelector xs want_x tup_e
 termUnfoldings :: S.Term - [(Var, S.Term)]
 termUnfoldings e = go (S.termFreeVars e) emptyVarSet [] []
   where
--- FIXME: varBndrFreeVars?
 go new_fvs all_fvs all_xwhy_nots all_xes
   | isEmptyVarSet added_fvs = pprTrace termUnfoldings (vcat [hang (text 
why_not  text :) 2 (vcat (map ppr xs)) | (why_not, xs) - groups snd fst 
all_xwhy_nots]) $
   all_xes
diff --git a/compiler/supercompile/Supercompile/Drive/MSG.hs 
b/compiler/supercompile/Supercompile/Drive/MSG.hs
index 3736fc0..a702cc0 100644
--- a/compiler/supercompile/Supercompile/Drive/MSG.hs
+++ b/compiler/supercompile/Supercompile/Drive/MSG.hs
@@ -23,8 +23,8 @@ import Util
 import Coercion
 import CoreUtils  (hashCoercion, hashType {- , hashExpr -})
 import Name   (mkSystemVarName)
-import Var(TyVar, mkTyVar, isTyVar, isId, varType, setVarType, 
tyVarKind, setTyVarKind, varName, idDetails, setIdDetails, idInfo, 
lazySetIdInfo)
-import Id (Id, idType, idName, realIdUnfolding, setIdUnfolding, 
idSpecialisation, setIdSpecialisation, mkSysLocal, mkLocalId)
+import Var(TyVar, mkTyVar, isTyVar, isId, varType, setVarType, 
tyVarKind, setTyVarKind, varName, idDetails, setIdDetails, idInfo, 
lazySetIdInfo, varUnique)
+import Id (Id, idType, idName, realIdUnfolding, setIdUnfolding, 
idSpecialisation, setIdSpecialisation, mkSysLocal, mkLocalId, isGlobalId)
 import IdInfo (SpecInfo(..))
 import VarEnv
 import Pair
@@ -235,14 +235,14 @@ msgPend rn2 x0 pending = MSG $ \e s0 - case 
lookupUpdatePending s0 of
 Right x   - (s0, pure x)
 Left (mb_eq, binderise, mk_s) - case res of (_,  Left msg) - (s0, Left 
msg)
  (s3, Right x)  - (s3, Right 
x)  -- NB: must revert state or else x_looped will be in the msgKnownVars, and 
pulling on it will fail the irrefutible pattern match
-  where -- The use of s here is necessary to ensure we only allocate a 
given common var once
-extra_iss | Just eq - mb_eq
-  , eq `elemInScopeSet` msgCommonHeapVars (msgMode e)
-  = emptyInScopeSet
-  | otherwise
-  = msgInScopeSet s0
--- This use of rn2 is 1/2 of the story necessary to ensure new 
common vars don't clash with rigid binders
-x1 = uniqAway (rnInScopeSet rn2 `unionInScope` extra_iss) x0
+  where x1 = case mb_eq of
+   Just eq | eq `elemInScopeSet` msgCommonHeapVars (msgMode e) 
|| isGlobalId eq
+   -- The incoming x0 is always a local variable, but we 
better make a damn sure that we return a global variable if necessary
+   -- TODO: maybe all global ids should be in the initial 
InScopeSet? Would need to change prepareTerm.
+   - eq
+   -- This use of rn2 is 1/2 of the story necessary to ensure 
new common vars don't clash with rigid binders
+   -- The use of s here is necessary to ensure we only 
allocate a given common var once
+   _   - uniqAway (rnInScopeSet rn2 `unionInScope` 
msgInScopeSet s0) x0
 -- We *don't* need to uniqAway with the set of common variables 
(in e) because the msgInScopeSet
 -- was initialized to contain them all.
 



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Checkpoint speculator work (8fa49be)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/8fa49be1a3195e1b5e9a1babd5158202cf25580c

---

commit 8fa49be1a3195e1b5e9a1babd5158202cf25580c
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 5 08:53:13 2012 +0100

Checkpoint speculator work

 .../supercompile/Supercompile/Drive/Process.hs |  113 +---
 .../supercompile/Supercompile/Drive/Process3.hs|2 +-
 compiler/supercompile/Supercompile/Utilities.hs|   31 --
 3 files changed, 119 insertions(+), 27 deletions(-)


Diff suppressed because of size. To see it, use:

git show 8fa49be1a3195e1b5e9a1babd5158202cf25580c

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Add comments only (fac9686)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/fac968604ccd4e0595136c120fb2ad1ba5905af0

---

commit fac968604ccd4e0595136c120fb2ad1ba5905af0
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 5 12:00:48 2012 +0100

Add comments only

---

 .../supercompile/Supercompile/Drive/Process.hs |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process.hs 
b/compiler/supercompile/Supercompile/Drive/Process.hs
index cbbe6b6..0a73a22 100644
--- a/compiler/supercompile/Supercompile/Drive/Process.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process.hs
@@ -638,6 +638,11 @@ type SpecRB = SpecHistory - SpecM (SpecHistory, Deeds, 
Heap)
 type Depth = Train (SpecRB, Var) (SpecRB, Var)
 newtype SpecHistory = SH { unSH :: LinearHistory (State, Depth) }
 
+-- FIXME: AlreadySpeculated should be renamed when we generalise since heap 
bindings may change name
+
+-- NB: we can't use the domain of the heap incoming to the previous reduce 
call as the AlreadySpeculated
+-- set because normalisation may have caused some unspeculated bindings to 
enter the heap since the last speculate
+-- (e.g. consider splitting into the branch of a case where the branch has 
some top level lets)
 speculateHeap :: AlreadySpeculated - (SCStats, Deeds, Heap) - 
(AlreadySpeculated, (SCStats, Deeds, Heap))
 speculateHeap speculated (stats, deeds, heap@(Heap h _)) = {-# SCC speculate 
#-} (M.keysSet h', (mempty, deeds', heap'))
   where



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Checkpoint possible new speculator implementation that goes to some trouble to be idempotent (6a48bdd)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6a48bdd3ec9c6162010172f163151f122be44b45

---

commit 6a48bdd3ec9c6162010172f163151f122be44b45
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Tue Oct 9 18:39:14 2012 +0100

Checkpoint possible new speculator implementation that goes to some trouble 
to be idempotent

 .../supercompile/Supercompile/Drive/Process.hs |   92 ++--
 compiler/supercompile/Supercompile/Utilities.hs|   17 +++-
 2 files changed, 101 insertions(+), 8 deletions(-)


Diff suppressed because of size. To see it, use:

git show 6a48bdd3ec9c6162010172f163151f122be44b45

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: FIx stupid bug with summary given to GHC heuristics (0a2664c)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/0a2664ce044b22c3a12800da2a50299b0e3f6c35

---

commit 0a2664ce044b22c3a12800da2a50299b0e3f6c35
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Oct 18 20:58:23 2012 +0100

FIx stupid bug with summary given to GHC heuristics

---

 .../Supercompile/Evaluator/Evaluate.hs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs 
b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
index e6b044b..c182c5b 100644
--- a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
+++ b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
@@ -363,7 +363,7 @@ step' normalising ei_state = {-# SCC step' #-}
 --
 -- Perhaps if we had deep normalisation + GC we could get these 
results by penalising heap allocation heavily?
 -- If so we must remember to do it for heap bindings *and* letrecs.
-let k_summary = summariseContext h k
+let k_summary = summariseContext h (Car kf k)
 guard $ case () of
   _ -- If the lambda is marked SUPERINLINABLE, always inline it
 | super



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Horrible patches to make memocache preinit work (b99c6ae)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/b99c6ae21dc46543c0c4db29aff2260dd368bbfe

---

commit b99c6ae21dc46543c0c4db29aff2260dd368bbfe
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Oct 18 20:59:09 2012 +0100

Horrible patches to make memocache preinit work

 .../supercompile/Supercompile/Drive/Process.hs |   82 +++
 compiler/supercompile/Supercompile/StaticFlags.hs  |4 +-
 2 files changed, 67 insertions(+), 19 deletions(-)


Diff suppressed because of size. To see it, use:

git show b99c6ae21dc46543c0c4db29aff2260dd368bbfe

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Idempotent speculator (9d99feb)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/9d99febef391d3c43d481d5efb9290821dab6c80

---

commit 9d99febef391d3c43d481d5efb9290821dab6c80
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Oct 18 20:58:57 2012 +0100

Idempotent speculator

 .../supercompile/Supercompile/Drive/Process.hs |   68 
 .../Supercompile/Termination/TagBag.hs |5 +-
 2 files changed, 44 insertions(+), 29 deletions(-)


Diff suppressed because of size. To see it, use:

git show 9d99febef391d3c43d481d5efb9290821dab6c80

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Disable instance matching by default (9cf9598)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/9cf959869c26a561e88fb9f791b61d2fed66933f

---

commit 9cf959869c26a561e88fb9f791b61d2fed66933f
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 10:44:25 2012 +0100

Disable instance matching by default

---

 compiler/supercompile/Supercompile/StaticFlags.hs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/StaticFlags.hs 
b/compiler/supercompile/Supercompile/StaticFlags.hs
index 1244224..a583acd 100644
--- a/compiler/supercompile/Supercompile/StaticFlags.hs
+++ b/compiler/supercompile/Supercompile/StaticFlags.hs
@@ -25,7 +25,7 @@ data InstanceMatching = NoInstances | InstancesOfGeneralised 
| AllInstances
 -- of MSG-based generalisation+rollback, and has the potential to lose more 
useful optimisation than that combo does.
 -- Matching back to generalised stuff is still a good idea, but we need to 
propagate generalised flags more agressively (FIXME)
 iNSTANCE_MATCHING :: InstanceMatching
-iNSTANCE_MATCHING = parseEnum -fsupercompiler-instance-matching 
InstancesOfGeneralised [(full, AllInstances), (generalised, 
InstancesOfGeneralised), (none, NoInstances)]
+iNSTANCE_MATCHING = parseEnum -fsupercompiler-instance-matching NoInstances 
[(full, AllInstances), (generalised, InstancesOfGeneralised), (none, 
NoInstances)]
 
 -- This is not remotely safe:
 fLOAT_TO_MATCH :: Bool



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Do memocache preinit even when using let-bindings (7936e48)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/7936e4879e73957ea96cc639db9897d7899cf70b

---

commit 7936e4879e73957ea96cc639db9897d7899cf70b
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 12:05:29 2012 +0100

Do memocache preinit even when using let-bindings

 .../supercompile/Supercompile/Drive/Process.hs |   21 ++-
 .../supercompile/Supercompile/Drive/Process1.hs|2 +-
 .../supercompile/Supercompile/Drive/Process2.hs|2 +-
 .../supercompile/Supercompile/Drive/Process3.hs|   12 ++
 compiler/supercompile/Supercompile/StaticFlags.hs  |4 +++
 5 files changed, 28 insertions(+), 13 deletions(-)


Diff suppressed because of size. To see it, use:

git show 7936e4879e73957ea96cc639db9897d7899cf70b

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Don't pull on prepareTerm result unless needed (f89af0c)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/f89af0cc364255f77fb0ab9f2109ee54821be850

---

commit f89af0cc364255f77fb0ab9f2109ee54821be850
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 10:45:35 2012 +0100

Don't pull on prepareTerm result unless needed

---

 .../supercompile/Supercompile/Drive/Process3.hs|   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index 19e6532..a335986 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -756,10 +756,12 @@ reduceForMatch state | rEDUCE_BEFORE_MATCH = {- second gc 
$ -} reduceWithFlag (c
 
 supercompile :: M.Map Var Term - Term - Term
 supercompile unfoldings e = fVedTermToTerm $ start (liftM snd . sc)
-  where (bvs_unfoldings, (to_bind, state), (preinit_with, preinit_state)) = 
prepareTerm unfoldings e
-start k | pREINITALIZE_MEMO_TABLE = run $ preinitalise preinit_with  
withScpEnv (\e - e { scpAlreadySpeculated = bvs_unfoldings `S.union` 
scpAlreadySpeculated e }) (k preinit_state)
-| otherwise   = bindManyMixedLiftedness 
fvedTermFreeVars to_bind $ run $ k state
-run = runScpM (tagAnnotations state)
+  where (bvs_unfoldings, no_preinit, preinit) = prepareTerm unfoldings e
+(to_bind, state)  = no_preinit -- Delay forcing these to 
suppress
+(preinit_with, preinit_state) = preinit-- prepareTerm debug prints
+start k | pREINITALIZE_MEMO_TABLE = run preinit_state $ preinitalise 
preinit_with  withScpEnv (\e - e { scpAlreadySpeculated = bvs_unfoldings 
`S.union` scpAlreadySpeculated e }) (k preinit_state)
+| otherwise   = bindManyMixedLiftedness 
fvedTermFreeVars to_bind $ run state $ k state
+run tags_state = runScpM (tagAnnotations tags_state)
 
 preinitalise :: [(State, FVedTerm)] - ScpM ()
 preinitalise states_fulfils = forM_ states_fulfils $ \(state, e') - do



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix critical bug where FVs of generalised stack tails would not be sucked (64667ed)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/64667edfaf92756b0a9a2c65a688accfb99d8bdd

---

commit 64667edfaf92756b0a9a2c65a688accfb99d8bdd
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 12:23:41 2012 +0100

Fix critical bug where FVs of generalised stack tails would not be sucked

---

 compiler/supercompile/Supercompile/Drive/MSG.hs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/MSG.hs 
b/compiler/supercompile/Supercompile/Drive/MSG.hs
index a702cc0..935d48f 100644
--- a/compiler/supercompile/Supercompile/Drive/MSG.hs
+++ b/compiler/supercompile/Supercompile/Drive/MSG.hs
@@ -1152,7 +1152,7 @@ initStack xs i (Car kf_l k_l) (Car kf_r k_r) = do
   _ - return (xs, Nothing, Nothing)
 let suck = initSuckStackFrame i mb_x kf_l kf_r
 liftM (\(mxs, k_lrs, sucks) - (maybe id (:) mb_mx mxs, liftA2 (\kf_lr 
(k_avail_lr, k_lr) - (kf_lr `Car` k_avail_lr, k_lr)) (Pair kf_l kf_r) k_lrs, 
IM.insert i suck sucks)) $ initStack xs (i + 1) k_l k_r
-initStack _ _ k_l k_r = return ([], Pair (Loco (stackGeneralised k_l), k_l) 
(Loco (stackGeneralised k_r), k_r), IM.empty)
+initStack _ i k_l k_r = return ([], Pair (Loco (stackGeneralised k_l), k_l) 
(Loco (stackGeneralised k_r), k_r), IM.singleton i (sucks2 $ fmap stackFreeVars 
(Pair k_l k_r)))
 
 initSuckStackFrame :: Int - Maybe (Var {- partial loop -}, Pair Var) - 
Tagged StackFrame - Tagged StackFrame - MSGU ()
 initSuckStackFrame i mb_x (Tagged tg_l kf_l) (Tagged tg_r kf_r) = do



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Lexical marking of SUPERINLINABLEs in current module as well as imported modules (42ef500)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/42ef5005bf56129c8e9e7c511a8077c38b501226

---

commit 42ef5005bf56129c8e9e7c511a8077c38b501226
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:22:43 2012 +0100

Lexical marking of SUPERINLINABLEs in current module as well as imported 
modules

---

 compiler/supercompile/Supercompile.hs |   34 
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs 
b/compiler/supercompile/Supercompile.hs
index 5e52e96..573c308 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -184,7 +184,7 @@ termUnfoldings e = go (S.termFreeVars e) emptyVarSet [] []
   DFunUnfolding _ dc es - Right $ runParseM us2 $ 
coreExprToTerm $ mkLams as $ mkLams xs $ Var (dataConWorkId dc) `mkTyApps` 
cls_tys `mkApps` [(e `mkTyApps` map mkTyVarTy as) `mkVarApps` xs | e - es]
where (as, theta, _cls, cls_tys) = tcSplitDFunTy (idType x)
  xs = zipWith (mkSysLocal (fsLit x)) bv_uniques theta
-  CoreUnfolding { uf_tmpl = e } - Right $ (if super then 
markSuperinlinable else id) $ runParseM us2 $ coreExprToTerm e
+  CoreUnfolding { uf_tmpl = e } - Right $ superinlinableLexically 
super $ runParseM us2 $ coreExprToTerm e
-- NB: it's OK if the unfolding is a non-value, as the evaluator 
won't inline LetBound non-values
 
 primOpUnfolding pop = S.tyLambdas as $ S.lambdas xs $ S.primOp pop (map 
mkTyVarTy as) (map S.var xs)
@@ -217,11 +217,14 @@ termUnfoldings e = go (S.termFreeVars e) emptyVarSet [] []
 -- NB: this is used to deal with SUPERINLINABLE bindings which have locally 
bound loops which
 -- are *not* marked SUPERINLINABLE
 --
+-- NB: for this to work properly, coreExprToTerm must not float
+-- stuff that was lexically within a binding out of that binding!
+--
 -- TODO: this is actually useless if we just say that all InternallyBound 
things are SUPERINLINABLE
-markSuperinlinable :: S.Term - S.Term
---markSuperinlinable = id
+superinlinableLexically :: Superinlinable - S.Term - S.Term
+--superinlinableLexically = id
 {--}
-markSuperinlinable = term
+superinlinableLexically ctxt = term
   where
 term e = flip fmap e $ \e - case e of
   S.Var x - S.Var x
@@ -233,16 +236,19 @@ markSuperinlinable = term
   S.CoApp e co - S.CoApp (term e) co
   S.App   e x  - S.App   (term e) x
   S.PrimOp pop tys es - S.PrimOp pop tys (map term es)
-  S.Case e x ty alts  - S.Case (term e) x ty (map (second term) alts)
-  S.Let x e1 e2   - S.Let (bndr x) (term e1) (term e2)
-  S.LetRec xes e  - S.LetRec (map (bndr *** term) xes) (term e)
+  S.Case e x ty alts  - uncurry (flip S.Case) (pair (x, e)) ty (map 
(second term) alts)
+  S.Let x e1 e2   - uncurry S.Let (pair (x, e1)) (term e2)
+  S.LetRec xes e  - S.LetRec (map pair xes) (term e)
   S.Cast e co - S.Cast (term e) co
 
-bndr x = x `setInlinePragma` (idInlinePragma x) { inl_inline = case 
inl_inline (idInlinePragma x) of
- Inline
  - Inline
- Inlinable 
_ - Inlinable True
- NoInline  
  - NoInline
- 
EmptyInlineSpec - Inlinable True }
+pair (x, e) | not ctxt  = case S.shouldExposeUnfolding x of Right True - 
(x, superinlinableLexically True e)
+_  - 
(x, term e)
+| otherwise = (x', term e)
+  where x' = x `setInlinePragma` (idInlinePragma x) { inl_inline = case 
inl_inline (idInlinePragma x) of
+  
Inline  - Inline
+  
Inlinable _ - Inlinable True
+  
NoInline- NoInline
+  
EmptyInlineSpec - Inlinable True }
 {--}
 
 
@@ -252,7 +258,9 @@ supercompile e = -- liftM (termToCoreExpr . snd) $
  return $ termToCoreExpr $
  S.supercompile (M.fromList unfs) e'
   where unfs = termUnfoldings e'
-e' = runParseM anfUniqSupply' (coreExprToTerm e)
+-- NB: ensure we mark any child bindings of bindings marked 
SUPERINLINABLE in *this module* as SUPERINLINABLE,
+-- just like we would if we imported a SUPERINLINABLE binding
+e' = 

[commit: ghc] supercompiler: Made pairT lazier (021214f)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/021214f87371dfa1c1e1f65e4b6e494333e37bb9

---

commit 021214f87371dfa1c1e1f65e4b6e494333e37bb9
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 12:48:48 2012 +0100

Made pairT lazier

---

 .../Supercompile/Termination/Combinators.hs|3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Termination/Combinators.hs 
b/compiler/supercompile/Supercompile/Termination/Combinators.hs
index 80c8fcb..d7639ac 100644
--- a/compiler/supercompile/Supercompile/Termination/Combinators.hs
+++ b/compiler/supercompile/Supercompile/Termination/Combinators.hs
@@ -111,9 +111,10 @@ pairT :: TTest a - TTest b - TTest (a, b)
 pairT (WQO prepare_a embed_a) (WQO prepare_b embed_b) = WQO (prepare_a *** 
prepare_b) go
   where go (a1, b1) (a2, b2) = zipPair ((), ()) (a1 `embed_a` a2) (b1 
`embed_b` b2)
 
+-- NB: zipPair is lazy in the second pair so that when f/g are () we can 
doing some evaluation
 zipPair :: (a - b - c, d - e - f)
 - (a, d) - (b, e) - (c, f)
-zipPair (f, g) (a, d) (b, e) = (f a b, g d e)
+zipPair (f, g) (a, d) ~(b, e) = (f a b, g d e)
 
 -- | Type class of zippable things. Instances should satisfy the laws:
 --



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Slight improvement to power of reduce termination test by using gc, more debug output (6b8c902)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6b8c90246bcee13f03bdb20352b25d425412b1e7

---

commit 6b8c90246bcee13f03bdb20352b25d425412b1e7
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:23:21 2012 +0100

Slight improvement to power of reduce termination test by using gc, more 
debug output

---

 .../supercompile/Supercompile/Drive/Process.hs |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process.hs 
b/compiler/supercompile/Supercompile/Drive/Process.hs
index 0048c49..e8bcf28 100644
--- a/compiler/supercompile/Supercompile/Drive/Process.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process.hs
@@ -891,9 +891,9 @@ reduce' orig_state = go False (mkLinearHistory rEDUCE_WQO) 
orig_state
   Just (deeds, heap, k, e)
| Just deeds' - if bOUND_STEPS then claimStep deeds else Just deeds
, let state' = (deeds', heap, k, e)
-   - case terminate hist state of
+   - case terminate hist (gc state) of
 Continue hist' - go True hist' state'
-Stop old_state - pprTrace reduce-stop {- (pPrintFullState 
quietStatePrettiness old_state $$ pPrintFullState quietStatePrettiness state) 
-} empty
+Stop old_state - pprTrace reduce-stop {--} (pPrintFullState 
quietStatePrettiness old_state $$ pPrintFullState quietStatePrettiness state) 
{--} -- empty
   -- let smmrse s@(_, _, _, qa) = pPrintFullState 
s $$ case annee qa of Question _ - text Question; Answer _ - text Answer 
in
   -- pprPreview2 reduce-stop (smmrse old_state) 
(smmrse state) $
   (can_step, mempty { stat_reduce_stops = 1 }, if 
rEDUCE_ROLLBACK then old_state else state') -- TODO: generalise?



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Show those binders which are SUPERINLINABLE (27195a3)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/27195a3a7caca0228b75e7e5760a937963ecd61c

---

commit 27195a3a7caca0228b75e7e5760a937963ecd61c
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:23:01 2012 +0100

Show those binders which are SUPERINLINABLE

---

 compiler/supercompile/Supercompile/Core/Syntax.hs |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs 
b/compiler/supercompile/Supercompile/Core/Syntax.hs
index cc4732f..1bc8fcb 100644
--- a/compiler/supercompile/Supercompile/Core/Syntax.hs
+++ b/compiler/supercompile/Supercompile/Core/Syntax.hs
@@ -16,7 +16,7 @@ import DataCon  (DataCon, dataConWorkId)
 import Var  (TyVar, Var, varName, isTyVar, varType)
 import Name (Name, nameOccName)
 import OccName  (occNameString)
-import Id   (Id, idType)
+import Id   (Id, isId, idType, idInlinePragma)
 import PrimOp   (primOpType)
 import Literal  (Literal, literalType)
 import Type (Type, mkTyVarTy, applyTy, applyTys, mkForAllTy, mkFunTy, 
splitFunTy_maybe, eqType)
@@ -70,10 +70,11 @@ pprPrecDefault prec e = pPrintPrecLam prec xs 
(PrettyFunction ppr_prec)
 
 -- NB: don't use GHC's pprBndr because its way too noisy, printing unfoldings 
etc
 pPrintBndr :: BindingSite - Var - SDoc
-pPrintBndr bs x = prettyParen needs_parens $ ppr x + text :: + ppr 
(varType x)
+pPrintBndr bs x = prettyParen needs_parens $ ppr x + superinlinable + text 
:: + ppr (varType x)
   where needs_parens = case bs of LambdaBind - True
   CaseBind   - True
   LetBind- False
+superinlinable = if isId x then ppr (idInlinePragma x) else empty
 
 data AltCon = DataAlt DataCon [TyVar] [CoVar] [Id] | LiteralAlt Literal | 
DefaultAlt
 deriving (Eq, Show)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: No sc' tracing (9be06a4)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/9be06a4e824515fd12548ba1ef2af5ae8dc87fd8

---

commit 9be06a4e824515fd12548ba1ef2af5ae8dc87fd8
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:23:48 2012 +0100

No sc' tracing

---

 .../supercompile/Supercompile/Drive/Process3.hs|5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index b4ab075..1b2bec9 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -284,7 +284,7 @@ sc :: State - ScpM (Deeds, FVedTerm)
 sc = memo sc' . gc -- Garbage collection necessary because normalisation might 
have made some stuff dead
 
 sc' :: Maybe String - State - ScpM (Bool, (Deeds, FVedTerm)) -- Bool records 
whether generalisation occurred, for debug printing
-sc' mb_h state = pprTrace sc' (trce1 state) $ {-# SCC sc' #-} case mb_h of
+sc' mb_h state = {- pprTrace sc' (trce1 state) $ -} {-# SCC sc' #-} case 
mb_h of
   Nothing - speculateM (reduce state) $ \state - -- traceRenderM !sc 
(PrettyDoc (pPrintFullState quietStatePrettiness state)) 
my_split state
   Just h  - flip catchM try_generalise $ \rb -
@@ -312,7 +312,8 @@ sc' mb_h state = pprTrace sc' (trce1 state) $ {-# SCC 
sc' #-} case mb_h of
 
 -- NB: we could try to generalise against all embedded things in the 
history, not just one. This might make a difference in rare cases.
 my_generalise splt  = liftM ((,) True)  $ splt   = insertTagsM
-my_split  state = liftM ((,) False) $ split sc state = insertTagsM
+my_split  state = --pprTrace my_split (pPrintFullState 
quietStatePrettiness state) $
+  liftM ((,) False) $ split sc state = insertTagsM
 
 tryTaG, tryMSG :: (State - ScpM (Deeds, Out FVedTerm))
- State - State



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Don't float out of binders that may be marked SUPERINLINABLE when converting from GHC core to preserve lexical structure (15638a4)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/15638a4381e33af35f9375ad5b57d22c52fe4d01

---

commit 15638a4381e33af35f9375ad5b57d22c52fe4d01
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:24:12 2012 +0100

Don't float out of binders that may be marked SUPERINLINABLE when 
converting from GHC core to preserve lexical structure

---

 compiler/supercompile/Supercompile/GHC.hs |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/GHC.hs 
b/compiler/supercompile/Supercompile/GHC.hs
index 24e5e97..0c00864 100644
--- a/compiler/supercompile/Supercompile/GHC.hs
+++ b/compiler/supercompile/Supercompile/GHC.hs
@@ -147,6 +147,7 @@ conAppToTerm dc es
 fromType_maybe (Type ty) = Just ty
 fromType_maybe _ = Nothing
 
+-- NB: this function must not float stuff out of bindings, so that later 
SUPERINLINABLE propagation will work properly
 coreExprToTerm :: CoreExpr - ParseM S.Term
 coreExprToTerm init_e = {-# SCC coreExprToTerm #-} term init_e
   where
@@ -168,9 +169,9 @@ coreExprToTerm init_e = {-# SCC coreExprToTerm #-} term 
init_e
 term (App e_fun e_arg) = join $ liftM2 appE (term e_fun) (fmap 
((,) e_arg) $ maybeUnLiftedTerm (exprType e_arg) e_arg)
 term (Lam x e) | isTyVar x = fmap (S.value . S.TyLambda x) (bindFloats 
(term e))
| otherwise = fmap (S.value . S.Lambda x) (bindFloats 
(term e))
-term (Let (NonRec x e1) e2)= liftM2 (S.let_ x) (maybeUnLiftedTerm 
(idType x) e1) (bindFloats (term e2))
-term (Let (Rec xes) e) = bindFloatsWith (liftM2 (,) (mapM (secondM 
term) xes) (term e))
-term (Case e x ty alts)= liftM2 (\e alts - S.case_ e x ty alts) 
(term e) (mapM alt alts)
+term (Let (NonRec x e1) e2)= liftM2 (S.let_ x) (bindFloats (term e1)) 
(bindFloats (term e2))
+term (Let (Rec xes) e) = bindFloatsWith (liftM2 (,) (mapM (secondM 
(bindFloats . term)) xes) (term e))
+term (Case e x ty alts)= liftM2 (\e alts - S.case_ e x ty alts) 
(bindFloats (term e)) (mapM alt alts)
 term (Cast e co)   = fmap (flip S.cast co) (term e)
 term (Tick _ e)= term e -- FIXME: record ticks
 term (Type ty) = pprPanic termToCoreExpr (ppr ty)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix bug in cheap node shortcutting that was pessimising the splitter (8388dd2)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/8388dd29c803ca8800beeea5e00dd5c6e3b398e0

---

commit 8388dd29c803ca8800beeea5e00dd5c6e3b398e0
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Oct 19 16:24:40 2012 +0100

Fix bug in cheap node shortcutting that was pessimising the splitter

---

 compiler/supercompile/Supercompile/Drive/Split2.hs |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Split2.hs 
b/compiler/supercompile/Supercompile/Drive/Split2.hs
index 51b412e..7a9041b 100644
--- a/compiler/supercompile/Supercompile/Drive/Split2.hs
+++ b/compiler/supercompile/Supercompile/Drive/Split2.hs
@@ -57,7 +57,7 @@ shortcutEdges :: forall node edge.
  Ord node
   = (node - Bool)
   - (edge - edge - edge) -- Used to join edges if after 
shortcutting there is more than one path from a node to another one
-  - (edge - node - edge - edge) -- Used when joining two edges 
in a contiguous path
+  - (edge - node - edge - edge) -- Used when joining two edges 
in a contiguous path (the node always satisfys the predicate)
   - LGraph node edge
   - LGraph node edge
 shortcutEdges should_shortcut combine_edges combine g = State.evalState 
visit_graph M.empty
@@ -464,7 +464,8 @@ type PushedFocus = PushFocus PushedQA State
 push :: S.Set Context
  - (Heap, Stack, PushFocus (Anned QA) (In AnnedTerm))
  - (PushedHeap, PushedStack, PushedFocus)
-push generalised (Heap h ids, k, focus) = (h', k', focus')
+push generalised (Heap h ids, k, focus) = -- pprTrace push (ppr verts $$ ppr 
marked)
+  (h', k', focus')
   where -- TODO: arguably I should try to get a QA for the thing in the focus. 
This will help in cases like where we MSG together:
 --   H | v | 
 -- and:
@@ -498,7 +499,7 @@ push generalised (Heap h ids, k, focus) = (h', k', focus')
 cheap_marked = S.fromDistinctAscList [HeapContext x' | (x', hb) - 
M.toAscList h, maybe True (termIsCheap . snd) (heapBindingTerm hb)] S.\\ 
generalised
 verts = trimUnreachable FocusContext $
 shortcutEdges (`S.member` cheap_marked)
-  plusEntries (\ent1 _ ent2 - ent1 `plusEntries` 
ent2)
+  plusEntries (\ent1 _ _ent2 - ent1) -- NB: we 
discard ent2. Consider inlining binding (x = Just y) [which marks y as Many] 
into context (case x of Just y - ...) [which marks x as Once]. We don't want 
to mark y with Many (i.e. Once+Many) because we can in fact push it down safely.
   (verts_h `unionDisjoint` (verts_k 
`unionDisjoint` verts_focus))
 extra_marked = solve generalised verts
 marked = cheap_marked `S.union` extra_marked



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix problems with preinit eta expansion: no gc-destroyed free vars, no dead var occs (4a911d7)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/4a911d725946061ee7765d78d3e9c43e45695b64

---

commit 4a911d725946061ee7765d78d3e9c43e45695b64
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Tue Oct 23 17:59:27 2012 +0100

Fix problems with preinit eta expansion: no gc-destroyed free vars, no dead 
var occs

---

 .../supercompile/Supercompile/Drive/Process.hs |   51 
 1 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process.hs 
b/compiler/supercompile/Supercompile/Drive/Process.hs
index e8bcf28..01b0627 100644
--- a/compiler/supercompile/Supercompile/Drive/Process.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process.hs
@@ -48,7 +48,7 @@ import Supercompile.StaticFlags
 import Supercompile.Utilities hiding (Monad(..))
 
 import Var(isTyVar, isId, tyVarKind, varType, setVarType)
-import Id (idType, zapFragileIdInfo, localiseId, isDictId, isGlobalId)
+import Id (idType, zapIdOccInfo, zapFragileIdInfo, localiseId, 
isDictId, isGlobalId)
 import MkId   (voidArgId, realWorldPrimId, mkPrimOpId)
 import Coercion   (Coercion(..), isCoVar, mkCoVarCo, mkUnsafeCo, coVarKind)
 import TyCon  (PrimRep(..))
@@ -402,10 +402,10 @@ prepareTerm unfoldings e = {-# SCC prepareTerm #-}
 
 -- FIXME: update other comments about memocache preinit
 -- We can and should do memocache preinit even if we still use 
let-bindings in the heap with associated terms
-letty_preinit_with = [(gc (normalise (maxBound, heap', Loco False, 
anned_e')), accessor_e)
+letty_preinit_with = [ res
  | (x', hb) - M.toList h''_binds_globalid
  , Just in_e_def - [heapBindingTerm hb]
- , (heap', accessor_e, anned_e') - eta heap (var 
x') in_e_def (annedTerm (annedTag (snd in_e_def)) (Var x'))]
+ , res - eta [] heap (var x') in_e_def (annedTerm 
(annedTag (snd in_e_def)) (Var x'))]
 
 -- When doing memocache preinitialization, we don't want to include in 
the final heap any binding originating
 -- from evaluating the top-level that cannot be proven to be a value, 
or else we risk work duplication
@@ -418,9 +418,9 @@ prepareTerm unfoldings e = {-# SCC prepareTerm #-}
 preinit_heap = Heap (preinit_h_avail `M.union` h_fvs) ids'
 
 -- NB: we assume that unfoldings are guaranteed to be cheap and hence 
duplicatiable. I think this is reasonable.
-preinit_with = [(gc (normalise (maxBound, heap', Loco False, 
anned_e')), accessor_e)
+preinit_with = [ res
| (x', in_e_def) - h_unfoldings
-   , (heap', accessor_e, anned_e') - eta preinit_heap 
(var x') in_e_def (annedTerm (annedTag (snd in_e_def)) (Var x'))]
+   , res - eta [] preinit_heap (var x') in_e_def 
(annedTerm (annedTag (snd in_e_def)) (Var x'))]
 
 -- FIXME: instead of adding unfoldings as Let, (in order to sidestep 
the bug where Let stuff will be underspecialised)
 -- we should add it them as normal bindings but pre-initialise the 
memo cache. Of course this will be bad in the case
@@ -455,22 +455,28 @@ prepareTerm unfoldings e = {-# SCC prepareTerm #-}
 --
 -- NB: given an unfolding (f = \x y - e) will return memo entries for all the 
states (\x y - e), (\y - e), e, f, (f x) and (f x y).
 -- Because we do not reduce before matching, both are necessary!
-eta :: Heap - FVedTerm - In AnnedTerm - AnnedTerm - [(Heap, FVedTerm, In 
AnnedTerm)]
-eta heap tieback_e1 in_e_def e_call = (heap, tieback_e1, in_e_def) : (heap, 
tieback_e1, renamedTerm e_call) : case normalise (maxBound, heap, Loco False, 
in_e_def) of
-  (_, Heap h ids, k, anned_qa)
-| Answer (rn, v) - extract anned_qa
-, Just a_cast - isCastStack_maybe k
-, let tieback_e2 = case a_cast of
-Uncast  - tieback_e1
-CastBy co _ - tieback_e1 `cast` mkSymCo ids co
-  mb_res@(~(Just (_, x, _, _))) = case v of
- Lambda   x e_def_body - Just (tieback_e2 `app`   x',   
x, e_def_body, annedTerm (annedTag e_def_body) (e_call `App`   x'))
- TyLambda a e_def_body - Just (tieback_e2 `tyApp` mkTyVarTy x', 
a, e_def_body, annedTerm (annedTag e_def_body) (e_call `TyApp` mkTyVarTy x'))
- _ - Nothing
-  (ids', rn', x') = renameNonRecBinder ids rn x
-, Just (tieback_e2, _, e_def_body, e_call_body) - mb_res
-- eta (Heap (M.insert x' lambdaBound h) ids') tieback_e2 (rn', 
e_def_body) e_call_body
-  _ - []
+eta :: [Var] - Heap - FVedTerm - In AnnedTerm - AnnedTerm - [(State, 
FVedTerm)]
+eta xs' heap tieback_e1 in_e_def e_call1 = res in_e_def 

[commit: ghc] supercompiler: Fix newtype unfoldings (coercion direction) and prevent data unfoldings with strange tyvar kinds (d54e4c5)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/d54e4c5e73caadb53fe53b5e7a4a71579476746b

---

commit d54e4c5e73caadb53fe53b5e7a4a71579476746b
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Tue Oct 23 17:56:26 2012 +0100

Fix newtype unfoldings (coercion direction) and prevent data unfoldings 
with strange tyvar kinds

---

 compiler/supercompile/Supercompile.hs |   11 +++
 compiler/supercompile/Supercompile/Core/Syntax.hs |   20 
 compiler/supercompile/Supercompile/Drive/MSG.hs   |   19 ---
 3 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs 
b/compiler/supercompile/Supercompile.hs
index 573c308..e577c62 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -30,9 +30,10 @@ import CoreSyn
 import CoreFVs(exprFreeVars)
 import CoreUtils  (exprType)
 import MkCore (mkWildValBinder)
-import Coercion   (isCoVar, mkCoVarCo, mkAxInstCo)
+import Coercion   (isCoVar, mkCoVarCo, mkAxInstCo, mkSymCo)
 import DataCon(dataConAllTyVars, dataConRepArgTys, dataConTyCon, 
dataConWorkId)
 import VarSet
+import Var(tyVarKind)
 import Id
 import MkId   (realWorldPrimId)
 import FastString (fsLit)
@@ -175,7 +176,7 @@ termUnfoldings e = go (S.termFreeVars e) emptyVarSet [] []
 -- which can literall never be used.
 varUnfolding x
   | Just pop - isPrimOpId_maybe x = Right $ primOpUnfolding pop
-  | Just dc - isDataConWorkId_maybe x = Right $ dataUnfolding dc
+  | Just dc - isDataConWorkId_maybe x = dataUnfolding dc
   | otherwise  = case S.shouldExposeUnfolding x of
 Left why_not - Left why_not
 Right super  - case realIdUnfolding x of
@@ -194,9 +195,11 @@ termUnfoldings e = go (S.termFreeVars e) emptyVarSet [] []
 dataUnfolding dc
   | Just co_axiom - newTyConCo_maybe (dataConTyCon dc)
   , let [x] = xs
-  = S.tyLambdas as $ S.lambdas [x] $ S.var x `S.cast` mkAxInstCo co_axiom 
(map mkTyVarTy as)
+  = Right $ S.tyLambdas as $ S.lambdas [x] $ S.var x `S.cast` mkSymCo 
(mkAxInstCo co_axiom (map mkTyVarTy as)) -- Axiom LHS = TyCon, RHS = Rep Type
+  | any (not . S.canAbstractOverTyVarOfKind . tyVarKind) as
+  = Left some type variable which we cannot abstract over
   | otherwise
-  = S.tyLambdas as $ S.lambdas xs $ S.value (S.Data dc (map mkTyVarTy as) 
(map mkCoVarCo qs) ys)
+  = Right $ S.tyLambdas as $ S.lambdas xs $ S.value (S.Data dc (map 
mkTyVarTy as) (map mkCoVarCo qs) ys)
   where as = dataConAllTyVars dc
 arg_tys = dataConRepArgTys dc
 xs = zipWith (mkSysLocal (fsLit x)) bv_uniques arg_tys
diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs 
b/compiler/supercompile/Supercompile/Core/Syntax.hs
index 1bc8fcb..f818383 100644
--- a/compiler/supercompile/Supercompile/Core/Syntax.hs
+++ b/compiler/supercompile/Supercompile/Core/Syntax.hs
@@ -272,6 +272,26 @@ mkTransCastBy _   cast_by1  Uncast   = 
cast_by1
 mkTransCastBy ids (CastBy co1 _tg1) (CastBy co2 tg2) = castBy (mkTransCo ids 
co1 co2) tg2
 
 
+canAbstractOverTyVarOfKind :: Kind - Bool
+canAbstractOverTyVarOfKind = ok
+  where
+-- TODO: I'm not 100% sure of the correctness of this check
+-- In particular, I don't think we need to check for non-conforming
+-- kinds in negative positions since they would only appear if the
+-- definition site had erroneously abstracted over a non-conforming
+-- kind. For example, this *should* never be allowed:
+--   data Foo (a :: * - #) = Bar (a Int)
+--   Foo :: (* - #) - *
+--   Bar :: forall (a :: * - #). a Int - Foo a
+ok k | isOpenTypeKind k || isUbxTupleKind k || isArgTypeKind k || 
isUnliftedTypeKind k = False
+ok (TyVarTy _) = True -- This is OK because kinds dont get 
generalised, and we assume all incoming kind instantiations satisfy the kind 
invariant
+ok (AppTy k1 k2)   = ok k1  ok k2
+ok (TyConApp _ ks) = all ok ks
+ok (FunTy k1 k2)   = ok k1  ok k2
+ok (ForAllTy _ k)  = ok k
+ok (LitTy _)   = True
+
+
 valueType :: Copointed ann = ValueF ann - Type
 valueType (TyLambda a e)  = mkForAllTy a (termType e)
 valueType (Lambda x e)= idType x `mkFunTy` termType e
diff --git a/compiler/supercompile/Supercompile/Drive/MSG.hs 
b/compiler/supercompile/Supercompile/Drive/MSG.hs
index 935d48f..57e4d60 100644
--- a/compiler/supercompile/Supercompile/Drive/MSG.hs
+++ b/compiler/supercompile/Supercompile/Drive/MSG.hs
@@ -828,25 +828,6 @@ msgCoerced _ _ _ _ _ _ = fail msgCoerced
 msgKind :: RnEnv2 - Kind - Kind - MSG Kind
 msgKind = msgType
 
-canAbstractOverTyVarOfKind :: Kind - Bool
-canAbstractOverTyVarOfKind = 

[commit: ghc] supercompiler: Fix mkSymCo so it actually creates a symmetric coercion (cfa06bc)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/cfa06bc2a3ea558f0b5eb7636f5fe29ca809542d

---

commit cfa06bc2a3ea558f0b5eb7636f5fe29ca809542d
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Tue Oct 23 17:59:58 2012 +0100

Fix mkSymCo so it actually creates a symmetric coercion

---

 compiler/supercompile/Supercompile/Core/Syntax.hs |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs 
b/compiler/supercompile/Supercompile/Core/Syntax.hs
index f818383..2084c31 100644
--- a/compiler/supercompile/Supercompile/Core/Syntax.hs
+++ b/compiler/supercompile/Supercompile/Core/Syntax.hs
@@ -20,14 +20,17 @@ import Id   (Id, isId, idType, idInlinePragma)
 import PrimOp   (primOpType)
 import Literal  (Literal, literalType)
 import Type (Type, mkTyVarTy, applyTy, applyTys, mkForAllTy, mkFunTy, 
splitFunTy_maybe, eqType)
+import TypeRep  (Type(..))
+import Kind
 import Coercion (CoVar, Coercion, coercionType, coercionKind, mkCvSubst, 
mkAxInstCo, mkReflCo, isReflCo)
+import qualified Coercion as Coercion
 import PrimOp   (PrimOp)
 import Pair (pSnd)
 import PprCore  ()
 
 
 mkSymCo :: InScopeSet - NormalCo - NormalCo
-mkSymCo iss co = optCoercion (mkCvSubst iss []) co
+mkSymCo iss co = optCoercion (mkCvSubst iss []) (Coercion.mkSymCo co)
 
 mkTransCo :: InScopeSet - NormalCo - NormalCo - NormalCo
 mkTransCo = opt_trans



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Weaken the bugcheck for typegen tieback memo (680f931)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/680f9313ab06eb12f21d7c46d7612d88dfd8b31d

---

commit 680f9313ab06eb12f21d7c46d7612d88dfd8b31d
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Tue Oct 23 18:00:46 2012 +0100

Weaken the bugcheck for typegen tieback memo

---

 .../supercompile/Supercompile/Drive/Process3.hs|9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index 1b2bec9..e23b919 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -661,7 +661,7 @@ memo opt init_state = {-# SCC memo' #-} memo_opt 
init_state
 -- This means that we preferred to roll back to something 
which gives an MSG with the *smallest possible* renaming (i.e. is more 
specific).
 -- This is the opposite of what I've implemented below 
(FIXME).
 -- TODO: maybe it actually would be OK (for SC 
termination) to roll back to h0 at (*)? Though it would mean dumping any 
tiebacks to h2 unnecessarily.
-moreSpecific (RightGivesTypeGen _ _ _rn_l) 
(RightGivesTypeGen _ _ _rn_r)
+moreSpecific (RightGivesTypeGen _ _s_l rn_l) 
(RightGivesTypeGen _ _s_r rn_r)
   -- OK, here is what I have concluded after long thought.
   -- As long as we DON'T CREATE A PROMISE when type 
generalising, then there will be a always be a maximum of one
   -- possible type generalisation. A simple example 
demonstrates the principal behind this. Imagine that there were two
@@ -678,12 +678,15 @@ memo opt init_state = {-# SCC memo' #-} memo_opt 
init_state
   -- type generalise it against the earlier promise (i.e. 
f Int Char) and hence would have driven (f alpha beta) without
   -- recording (f Float Bool). Now when we come to 
supercompile (f Int Bool) we can just tie back to (f alpha beta),
   -- which is absolutely what we want.
-  = error moreSpecific: two possible type gens, this 
should not happen! -- renamingSize rn_r = renamingSize rn_l
+  | pREINITALIZE_MEMO_TABLE
+  = renamingSize rn_r = renamingSize rn_l -- NB: although 
the argument above *is* true, we can have two type-genable promises due to 
memoiser preinit!
+  | otherwise
+  = pprPanic moreSpecific: two possible type gens, this 
should not happen! (ppr rn_l $$ ppr rn_r $$ pPrintFullState 
quietStatePrettiness _s_l $$ pPrintFullState quietStatePrettiness _s_r)
 -- Prefer instance matches to type generalisation (don't 
have a good sense about what is best here):
 moreSpecific (RightIsInstance _ _ _) _ = True
 moreSpecific _ (RightIsInstance _ _ _) = False
 
---renamingSize (_, tv_subst, co_subst) = sumMap typeSize 
(varEnvElts tv_subst) + sumMap coercionSize (varEnvElts co_subst)
+renamingSize (_, tv_subst, co_subst) = sumMap typeSize 
(varEnvElts tv_subst) + sumMap coercionSize (varEnvElts co_subst)
 
 -- TODO: it might be OK to insist the incoming renaming is 
invertible, but this should definitely work:
 isEmptyRenaming (_, tv_subst, co_subst) = all isTyVarTy 
(varEnvElts tv_subst)  all isCoVarCo (varEnvElts co_subst)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix critical bug in msg where we weren't sucking enough (deee68a)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/deee68af1448bcfb41bd4d73d820b549d07e5d75

---

commit deee68af1448bcfb41bd4d73d820b549d07e5d75
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Oct 24 18:44:28 2012 +0100

Fix critical bug in msg where we weren't sucking enough

---

 compiler/supercompile/Supercompile/Drive/MSG.hs |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/MSG.hs 
b/compiler/supercompile/Supercompile/Drive/MSG.hs
index 57e4d60..e957ecf 100644
--- a/compiler/supercompile/Supercompile/Drive/MSG.hs
+++ b/compiler/supercompile/Supercompile/Drive/MSG.hs
@@ -12,6 +12,7 @@ import Supercompile.Core.Syntax
 import Supercompile.Evaluator.Deeds
 import Supercompile.Evaluator.FreeVars
 import Supercompile.Evaluator.Syntax
+import Supercompile.Evaluator.Residualise
 
 --import qualified Supercompile.GHC as GHC
 import Supercompile.Utilities hiding (guard)
@@ -702,7 +703,11 @@ isTypeRenamingNonTrivial :: Renaming - FreeVars - Bool
 isTypeRenamingNonTrivial rn fvs = (\f - foldVarSet f False fvs) $ \x rest - 
(isTyVar x  isNothing (getTyVar_maybe (lookupTyVarSubst rn x))) || rest
 
 msg :: MSGMode - State - State - MSG' MSGResult
-msg = {- pprTrace examples (example1 $$ example2) -} msg'
+msg mm state_l state_r = {- pprTrace examples (example1 $$ example2) -}
+ --(if isEmptyVarSet (stateUncoveredVars state_l) then 
id else pprPanic msgl (pPrintFullState fullStatePrettiness state_l $$ ppr 
(stateUncoveredVars state_l))) $
+ --(if isEmptyVarSet (stateUncoveredVars state_r) then 
id else pprPanic msgr (pPrintFullState fullStatePrettiness state_r $$ ppr 
(stateUncoveredVars state_r))) $
+ --(\res - case res of Left _ - res; Right (Pair l 
r, common) - let xs = stateFreeVars common; f (_, Heap h _, rn, k) x = let off 
= mkVarSet (map (renameId rn) (varSetElems xs)) in if off `subVarSet` 
(dataSetToVarSet (M.keysSet h) `unionVarSet` stackBoundVars k) then x else 
pprPanic fff (ppr off) in f l $ f r $ res) $
+ msg' mm state_l state_r
 msg' mm (deeds_l, heap_l, k_l, qa_l) (deeds_r, heap_r, k_r, qa_r) = -- (\res 
- traceRender (msg, M.keysSet h_l, residualiseDriveState (Heap h_l 
prettyIdSupply, k_l, in_e_l), M.keysSet h_r, residualiseDriveState (Heap h_r 
prettyIdSupply, k_r, in_e_r), res) res) $
 liftM (first (liftA2 (\deeds (heap, rn, k) - (deeds, heap, rn, k)) (Pair 
deeds_l deeds_r))) $ msgLoop mm (heap_l, heap_r) (qa_l, qa_r) (k_l, k_r)
 
@@ -1191,7 +1196,7 @@ suck :: (Pair MSGLRState - MSGLRState) - Var - MSGU ()
 suck sel x = join $ suck' sel x
 
 suck' :: (Pair MSGLRState - MSGLRState) - Var - MSGU (MSGU ())
-suck' sel x = {- trace (suck': ++ show x) $ -} flip fmap get $ \s - 
lookupWithDefaultVarEnv (msgLRSuckVar (sel (msgLR s))) (return ()) x
+suck' sel x = {- trace (suck': ++ show x) $ -} flip fmap get $ \s - 
lookupWithDefaultVarEnv (msgLRSuckVar (sel (msgLR s))) (return ()) x -- NB: 
don't panic here if lookup fails because we might just have removed the var 
from the mapping
 
 suckStack :: Int - MSGU ()
 suckStack i = {- trace (suckStack: ++ show i) $ -} join $ flip fmap get $ \s 
- IM.findWithDefault (return ()) i (msgSuckStack s)
@@ -1271,7 +1276,7 @@ msgLoop mm (Heap init_h_l init_ids_l, Heap init_h_r 
init_ids_r) (qa_l, qa_r) (in
   modify_ $ \s - s { msgLR = mdfy_lr (msgLR s) $ \s_lr - 
s_lr { msgLRHeap = M.insert x_lr hb_lr (msgLRHeap s_lr)

 , msgLRSuckVar = msgLRSuckVar s_lr `delVarEnv` x_lr

 , msgLRAvailableHeap = if heapBindingCheap hb_lr then msgLRAvailableHeap 
s_lr else M.delete x_lr (msgLRAvailableHeap s_lr) } }
-  sucks xtrct_lr (heapBindingFreeVars hb_lr)
+  sucks xtrct_lr (varBndrFreeVars x_lr `unionVarSet` 
heapBindingFreeVars hb_lr)
 
   {-
   -- NB: I can try to avoid generalisation when e_l or e_r is just a 
heap-bound variable. We do this by floating the non-variable into a new heap 
binding



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Comments only (a8a1f39)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/a8a1f396f8c9c88240e34a9ab79bdea5b0110769

---

commit a8a1f396f8c9c88240e34a9ab79bdea5b0110769
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Oct 24 18:44:57 2012 +0100

Comments only

---

 .../supercompile/Supercompile/Drive/Process3.hs|7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index e23b919..53bd689 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -342,9 +342,9 @@ tryMSG opt = bothWays $ \shallow_state state - do
 
 pprMSGResult :: MSGResult - SDoc
 pprMSGResult (Pair (deeds_l, heap_l, rn_l, k_l) (deeds_r, heap_r, rn_r, k_r), 
(heap, k, qa))
-  = pPrintFullState quietStatePrettiness (emptyDeeds, heap, k, qa) $$
-ppr rn_l $$ pPrintFullState quietStatePrettiness (deeds_l, heap_l, k_l, 
fmap Question (annedVar (mkTag 0) nullAddrId)) $$
-ppr rn_r $$ pPrintFullState quietStatePrettiness (deeds_r, heap_r, k_r, 
fmap Question (annedVar (mkTag 0) nullAddrId))
+  = {- ppr (case heap   of Heap h   _ - M.keysSet h)   $$ -} pPrintFullState 
quietStatePrettiness (emptyDeeds, heap, k, qa) $$
+{- ppr (case heap_l of Heap h_l _ - M.keysSet h_l) $$ -} ppr rn_l $$ 
pPrintFullState quietStatePrettiness (deeds_l, heap_l, k_l, fmap Question 
(annedVar (mkTag 0) nullAddrId)) $$
+{- ppr (case heap_r of Heap h_r _ - M.keysSet h_r) $$ -} ppr rn_r $$ 
pPrintFullState quietStatePrettiness (deeds_r, heap_r, k_r, fmap Question 
(annedVar (mkTag 0) nullAddrId))
 
 renameSCResult :: InScopeSet - In FVedTerm - ScpM (PureHeap, FVedTerm)
 renameSCResult ids (rn_r, e) = do
@@ -772,6 +772,7 @@ preinitalise states_fulfils
   | not pREINITALIZE_MEMO_TABLE = return () -- If you do this, expect your 
output code to grow a lot!
   | otherwise = forM_ states_fulfils $ \(state, e') - do
 ScpM $ StateT $ \s - do
+--unless (isEmptyVarSet (stateUncoveredVars state)) $ pprPanic 
preinitalise (pPrintFullState fullStatePrettiness state $$ ppr e')
 let (ms', _p) = promise (scpMemoState s) (state, snd (reduceForMatch 
state))
 return ((), s { scpMemoState = ms' })
 fulfillM (emptyDeeds, e')



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Mark module SUPERINLINABLE by default (otherwise SC is almost an identity transformation) (5c058a0)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/5c058a0fe6364c874ee071c912a3f1a61014a2da

---

commit 5c058a0fe6364c874ee071c912a3f1a61014a2da
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Oct 24 18:43:36 2012 +0100

Mark module SUPERINLINABLE by default (otherwise SC is almost an identity 
transformation)

---

 compiler/supercompile/Supercompile.hs |3 ++-
 compiler/supercompile/Supercompile/StaticFlags.hs |3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs 
b/compiler/supercompile/Supercompile.hs
index e577c62..2d416f4 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -17,6 +17,7 @@ module Supercompile (supercompileProgram, 
supercompileProgramSelective) where
 -- Probably can't/shouldn't do this if the wildcard binder y is used in the 
RHS.
 
 import Supercompile.GHC
+import Supercompile.StaticFlags
 import Supercompile.Utilities
 import qualified Supercompile.Core.Syntax as S
 import qualified Supercompile.Core.FreeVars as S
@@ -263,7 +264,7 @@ supercompile e = -- liftM (termToCoreExpr . snd) $
   where unfs = termUnfoldings e'
 -- NB: ensure we mark any child bindings of bindings marked 
SUPERINLINABLE in *this module* as SUPERINLINABLE,
 -- just like we would if we imported a SUPERINLINABLE binding
-e' = superinlinableLexically False $ runParseM anfUniqSupply' $ 
coreExprToTerm e
+e' = superinlinableLexically mODULE_SUPERINLINABLE $ runParseM 
anfUniqSupply' $ coreExprToTerm e
 
 supercompileProgram :: [CoreBind] - IO [CoreBind]
 supercompileProgram binds = supercompileProgramSelective selector binds
diff --git a/compiler/supercompile/Supercompile/StaticFlags.hs 
b/compiler/supercompile/Supercompile/StaticFlags.hs
index 7e973db..8e6d3c2 100644
--- a/compiler/supercompile/Supercompile/StaticFlags.hs
+++ b/compiler/supercompile/Supercompile/StaticFlags.hs
@@ -161,6 +161,9 @@ pOSITIVE_INFORMATION = lookUp $ fsLit 
-fsupercompiler-positive-information
 pREINITALIZE_MEMO_TABLE :: Bool
 pREINITALIZE_MEMO_TABLE = not $ lookUp $ fsLit 
-fsupercompiler-no-preinitalize
 
+mODULE_SUPERINLINABLE :: Bool
+mODULE_SUPERINLINABLE = not $ lookUp $ fsLit 
-fsupercompiler-no-module-superinlinable
+
 -- FIXME: turning this off is actually broken right now
 uSE_LET_BINDINGS :: Bool
 uSE_LET_BINDINGS = not $ lookUp $ fsLit -fsupercompiler-no-let-bindings



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Comment only (26edd7d)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/26edd7d1271a72f6e814e501cc93404a90d018bc

---

commit 26edd7d1271a72f6e814e501cc93404a90d018bc
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Nov 1 17:35:14 2012 +

Comment only

---

 compiler/supercompile/Supercompile/Drive/Split2.hs |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Split2.hs 
b/compiler/supercompile/Supercompile/Drive/Split2.hs
index 336882c..e529f22 100644
--- a/compiler/supercompile/Supercompile/Drive/Split2.hs
+++ b/compiler/supercompile/Supercompile/Drive/Split2.hs
@@ -489,6 +489,7 @@ type PushedValue = Tagged (Coerced (ValueG State))
 type PushedQA= Tagged (QAG (ValueG State))
 type PushedFocus = PushFocus PushedQA State
 
+-- NB: it is not necessary for the traversal order here to match that in 
recurse, even when doing FCFS
 traversePushedState :: Applicative t = (State - t State)
 - (PushedHeap, PushedStack, PushedFocus) - t 
(PushedHeap, PushedStack, PushedFocus)
 traversePushedState f (heap, stack, focus) = liftA3 (,,) (traversePushedHeap f 
heap) (traversePushedStack f stack) (traversePushedFocus f focus)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Checkpoint deeds in splitter (8900089)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/89000899821ac43616eb11792adafeef3883fabd

---

commit 89000899821ac43616eb11792adafeef3883fabd
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Oct 31 11:25:36 2012 +

Checkpoint deeds in splitter

---

 compiler/supercompile/Supercompile/Core/Syntax.hs  |8 +++
 compiler/supercompile/Supercompile/Drive/Split2.hs |   53 +--
 .../supercompile/Supercompile/Evaluator/Syntax.hs  |4 ++
 3 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs 
b/compiler/supercompile/Supercompile/Core/Syntax.hs
index 2084c31..73b2087 100644
--- a/compiler/supercompile/Supercompile/Core/Syntax.hs
+++ b/compiler/supercompile/Supercompile/Core/Syntax.hs
@@ -152,6 +152,14 @@ data ValueG term = Literal Literal | Coercion Coercion
  | Data DataCon [Type] [Coercion] [Id] -- NB: includes 
universal and existential type arguments, in that order
-- NB: not a newtype 
DataCon
 
+instance Traverseable ValueG where
+traverse f e = case e of
+  Literal l  - pure $ Literal l
+  Coercion co- pure $ Coercion co
+  TyLambda a e   - fmap (TyLambda a) $ f e
+  Lambda   x e   - fmap (Lambda   x) $ f e
+  Data dc tys cos xs - pure $ Data dc tys cos xs
+
 instance Outputable AltCon where
 pprPrec prec altcon = case altcon of
 DataAlt dc as qs xs - prettyParen (prec = appPrec) $ ppr dc + hsep 
(map (pPrintBndr CaseBind) as ++ map (pPrintBndr CaseBind) qs ++ map 
(pPrintBndr CaseBind) xs)
diff --git a/compiler/supercompile/Supercompile/Drive/Split2.hs 
b/compiler/supercompile/Supercompile/Drive/Split2.hs
index 7a9041b..721eb6a 100644
--- a/compiler/supercompile/Supercompile/Drive/Split2.hs
+++ b/compiler/supercompile/Supercompile/Drive/Split2.hs
@@ -242,12 +242,12 @@ multEntered = M.unionWith (\_ _ - ManyEntries)
 split :: (Applicative m, Monad m)
   = (State - m(Deeds, Out FVedTerm))
   - State  - m (ResidTags, Deeds, Out FVedTerm)
-split opt (_deeds, heap, k, qa) = recurse opt $ push (S.singleton 
FocusContext) (heap, k, QAFocus qa)
+split opt (deeds, heap, k, qa) = recurse opt $ push (S.singleton FocusContext) 
(deeds, heap, k, QAFocus qa)
 
 instanceSplit :: (Applicative m, Monad m)
   = (State - m(Deeds, 
Out FVedTerm))
   - (Deeds, Heap, Stack, Out FVedTerm) - m (ResidTags, Deeds, 
Out FVedTerm)
-instanceSplit opt (_deeds, heap, k, e) = recurse opt $ push (S.singleton 
FocusContext) (heap, k, OpaqueFocus e)
+instanceSplit opt (deeds, heap, k, e) = recurse opt $ push (S.singleton 
FocusContext) (deeds, heap, k, OpaqueFocus e)
 
 applyGeneraliser :: Generaliser - State - Maybe (S.Set Context)
 applyGeneraliser gen (_deeds, Heap h _, k, qa) = fmap (\(gen_kfs, gen_xs) - 
S.fromList $ map StackContext (IS.elems gen_kfs) ++ map HeapContext 
(varSetElems gen_xs)) $ case gENERALISATION of
@@ -287,7 +287,7 @@ applyGeneraliser gen (_deeds, Heap h _, k, qa) = fmap 
(\(gen_kfs, gen_xs) - S.f
 generaliseSplit :: (Applicative m, Monad m)
 = (State - m (Deeds, Out FVedTerm))
 - Generaliser - State - Maybe (m (ResidTags, Deeds, Out 
FVedTerm))
-generaliseSplit opt gen state@(_deeds, heap, k, qa) = flip fmap 
(applyGeneraliser gen state) $ \generalised - recurse opt $ push generalised 
(heap, k, QAFocus qa)
+generaliseSplit opt gen state@(deeds, heap, k, qa) = flip fmap 
(applyGeneraliser gen state) $ \generalised - recurse opt $ push generalised 
(deeds, heap, k, QAFocus qa)
 
 
 recurse :: (Applicative m, Monad m)
@@ -449,6 +449,23 @@ test11 = \_ - f () + 1
 -}
 
 
+newtype DeedsA a = DeedsA { unDeedsA :: (Deeds, [Size], State [Deeds] a) }
+
+instance Functor DeedsA where
+fmap = liftA
+
+instance Applicative DeedsA where
+pure x = DeedsA (emptyDeeds, [], return x)
+DeedsA (deeds1, sizes1, mf) * DeedsA (deeds2, sizes2, mx) = DeedsA 
(deeds1 `mappend` deeds, sizes1 ++ sizes2, mf * mx)
+
+one :: Deeds - Size - DeedsA Deeds
+one deeds sz = DeedsA (deeds, [sz], state $ \(deeds:deedss) - (deeds, deedss))
+
+runDeedsA :: DeedsA a - a
+runDeedsA (DeedsA (deeds, sizes, mx)) = x
+  where ([], x) = runState mx (splitDeeds deeds sizes)
+
+
 data PushFocus qa term = QAFocus qa
| TermFocus term
| OpaqueFocus FVedTerm
@@ -460,12 +477,36 @@ type PushedValue = Tagged (Coerced (ValueG State))
 type PushedQA= Tagged (QAG (ValueG State))
 type PushedFocus = PushFocus PushedQA State
 
+traversePushedState :: Applicative t = (State - t State)
+- (PushedHeap, PushedStack, PushedFocus) - t 
(PushedHeap, 

[commit: ghc] supercompiler: Trace upon rollback (8bb16db)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/8bb16db29609438805c6e541cc3942fc3cd882ee

---

commit 8bb16db29609438805c6e541cc3942fc3cd882ee
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Nov 14 15:14:59 2012 +

Trace upon rollback

---

 .../supercompile/Supercompile/Drive/Process3.hs|2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index 53bd689..1331952 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -271,7 +271,7 @@ terminateM :: String - State - (forall b. RollbackState 
- ScpM b) - ScpM a -
 terminateM h state rb mcont mstop = ScpM $ StateT $ \s - ReaderT $ \env - 
case ({-# SCC terminate #-} terminate (if hISTORY_TREE then 
scpProcessHistoryEnv env else scpProcessHistoryState s) (scpNodeKey env, (h, 
state, rb))) of
 Stop (_, (shallow_h, shallow_state, shallow_rb))
   - trace (stops:  ++ show (scpStopCount env)) $
- unReaderT (unStateT (unScpM (mstop shallow_h shallow_state 
shallow_rb)) s)  (env { scpStopCount = 
scpStopCount env + 1})
+ unReaderT (unStateT (unScpM (mstop shallow_h shallow_state (\x - 
trace (back to  ++ show shallow_h) (shallow_rb x s)   
   (env { scpStopCount = scpStopCount env + 1})
 Continue hist'
   - unReaderT (unStateT (unScpM mcont)
  (s { scpProcessHistoryState = hist' })) (env { scpNodeKey = generatedKey 
hist', scpProcessHistoryEnv = hist' })
   -- TODO: record the names of the h-functions on the way to the current one 
instead of a Int depth



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Small tweaks including turning on positive info by default (6bdefd8)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6bdefd8d7b17bb61980e39f31656c6ce18e93876

---

commit 6bdefd8d7b17bb61980e39f31656c6ce18e93876
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Nov 15 11:12:40 2012 +

Small tweaks including turning on positive info by default

 compiler/supercompile/Supercompile.hs  |   46 ---
 compiler/supercompile/Supercompile/Core/Syntax.hs  |   24 ++-
 .../supercompile/Supercompile/Drive/Process.hs |   18 +---
 .../supercompile/Supercompile/Drive/Process3.hs|   29 ++---
 .../Supercompile/Evaluator/Evaluate.hs |6 +++
 compiler/supercompile/Supercompile/StaticFlags.hs  |2 +-
 6 files changed, 92 insertions(+), 33 deletions(-)


Diff suppressed because of size. To see it, use:

git show 6bdefd8d7b17bb61980e39f31656c6ce18e93876

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Fix a small but critcal error in MSG (6d30d1c)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6d30d1c064f8220b18c629bbba84e204458e9acc

---

commit 6d30d1c064f8220b18c629bbba84e204458e9acc
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Oct 31 11:24:48 2012 +

Fix a small but critcal error in MSG

 compiler/supercompile/Supercompile/Drive/MSG.hs |   60 ++-
 1 files changed, 37 insertions(+), 23 deletions(-)


Diff suppressed because of size. To see it, use:

git show 6d30d1c064f8220b18c629bbba84e204458e9acc

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Make the speculation flag work properly (f2b4a3f)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/f2b4a3f7bfbbb51d927b61ec7251ba387132e385

---

commit f2b4a3f7bfbbb51d927b61ec7251ba387132e385
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Nov 16 14:10:56 2012 +

Make the speculation flag work properly

---

 .../supercompile/Supercompile/Drive/Process.hs |3 ++-
 .../supercompile/Supercompile/Drive/Process1.hs|2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process.hs 
b/compiler/supercompile/Supercompile/Drive/Process.hs
index 5f9dcbd..c7727b0 100644
--- a/compiler/supercompile/Supercompile/Drive/Process.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process.hs
@@ -696,7 +696,8 @@ nothingSpeculated = S.empty
 -- FIXME: if I speculate roughly in dependency order then GHCs inlining 
heuristics will have more information
 -- to work with in the reduce invocations
 speculate :: AlreadySpeculated - (SCStats, State) - (AlreadySpeculated, 
(SCStats, State))
-speculate speculated (stats, (deeds, heap, k, in_e)) = (speculated', (stats', 
(deeds', heap', k, in_e)))
+speculate speculated (stats, state) | not sPECULATION = (speculated,  (stats, 
state))
+speculate speculated (stats, (deeds, heap, k, in_e))  = (speculated', (stats', 
(deeds', heap', k, in_e)))
   where (speculated', (stats', deeds', heap')) = speculateHeap speculated 
(stats, deeds, heap)
 
 --type SpecRB = SpecHistory - SpecM (SpecHistory, Deeds, Heap)
diff --git a/compiler/supercompile/Supercompile/Drive/Process1.hs 
b/compiler/supercompile/Supercompile/Drive/Process1.hs
index 09cb6b2..323b0ae 100644
--- a/compiler/supercompile/Supercompile/Drive/Process1.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process1.hs
@@ -454,7 +454,7 @@ sc' hist speculated state = handlePrint $ (\raise - check 
raise) `catchScpM` \g
 continue hist = do traceRenderScpM reduce end (continue) (PrettyDoc 
(pPrintFullState quietStatePrettiness state'))
addStats stats
liftM (\(_, deeds, e') - (deeds, e')) $ split state' 
(liftPB . sc hist speculated')
-  where (speculated', (stats, state')) = (if sPECULATION then speculate 
speculated else ((,) speculated)) $ reduceWithStats state -- TODO: experiment 
with doing admissability-generalisation on reduced terms. My suspicion is that 
it won't help, though (such terms are already stuck or non-stuck but loopy: 
throwing stuff away does not necessarily remove loopiness).
+  where (speculated', (stats, state')) = speculate speculated $ 
reduceWithStats state -- TODO: experiment with doing 
admissability-generalisation on reduced terms. My suspicion is that it won't 
help, though (such terms are already stuck or non-stuck but loopy: throwing 
stuff away does not necessarily remove loopiness).
 
 memo :: (AlreadySpeculated - State - ScpBM (Deeds, Out FVedTerm))
  -  AlreadySpeculated - State - ScpPM (Deeds, Out FVedTerm)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] branch 'supercompiler' created

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

New branch : supercompiler
Referencing: 270c8d8ae5c349c7c2fe35d861346c5c77535a91

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Ignore common OS junk (d77043e)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/d77043e57f3c2a6e738df300b4e8aab1757a0a0b

---

commit d77043e57f3c2a6e738df300b4e8aab1757a0a0b
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Sun Mar 11 20:08:06 2012 +

Ignore common OS junk

---

 .gitignore |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 694c606..34a69a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
+# OS junk
+Thumbs.db
+.DS_Store
+
 # Generated file patterns
 *.o
 *.hi



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Allow MSG to generalise occurrence info (5ff6887)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/5ff68875f73bd52faa3fe94631aab4cb2c05a70b

---

commit 5ff68875f73bd52faa3fe94631aab4cb2c05a70b
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Nov 16 14:11:36 2012 +

Allow MSG to generalise occurrence info

---

 .../supercompile/Supercompile/Drive/Process3.hs|   44 +--
 1 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Drive/Process3.hs 
b/compiler/supercompile/Supercompile/Drive/Process3.hs
index 2a902bb..7ceef75 100644
--- a/compiler/supercompile/Supercompile/Drive/Process3.hs
+++ b/compiler/supercompile/Supercompile/Drive/Process3.hs
@@ -287,7 +287,7 @@ sc' :: Maybe String - State - ScpM (Bool, (Deeds, 
FVedTerm)) -- Bool records w
 sc' mb_h state = {- pprTrace sc' (trce1 state) $ -} {-# SCC sc' #-} case 
mb_h of
   Nothing - speculateM (reduce state) $ \state - -- traceRenderM !sc 
(PrettyDoc (pPrintFullState quietStatePrettiness state)) 
my_split state
-  Just h  - flip catchM try_generalise $ \rb -
+  Just h  - flip catchM my_generalise $ \rb -
terminateM h state rb
  (speculateM (reduce state) $ \state - my_split state)
  (\shallow_h shallow_state shallow_rb - trce shallow_h 
shallow_state $ do
@@ -296,11 +296,9 @@ sc' mb_h state = {- pprTrace sc' (trce1 state) $ -} {-# 
SCC sc' #-} case mb_
case mb_shallow_gen 
of
  Just shallow_gen 
| sC_ROLLBACK   - trace sc-stop(rb,gen)   $ shallow_rb shallow_gen
  Nothing | 
sC_ROLLBACK, Nothing - mb_gen - trace sc-stop(rb,split) $ shallow_rb (split 
sc shallow_state)
- _ - case mb_gen 
of Just gen - trace sc-stop(gen)  $ try_generalise gen
-   
  Nothing  - trace sc-stop(split)$ try_generalise (split sc 
state))
+ _ - case mb_gen 
of Just gen - trace sc-stop(gen)  $ my_generalise gen
+   
  Nothing  - trace sc-stop(split)$ my_generalise (split sc 
state))
   where
-try_generalise gen = my_generalise gen
-
 -- FIXME: the could have tied back case is reachable (e.g. exp3_8 with 
unfoldings as internal bindings), and it doesn't appear to be
 -- because of dumped promises (no dumped in output). I'm reasonably sure 
this should not happen :(
 trce shallow_h shallow_state = pprTraceSC (Embedding: ++ shallow_h)
@@ -325,6 +323,41 @@ tryTaG opt shallow_state state = bothWays (\_ - 
generaliseSplit opt gen) shallo
   where gen = mK_GENERALISER shallow_state state
 
 -- NB: this cannot return (Just, Nothing)
+tryMSG opt shallow_state state = case msgMaybe mode shallow_state state of
+-- If we fail this way round, we should certainly fail the other way round 
too
+Nothing - (Nothing, Nothing)
+Just msg_result@(Pair l r, _)
+  | let Just msg_result_sym = msgMaybe mode state shallow_state -- Will 
certainly succeed, but with tags of shallow_state
+  - pprTrace MSG success (pprMSGResult msg_result) $ -- NB: pretty 
print MSG the correct way around even if we roll back
+ case (trivialMSG l, trivialMSG r) of
+   -- Both trivial: we have certainly discovered a variable 
generalisation (not an instance match, or we would have tied back)
+   -- Perhaps ideally we would just SC our deep state normally, but 
that is awkward. Instead we will rollback and generalise,
+   -- but it might be unsafe to generalise without rolling back (we 
might not be throwing any info away)
+   (True, True)   - (Just (genFrom msg_result_sym), Nothing)
+   -- Trivial on the LHS only: probably an instance match. Unsafe to 
roll back because we might not throw any info away.
+   (True, False)  - (Nothing,   Just (genFrom 
msg_result))
+   -- Trivial on the RHS only: kind of weird. Perhaps ideally we would 
just reduce+split our deep state normally, but it's a bit
+   -- awkward to arrange that. Instead we will accept generalising the 
earlier state.
+   (False, True)  - (Just (genFrom msg_result_sym), Nothing)
+   -- Non-trivial on both sides: can either rollback or not, doesn't 
matter. We throw away info either way.
+   (False, False) - (Just (genFrom msg_result_sym), Just (genFrom 
msg_result))
+
+  where

[commit: ghc] supercompiler: Last bug fixes and flag additions. (08e33ed)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/08e33edf20e2274b1266b4809ecea5678014b0a3

---

commit 08e33edf20e2274b1266b4809ecea5678014b0a3
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Dec 6 16:31:49 2012 +

Last bug fixes and flag additions.

 compiler/supercompile/Supercompile/Drive/MSG.hs|   13 +-
 .../supercompile/Supercompile/Drive/Process.hs |4 +-
 .../supercompile/Supercompile/Drive/Process3.hs|   23 +--
 compiler/supercompile/Supercompile/Drive/Split.hs  |2 +-
 compiler/supercompile/Supercompile/Drive/Split2.hs |2 +-
 .../Supercompile/Evaluator/Evaluate.hs |   19 +++-
 compiler/supercompile/Supercompile/GHC.hs  |2 +-
 compiler/supercompile/Supercompile/StaticFlags.hs  |   15 ++--
 8 files changed, 62 insertions(+), 18 deletions(-)


Diff suppressed because of size. To see it, use:

git show 08e33edf20e2274b1266b4809ecea5678014b0a3

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Add module size to nofib output (6f57cbc)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6f57cbc98bd84ecc8addd16923c58b28ac8f0f9d

---

commit 6f57cbc98bd84ecc8addd16923c58b28ac8f0f9d
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Nov 15 11:10:14 2012 +

Add module size to nofib output

---

 nofib-analyse/Main.hs  |   19 ---
 nofib-analyse/Slurp.hs |8 +++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/nofib-analyse/Main.hs b/nofib-analyse/Main.hs
index ed9234b..4e87ac1 100644
--- a/nofib-analyse/Main.hs
+++ b/nofib-analyse/Main.hs
@@ -27,6 +27,9 @@ import Data.List
 -
 -- Top level stuff
 
+mAX_PROG_NAME_LENGTH :: Int
+mAX_PROG_NAME_LENGTH  = 20
+
 die :: String - IO a
 die s = hPutStr stderr s  exitWith (ExitFailure 1)
 
@@ -114,12 +117,13 @@ data PerModuleTableSpec =
 (a - Bool) -- Result within reasonable limits?
 
 -- The various per-program aspects of execution that we can generate results 
for.
-size_spec, alloc_spec, runtime_spec, elapsedtime_spec, muttime_spec, 
mutetime_spec,
+size_spec, modsize_spec, alloc_spec, runtime_spec, elapsedtime_spec, 
muttime_spec, mutetime_spec,
 gctime_spec, gcelap_spec,
 gcwork_spec, instrs_spec, mreads_spec, mwrite_spec, cmiss_spec,
 gc0time_spec, gc0elap_spec, gc1time_spec, gc1elap_spec, balance_spec, 
totmem_spec
 :: PerProgTableSpec
 size_spec= SpecP Binary Sizes Size binary-sizes binary_size 
compile_status always_ok
+modsize_spec = SpecP Module Sizes ModSize module-sizes total_module_size 
compile_status always_ok
 alloc_spec   = SpecP Allocations Allocs allocations (meanInt allocs) 
run_status always_ok
 runtime_spec = SpecP Run Time Runtime run-times (mean run_time) 
run_status mean_time_ok
 elapsedtime_spec = SpecP Elapsed Time Elapsed elapsed-times (mean 
elapsed_time) run_status mean_time_ok
@@ -144,6 +148,7 @@ totmem_spec   = SpecP Total Memory in use TotalMem 
total-mem (meanInt tota
 all_specs :: [PerProgTableSpec]
 all_specs = [
   size_spec,
+  modsize_spec,
   alloc_spec,
   runtime_spec,
   elapsedtime_spec,
@@ -211,7 +216,7 @@ checkTimes prog results = do
 -- These are the per-prog tables we want to generate
 per_prog_result_tab :: [PerProgTableSpec]
 per_prog_result_tab =
-[ size_spec, alloc_spec, runtime_spec, elapsedtime_spec, muttime_spec, 
mutetime_spec, gctime_spec,
+[ size_spec, modsize_spec, alloc_spec, runtime_spec, elapsedtime_spec, 
muttime_spec, mutetime_spec, gctime_spec,
   gcelap_spec, gc0count_spec, gc0time_spec, gc0elap_spec, 
gc1count_spec, gc1time_spec, gc1elap_spec,
   gcwork_spec, balance_spec, instrs_spec, mreads_spec, mwrite_spec, 
cmiss_spec, totmem_spec]
 
@@ -219,11 +224,11 @@ per_prog_result_tab =
 -- aspects, each in its own column.  Only works when comparing two runs.
 normal_summary_specs :: [PerProgTableSpec]
 normal_summary_specs =
-[ size_spec, alloc_spec, runtime_spec, elapsedtime_spec, totmem_spec ]
+[ size_spec, modsize_spec, alloc_spec, runtime_spec, elapsedtime_spec, 
totmem_spec ]
 
 cachegrind_summary_specs :: [PerProgTableSpec]
 cachegrind_summary_specs =
-[ size_spec, alloc_spec, instrs_spec, mreads_spec, mwrite_spec ]
+[ size_spec, modsize_spec, alloc_spec, instrs_spec, mreads_spec, 
mwrite_spec ]
 
 -- Pick an appropriate summary table: if we're cachegrinding, then
 -- we're probably not interested in the runtime, but we are interested
@@ -517,7 +522,7 @@ asciiGenModTable results args (SpecM long_name _ get_result 
result_ok)
 ascii_header :: Int - [String] - ShowS
 ascii_header w ss
 = str 
\n---\n
-. str (rjustify 15 Program)
+. str (rjustify mAX_PROG_NAME_LENGTH Program)
 . str (space 5)
 . foldr (.) id (map (str . rjustify w) ss)
 . str 
\n---\n
@@ -617,7 +622,7 @@ mungeForLaTeX = map transrow
 
 table_layout :: Int - Int - Layout
 table_layout n w boxes = foldr (.) id $ zipWith ($) fns boxes
- where fns = (str . rjustify 15 . show ) :
+ where fns = (str . rjustify mAX_PROG_NAME_LENGTH . show ) :
  (\s - str (space 5) . str (rjustify w (show s))) :
  replicate (n-1) (str . rjustify w . show)
 
@@ -678,7 +683,7 @@ show_per_prog_results = show_per_prog_results_width 
fIELD_WIDTH
 
 show_per_prog_results_width :: Int - (String, [BoxValue]) - ShowS
 show_per_prog_results_width w (prog,results)
-= str (rjustify 15 prog)
+= str (rjustify mAX_PROG_NAME_LENGTH prog)
 . str (space 5)
 . foldr (.) id (map (str . rjustify w . showBox) results)
 

[commit: ghc] supercompiler: Correct top-level renaming in MSG to prevent loop (5fa43dc)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/5fa43dc8cf6a2aef566b6c51780ada1ec4ebc32e

---

commit 5fa43dc8cf6a2aef566b6c51780ada1ec4ebc32e
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Nov 14 15:14:50 2012 +

Correct top-level renaming in MSG to prevent loop

 compiler/supercompile/Supercompile/Drive/MSG.hs |   46 ---
 1 files changed, 32 insertions(+), 14 deletions(-)


Diff suppressed because of size. To see it, use:

git show 5fa43dc8cf6a2aef566b6c51780ada1ec4ebc32e

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Change how default supercompliation options are setup (9812ada)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/9812ada23b048da81416daf08494b75ae0bf48d2

---

commit 9812ada23b048da81416daf08494b75ae0bf48d2
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Mar 15 09:01:07 2012 +

Change how default supercompliation options are setup

---

 mk/ghc-opts.mk |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/mk/ghc-opts.mk b/mk/ghc-opts.mk
index 15ab620..6aa2ffd 100644
--- a/mk/ghc-opts.mk
+++ b/mk/ghc-opts.mk
@@ -59,9 +59,7 @@ endif
 
 # All the standard gluing together, as in the comment right at the front
 
-ifeq $(SRC_SUPERCOMP_HC_OPTS 
 SRC_SUPERCOMP_HC_OPTS = -fsupercompiler-bound-steps
-endif
 
 HC_OPTS= $(BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS) $(SRC_HC_OPTS) 
$(WAY$(_way)_HC_OPTS) $($*_HC_OPTS) $(EXTRA_HC_OPTS)
 ifeq $(HC_VERSION_GE_6_13) YES



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Complete Deeds threading in Split2 (08b7320)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/08b73205fd3b06deffe9994131ae5d8bf7b4e1a8

---

commit 08b73205fd3b06deffe9994131ae5d8bf7b4e1a8
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Nov 1 17:22:34 2012 +

Complete Deeds threading in Split2

 compiler/supercompile/Supercompile/Core/Syntax.hs  |   10 ++-
 compiler/supercompile/Supercompile/Drive/Split2.hs |   95 
 .../supercompile/Supercompile/Evaluator/Syntax.hs  |7 ++
 compiler/supercompile/Supercompile/Utilities.hs|8 ++
 4 files changed, 83 insertions(+), 37 deletions(-)


Diff suppressed because of size. To see it, use:

git show 08b73205fd3b06deffe9994131ae5d8bf7b4e1a8

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Tweaks to benchmarks, more benchmarks (ddc87cc)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/ddc87ccb2620e7588c2c26f260963536bef8427e

---

commit ddc87ccb2620e7588c2c26f260963536bef8427e
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Nov 15 11:11:53 2012 +

Tweaks to benchmarks, more benchmarks

 imaginary/tak/Makefile |3 +-
 supercompile/neil/Makefile |2 +-
 supercompile/neil/SumSquare-Explicit/Main.hs   |   22 
 .../Makefile   |0 
 .../SumSquare-Explicit.stdout} |0 
 supercompile/peter/Append/Main.hs  |7 -
 supercompile/peter/Raytracer/Main.hs   |7 -
 supercompile/peter/ZipMaps/Main.hs |7 -
 supercompile/toys/AccumulatingParam/Main.hs|6 
 supercompile/toys/Makefile |2 +-
 supercompile/toys/MapMapFusion/Main.hs |7 -
 supercompile/toys/queens-explicit/Main.hs  |   27 
 .../toys/queens-explicit}/Makefile |2 +-
 .../queens-explicit/queens-explicit.slowstdout |0 
 .../toys/queens-explicit/queens-explicit.stdout|0 
 15 files changed, 84 insertions(+), 8 deletions(-)


Diff suppressed because of size. To see it, use:

git show ddc87ccb2620e7588c2c26f260963536bef8427e

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Playing with Bernouilli (b65222f)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/b65222fb4962b04f0827ed89e498ad44a5e15671

---

commit b65222fb4962b04f0827ed89e498ad44a5e15671
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Mar 15 09:58:43 2012 +

Playing with Bernouilli

---

 imaginary/bernouilli/Main.hs  |1 +
 imaginary/bernouilli/Makefile |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/imaginary/bernouilli/Main.hs b/imaginary/bernouilli/Main.hs
index 5886c67..dde0756 100644
--- a/imaginary/bernouilli/Main.hs
+++ b/imaginary/bernouilli/Main.hs
@@ -22,6 +22,7 @@ neg_powers =
 pascal:: [[Integer]]
 pascal = [1,2,1] : map (\line - zipWith (+) (line++[0]) (0:line)) pascal
 
+{-# SUPERCOMPILE bernoulli #-}
 bernoulli 0 = 1
 bernoulli 1 = -(1%2)   
 bernoulli n | odd n = 0
diff --git a/imaginary/bernouilli/Makefile b/imaginary/bernouilli/Makefile
index 56dd57c..cf5295a 100644
--- a/imaginary/bernouilli/Makefile
+++ b/imaginary/bernouilli/Makefile
@@ -6,5 +6,7 @@ include $(TOP)/mk/boilerplate.mk
 SRCS=Main.hs
 PROG_ARGS += 500
 
+SRC_SUPERCOMP_HC_OPTS =
+
 include $(TOP)/mk/target.mk
 



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Considerable benchmark tweaking (6f01206)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/6f01206bd1036ec0f5b7a7d8cf46d73d2f375d94

---

commit 6f01206bd1036ec0f5b7a7d8cf46d73d2f375d94
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Wed Nov 14 12:57:36 2012 +

Considerable benchmark tweaking

 Makefile   |2 +-
 imaginary/wheel-sieve1/Makefile|3 +-
 supercompile/neil/Makefile |5 +++-
 supercompile/neil/SumSquare-LazySum/Makefile   |2 +
 supercompile/neil/SumSquare/Makefile   |2 +
 supercompile/peter/Append/Makefile |4 ++-
 supercompile/peter/Factorial/Main.hs   |   10 
 supercompile/peter/Factorial/Makefile  |8 --
 supercompile/peter/Makefile|2 +-
 supercompile/peter/Raytracer/Main.hs   |   10 +++
 supercompile/peter/Raytracer/Makefile  |4 ++-
 supercompile/peter/SumTree/Makefile|4 ++-
 supercompile/peter/TreeFlip/Makefile   |4 ++-
 supercompile/peter/ZipMaps/Main.hs |   10 +--
 supercompile/peter/ZipMaps/Makefile|6 
 supercompile/peter/ZipMaps/ZipMaps.stdout  |2 +-
 supercompile/peter/ZipTreeMaps/Main.hs |   22 ++--
 supercompile/peter/ZipTreeMaps/Makefile|6 
 supercompile/peter/ZipTreeMaps/ZipTreeMaps.stdout  |2 +-
 .../AccumulatingParam-Peano.stdout |2 +-
 supercompile/toys/AccumulatingParam-Peano/Makefile |8 --
 .../AccumulatingParam/AccumulatingParam.stdout |2 +-
 supercompile/toys/AccumulatingParam/Main.hs|6 -
 supercompile/toys/AccumulatingParam/Makefile   |6 
 supercompile/toys/Ackermann/Ackermann.stdout   |2 +-
 supercompile/toys/Ackermann/Main.hs|4 ++-
 supercompile/toys/Ackermann/Makefile   |6 
 .../toys/AckermannPeano-1/AckermannPeano-1.stdout  |2 +-
 supercompile/toys/AckermannPeano-1/Main.hs |   14 ++-
 supercompile/toys/AckermannPeano-1/Makefile|6 
 supercompile/toys/AckermannPeano-2/Main.hs |   14 ++-
 supercompile/toys/AckermannPeano-2/Makefile|6 
 supercompile/toys/AppendAssociativity/Makefile |2 +
 supercompile/toys/AppendRightUnit/Makefile |2 +
 supercompile/toys/EvenDouble/Main.hs   |   10 +++-
 supercompile/toys/EvenDouble/Makefile  |6 
 supercompile/toys/EvenDoubleGenerator/Main.hs  |   10 +++-
 supercompile/toys/EvenDoubleGenerator/Makefile |6 
 supercompile/toys/FoldlSpecialisation/Makefile |2 +
 supercompile/toys/Generalisation-Lazy/Makefile |2 +
 .../toys/Generalisation-Literals-Lazy/Makefile |2 +
 supercompile/toys/Generalisation-Literals/Makefile |2 +
 .../toys/Generalisation/Generalisation.stdout  |2 +-
 supercompile/toys/Generalisation/Main.hs   |   10 +++-
 supercompile/toys/Generalisation/Makefile  |6 
 supercompile/toys/KMP/Main.hs  |6 -
 supercompile/toys/KMP/Makefile |6 
 supercompile/toys/LetRec/LetRec.stdout |2 +-
 supercompile/toys/LetRec/Main.hs   |   26 +++
 supercompile/toys/LetRec/Makefile  |6 
 supercompile/toys/Makefile |   11 +++-
 supercompile/toys/MapMapFusion/Main.hs |   14 +++---
 supercompile/toys/MapMapFusion/Makefile|6 
 supercompile/toys/MapMapFusion/MapMapFusion.stdout |2 +-
 supercompile/toys/ReverseReverse/Main.hs   |6 -
 supercompile/toys/ReverseReverse/Makefile  |6 
 .../toys/ReverseReverse/ReverseReverse.stdout  |2 +-
 supercompile/toys/SpeculationWorstCase/Makefile|2 +
 .../toys/StrictFoldlSpecialisation/Makefile|2 +
 59 files changed, 290 insertions(+), 55 deletions(-)


Diff suppressed because of size. To see it, use:

git show 6f01206bd1036ec0f5b7a7d8cf46d73d2f375d94

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Make subset of supercompile-folder benchmarks compile and run correctly, fix SC opts for other benchmarks (87c35a0)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/87c35a015f8adb7c0ae4d5329d115d7b994e2250

---

commit 87c35a015f8adb7c0ae4d5329d115d7b994e2250
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Nov 9 15:04:09 2012 +

Make subset of supercompile-folder benchmarks compile and run correctly, 
fix SC opts for other benchmarks

 imaginary/bernouilli/Main.hs   |3 ++-
 imaginary/digits-of-e1/Makefile|2 ++
 imaginary/digits-of-e2/Makefile|2 ++
 imaginary/exp3_8/Makefile  |2 ++
 imaginary/gen_regexps/Makefile |3 +++
 imaginary/integrate/Makefile   |2 ++
 imaginary/paraffins/Makefile   |3 +++
 imaginary/primes/Makefile  |2 ++
 imaginary/queens/Makefile  |2 ++
 imaginary/rfib/Makefile|2 ++
 imaginary/tak/Makefile |2 ++
 imaginary/wheel-sieve1/Makefile|2 ++
 imaginary/wheel-sieve2/Makefile|3 +++
 imaginary/x2n1/Makefile|2 ++
 mk/target.mk   |2 +-
 supercompile/Makefile  |4 +++-
 supercompile/neil/SumSquare-LazySum/Main.hs|3 +--
 supercompile/neil/SumSquare/Main.hs|7 ++-
 supercompile/neil/SumSquare/SumSquare.stdout   |2 +-
 supercompile/peter/Append/Main.hs  |2 +-
 supercompile/peter/Factorial/Factorial.stdout  |2 +-
 supercompile/peter/Factorial/Makefile  |2 ++
 supercompile/peter/Raytracer/Main.hs   |4 ++--
 supercompile/peter/TreeFlip/Main.hs|2 ++
 supercompile/peter/ZipMaps/Main.hs |3 ++-
 supercompile/peter/ZipMaps/ZipMaps.stdout  |2 +-
 supercompile/peter/ZipTreeMaps/Main.hs |3 ++-
 supercompile/peter/ZipTreeMaps/ZipTreeMaps.stdout  |2 +-
 supercompile/toys/AccumulatingParam-Peano/Main.hs  |   13 -
 supercompile/toys/AccumulatingParam/Main.hs|2 +-
 supercompile/toys/Ackermann/Ackermann.stdout   |2 +-
 supercompile/toys/Ackermann/Main.hs|4 +---
 supercompile/toys/Ackermann/Makefile   |4 
 supercompile/toys/AckermannPeano-1/Main.hs |2 +-
 supercompile/toys/AckermannPeano-2/Main.hs |3 ++-
 supercompile/toys/EvenDouble/Main.hs   |2 ++
 supercompile/toys/EvenDoubleGenerator/Main.hs  |2 ++
 .../FoldlSpecialisation/FoldlSpecialisation.stdout |2 +-
 supercompile/toys/FoldlSpecialisation/Main.hs  |2 ++
 supercompile/toys/Generalisation-Literals/Main.hs  |4 ++--
 supercompile/toys/Generalisation/Main.hs   |4 ++--
 supercompile/toys/LetRec/LetRec.stdout |2 +-
 supercompile/toys/MapMapFusion/Main.hs |2 +-
 supercompile/toys/MapMapFusion/MapMapFusion.stdout |2 +-
 .../toys/ReverseReverse/ReverseReverse.stdout  |2 +-
 .../toys/StrictFoldlSpecialisation/Main.hs |2 --
 46 files changed, 90 insertions(+), 38 deletions(-)


Diff suppressed because of size. To see it, use:

git show 87c35a015f8adb7c0ae4d5329d115d7b994e2250

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] supercompiler: Ensure wrappers are SUPERINLINABLE (61f74db)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/61f74db90cba9d4e5b9d9a9207f1cba6311dc0ff

---

commit 61f74db90cba9d4e5b9d9a9207f1cba6311dc0ff
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Fri Nov 16 14:11:22 2012 +

Ensure wrappers are SUPERINLINABLE

---

 compiler/supercompile/Supercompile.hs  |1 +
 .../Supercompile/Evaluator/Evaluate.hs |3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/compiler/supercompile/Supercompile.hs 
b/compiler/supercompile/Supercompile.hs
index 4dad93c..ae08183 100644
--- a/compiler/supercompile/Supercompile.hs
+++ b/compiler/supercompile/Supercompile.hs
@@ -191,6 +191,7 @@ termUnfoldings {-mod_finder-} e = go (S.termFreeVars e) 
emptyVarSet [] []
 -- We still do check shouldExposeUnfolding here because we can avoid 
parsing+tagging those unfoldings
 -- which can literall never be used.
 varUnfolding x
+  -- NB: probably want to ensure these are all considered superinlinable 
by shouldExposeUnfolding for the evaluator
   | Just pop - isPrimOpId_maybe x = Right $ primOpUnfolding pop
   | Just dc - isDataConWorkId_maybe x = dataUnfolding dc
   | otherwise  = case S.shouldExposeUnfolding x of
diff --git a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs 
b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
index fe196cf..d3556bf 100644
--- a/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
+++ b/compiler/supercompile/Supercompile/Evaluator/Evaluate.hs
@@ -562,6 +562,9 @@ shouldExposeUnfolding x = case inl_inline inl_prag of
 _ | Just mod - nameModule_maybe (idName x)
   , moduleName mod `elem` map mkModuleName [Data.Complex, GHC.List]
   - Right True
+-- These get wrappers generated for them: be very eager to inline the 
wrappers
+  | isPrimOpId x || isDataConWorkId x
+  - Right True
 -- NB: we don't check the activation on INLINE things because so many 
activations
 -- are used to ensure that e.g. RULE-based fusion works properly, and 
NOINLINE will
 -- generally impede supercompiler-directed fusion.



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: Ad-hoc nofib-analyse changes and SUPERCOMP_HC_OPTS (270c8d8)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/270c8d8ae5c349c7c2fe35d861346c5c77535a91

---

commit 270c8d8ae5c349c7c2fe35d861346c5c77535a91
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Thu Dec 6 16:33:09 2012 +

Ad-hoc nofib-analyse changes and SUPERCOMP_HC_OPTS

 imaginary/Makefile  |4 +---
 nofib-analyse/Main.hs   |   24 ++--
 nofib-analyse/Slurp.hs  |7 ++-
 spectral/ansi/Makefile  |2 ++
 spectral/atom/Makefile  |2 ++
 spectral/awards/Makefile|1 +
 spectral/awards/QSort.hs|1 +
 spectral/banner/Makefile|2 ++
 spectral/boyer/Makefile |2 ++
 spectral/boyer2/Makefile|2 ++
 spectral/calendar/Makefile  |2 ++
 spectral/cichelli/Makefile  |2 ++
 spectral/circsim/Makefile   |2 ++
 spectral/clausify/Makefile  |2 ++
 spectral/constraints/Makefile   |2 ++
 spectral/cryptarithm1/Makefile  |2 ++
 spectral/cryptarithm2/Makefile  |2 ++
 spectral/cse/Makefile   |2 ++
 spectral/eliza/Makefile |2 ++
 spectral/expert/Makefile|2 ++
 spectral/fft2/Makefile  |2 ++
 spectral/fibheaps/Makefile  |2 ++
 spectral/fish/Makefile  |2 ++
 spectral/gcd/Makefile   |2 ++
 spectral/hartel/comp_lab_zift/Makefile  |2 ++
 spectral/hartel/event/Makefile  |2 ++
 spectral/hartel/fft/Makefile|2 ++
 spectral/hartel/genfft/Makefile |2 ++
 spectral/hartel/ida/Makefile|2 ++
 spectral/hartel/listcompr/Makefile  |2 ++
 spectral/hartel/listcopy/Makefile   |2 ++
 spectral/hartel/nucleic2/Makefile   |2 ++
 spectral/hartel/parstof/Makefile|2 ++
 spectral/hartel/sched/Makefile  |2 ++
 spectral/hartel/solid/Makefile  |2 ++
 spectral/hartel/transform/Makefile  |2 ++
 spectral/hartel/typecheck/Makefile  |2 ++
 spectral/hartel/wang/Makefile   |2 ++
 spectral/hartel/wave4main/Makefile  |2 ++
 spectral/integer/Makefile   |2 ++
 spectral/knights/Makefile   |2 ++
 spectral/lambda/Makefile|2 ++
 spectral/lcss/Makefile  |2 ++
 spectral/life/Makefile  |2 ++
 spectral/mandel/Makefile|2 ++
 spectral/mandel2/Makefile   |2 ++
 spectral/mate/Makefile  |2 ++
 spectral/minimax/Makefile   |2 ++
 spectral/multiplier/Makefile|2 ++
 spectral/para/Makefile  |2 ++
 spectral/power/Makefile |2 ++
 spectral/pretty/Makefile|2 ++
 spectral/primetest/Makefile |2 ++
 spectral/puzzle/Makefile|2 ++
 spectral/rewrite/Makefile   |2 ++
 spectral/scc/Makefile   |2 ++
 spectral/secretary/Makefile |2 ++
 spectral/simple/Makefile|2 ++
 spectral/sorting/Makefile   |2 ++
 spectral/sphere/Makefile|2 ++
 spectral/treejoin/Makefile  |2 ++
 spectral/triangle/Makefile  |2 ++
 supercompile/neil/Makefile  |6 --
 supercompile/toys/AccumulatingParam/Main.hs |2 +-
 supercompile/toys/Makefile  |4 +++-
 65 files changed, 149 insertions(+), 14 deletions(-)


Diff suppressed because of size. To see it, use:

git show 270c8d8ae5c349c7c2fe35d861346c5c77535a91

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: nofib] supercompiler: First draft of supercompilation nofib tests (5d0863d)

2012-12-06 Thread Max Bolingbroke
Repository : ssh://darcs.haskell.org//srv/darcs/nofib

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/5d0863d4afd518853e6c80b55112038fb12627c3

---

commit 5d0863d4afd518853e6c80b55112038fb12627c3
Author: Max Bolingbroke batterseapo...@hotmail.com
Date:   Sun Mar 11 20:07:37 2012 +

First draft of supercompilation nofib tests

 mk/ghc-opts.mk |6 +
 supercompile/Makefile  |5 +
 supercompile/compile-time/ConcatMapSpec/Main.hs|   30 
 supercompile/compile-time/ConcatMapSpec/Makefile   |6 +
 supercompile/compile-time/Makefile |5 +
 supercompile/compile-time/SimonSpec/Main.hs|   30 
 supercompile/compile-time/SimonSpec/Makefile   |6 +
 supercompile/contracts/Head-Contract/Main.hs   |   12 ++
 supercompile/contracts/Head-Contract/Makefile  |6 +
 .../contracts/IdList-SameLength-Koen/Main.hs   |  166 
 .../contracts/IdList-SameLength-Koen/Makefile  |6 +
 supercompile/contracts/IdList-SameLength/Main.hs   |   71 +
 supercompile/contracts/IdList-SameLength/Makefile  |6 +
 supercompile/contracts/Last-Contract/Main.hs   |   22 +++
 supercompile/contracts/Last-Contract/Makefile  |6 +
 supercompile/contracts/Makefile|5 +
 supercompile/contracts/Zip-Contract/Main.hs|  103 
 supercompile/contracts/Zip-Contract/Makefile   |6 +
 .../FilterMap-MapFilterCompose.stdout  |1 +
 .../ilya/FilterMap-MapFilterCompose/Main.hs|   15 ++
 .../ilya/FilterMap-MapFilterCompose/Makefile   |6 +
 .../Iterate-MapIterate/Iterate-MapIterate.stdout   |1 +
 supercompile/ilya/Iterate-MapIterate/Main.hs   |   13 ++
 supercompile/ilya/Iterate-MapIterate/Makefile  |6 +
 .../LengthConcat-SumMapLength.stdout   |1 +
 .../ilya/LengthConcat-SumMapLength/Main.hs |   20 +++
 .../ilya/LengthConcat-SumMapLength/Makefile|6 +
 supercompile/ilya/Makefile |5 +
 supercompile/ilya/Map-JoinComposeReturn/Main.hs|   16 ++
 supercompile/ilya/Map-JoinComposeReturn/Makefile   |6 +
 .../Map-JoinComposeReturn.stdout   |1 +
 supercompile/ilya/MapAppend-AppendMapMap/Main.hs   |   13 ++
 supercompile/ilya/MapAppend-AppendMapMap/Makefile  |6 +
 .../MapAppend-AppendMapMap.stdout  |1 +
 supercompile/ilya/MapCompose-ComposeMapMap/Main.hs |   13 ++
 .../ilya/MapCompose-ComposeMapMap/Makefile |6 +
 .../MapCompose-ComposeMapMap.stdout|1 +
 supercompile/ilya/MapConcat-ConcatMapMap/Main.hs   |   14 ++
 supercompile/ilya/MapConcat-ConcatMapMap/Makefile  |6 +
 .../MapConcat-ConcatMapMap.stdout  |1 +
 supercompile/jason/Explode/Explode.stdout  |1 +
 supercompile/jason/Explode/Main.hs |   11 ++
 supercompile/jason/Explode/Makefile|6 +
 supercompile/jason/Makefile|5 +
 supercompile/neil/Makefile |5 +
 supercompile/neil/SumSquare-LazySum/Main.hs|   11 ++
 supercompile/neil/SumSquare-LazySum/Makefile   |6 +
 .../SumSquare-LazySum/SumSquare-LazySum.stdout |1 +
 supercompile/neil/SumSquare/Main.hs|8 +
 supercompile/neil/SumSquare/Makefile   |6 +
 supercompile/neil/SumSquare/SumSquare.stdout   |1 +
 supercompile/peter/Append/Append.stdout|1 +
 supercompile/peter/Append/Main.hs  |   12 ++
 supercompile/peter/Append/Makefile |   10 ++
 supercompile/peter/Factorial/Factorial.stdout  |1 +
 supercompile/peter/Factorial/Main.hs   |   15 ++
 supercompile/peter/Factorial/Makefile  |   10 ++
 supercompile/peter/Makefile|5 +
 supercompile/peter/Raytracer/Main.hs   |   12 ++
 supercompile/peter/Raytracer/Makefile  |   10 ++
 supercompile/peter/Raytracer/Raytracer.stdout  |1 +
 supercompile/peter/SumTree/Main.hs |   30 
 supercompile/peter/SumTree/Makefile|   10 ++
 supercompile/peter/SumTree/SumTree.stdout  |1 +
 supercompile/peter/TreeFlip/Main.hs|   26 +++
 supercompile/peter/TreeFlip/Makefile   |   10 ++
 supercompile/peter/TreeFlip/TreeFlip.stdout|1 +
 supercompile/peter/ZipMaps/Main.hs |7 +
 supercompile/peter/ZipMaps/Makefile|6 +
 supercompile/peter/ZipMaps/ZipMaps.stdout  |1 +
 supercompile/peter/ZipTreeMaps/Main.hs |   17 ++
 supercompile/peter/ZipTreeMaps/Makefile|6 +
 supercompile/peter/ZipTreeMaps/ZipTreeMaps.stdout  |1 +
 .../AccumulatingParam-Peano.stdout

Re: GHC 7.6 failes to build

2012-12-06 Thread Ian Lynagh
On Thu, Dec 06, 2012 at 11:41:11PM +1100, Ben Lippmeier wrote:
 
  For vector and random the same questions apply, but since we simply have 
  lagging git repos for them we can create a ghc-7.6 branch.  Did you 
  deliberately not do that, Ian?
 
 I expect Ian didn't branch DPH because it's not his job to test it with the 
 GHC RC and ship it as part of the GHC source tarball. I can do the release 
 part, but if Ian branches DPH as well then it is effectively zero-overhead to 
 his existing workflow, and we won't hit this breakage again (I think?).

Right, I didn't branch them as we don't use them in the stable branch.
But I can make the branches for future stable branches if that's useful,
no problem.


Thanks
Ian


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: The end of an era, and the dawn of a new one

2012-12-06 Thread Johan Tibell
On Thu, Dec 6, 2012 at 8:32 AM, Ian Lynagh i...@well-typed.com wrote:
 Perhaps we could have maintainers instead?

If maintenance can be defined on a per-directory level we can put a
MAINTAINERS file in listing maintainers for a directory and all its
subdirectories. For example,

ghc/MAINTAINERS would contain
simonpj
simonmar

libraries/base/GHC/Event/MAINTAINERS would contain
tibbe
bos

ghc/compiler/llvmGen would contain
benl
davidterei

and so on. To find a maintainer (e.g. to send a request for code
review to) you follow the directory hierarchy upwards, starting from
the directory in which you want to make modifications, until you find
a MAINTAINERS file. You then pick one of the maintainers there and
assign the ticket with the attached code for them to review.

Perhaps this is a bit too involved given the number of people involved.

-- Johan

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: [commit: ghc] master: Stop attempting to trim data types in interface files (9a20e54)

2012-12-06 Thread Simon Peyton-Jones
|   Stop attempting to trim data types in interface files
| 
|   Without -O, we previously tried to make interface files smaller
|   by not including the data constructors of data types.  But
|   there are a lot of exceptions, notably when Template Haskell is
|   involved or, more recently, DataKinds.
| 
|   However Trac #7445 shows that even without TemplateHaskell, using
|   the Data class and invoking Language.Haskell.TH.Quote.dataToExpQ
|   is enough to require us to expose the data constructors.
| 
|   So I've given up on this optimisation -- it's probably not
|   important anyway.  Now I'm simply not attempting to trim off
|   the data constructors.  The gain in simplicity is worth the
|   modest cost in interface file growth, which is limited to the
|   bits reqd to describe those data constructors.
| 
| That's a shame - it wasn't so much a reduction in interface file size we
| gained by doing this, but less recompilation.  Oh well...

Good point.  But still, it's just too painful I think

Simon

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


RE: end of an era

2012-12-06 Thread Simon Peyton-Jones
Doug

I think that would be incredibly helpful, thank you!  Not meddling; rather 
contributing.

Simon

| -Original Message-
| From: Doug McIlroy [mailto:d...@cs.dartmouth.edu]
| Sent: 06 December 2012 17:05
| To: Simon Peyton-Jones
| Cc: d...@stowe.cs.dartmouth.edu
| Subject: Re: end of an era
| 
| This may not be exactly in the main line of GHC business, but it's a job
| that I've been thinking about volunteering for:
| improving the documentation of the base library.  What I see as
| difficult about this is that much comes from Haddock, and that means
| tinkering with the library source, which is somnewhat risky even though
| supposedly no code is touched.
| 
| It also means that when stuff is unduly complicated to explain, or
| simply the result of accident (like the order in which a set is
| presented), I see the job as entailing advocacy for possible changes in
| specification.
| 
| For an example of the kinds of improvements I have in mind, see my
| recent haskell-prime post (which alas evoked no response):
| http://www.haskell.org/pipermail/haskell-prime/2012-December/003767.html
| 
| Would my jumping in here be useful? Would meddling per the previous
| paragraph be welcome?
| 
| Doug McIlroy

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[nightly] 06-Dec-2012 build of HEAD (unreg) on x86_64-unknown-linux (cam-04-unx)

2012-12-06 Thread GHC Build Reports
Build description = HEAD (unreg) on x86_64-unknown-linux (cam-04-unx)
Build location= /64playpen/simonmar/nightly/HEAD-unreg-cam-04-unx
Build config file = /home/simonmar/nightly/site/msrc/conf-HEAD-unreg-cam-04-unx

Nightly build started on cam-04-unx at Thu Dec 6 18:20:01 GMT 2012.
 checking out new source tree ... warning: libraries/xhtml 
already present; omitting
Submodule 'libraries/Cabal' (http://darcs.haskell.org/libraries/Cabal.git/) 
registered for path 'libraries/Cabal'
Submodule 'libraries/Win32' (http://darcs.haskell.org/libraries/Win32.git/) 
registered for path 'libraries/Win32'
Submodule 'libraries/binary' (http://darcs.haskell.org/libraries/binary.git/) 
registered for path 'libraries/binary'
Submodule 'libraries/bytestring' 
(http://darcs.haskell.org/libraries/bytestring.git/) registered for path 
'libraries/bytestring'
Submodule 'libraries/containers' 
(http://darcs.haskell.org/libraries/containers.git/) registered for path 
'libraries/containers'
Submodule 'libraries/haskeline' 
(http://darcs.haskell.org/libraries/haskeline.git/) registered for path 
'libraries/haskeline'
Submodule 'libraries/pretty' (http://darcs.haskell.org/libraries/pretty.git/) 
registered for path 'libraries/pretty'
Submodule 'libraries/primitive' 
(http://darcs.haskell.org/libraries/primitive.git/) registered for path 
'libraries/primitive'
Submodule 'libraries/terminfo' 
(http://darcs.haskell.org/libraries/terminfo.git/) registered for path 
'libraries/terminfo'
Submodule 'libraries/time' (http://darcs.haskell.org/libraries/time.git/) 
registered for path 'libraries/time'
Submodule 'libraries/transformers' 
(http://darcs.haskell.org/libraries/transformers.git/) registered for path 
'libraries/transformers'
Submodule 'libraries/vector' (http://darcs.haskell.org/libraries/vector.git/) 
registered for path 'libraries/vector'
Submodule 'libraries/xhtml' (http://darcs.haskell.org/libraries/xhtml.git/) 
registered for path 'libraries/xhtml'
Cloning into 'libraries/Cabal'...
Submodule path 'libraries/Cabal': checked out 
'4b43bd95753e5f3e29d7bfbe6bba8477715ac296'
Cloning into 'libraries/Win32'...
Submodule path 'libraries/Win32': checked out 
'21335a30161c099da79ae9619c9782e5e32e4644'
Cloning into 'libraries/binary'...
Submodule path 'libraries/binary': checked out 
'2d31cea238d0d08885c457475fc354dbf2b88976'
Cloning into 'libraries/bytestring'...
Submodule path 'libraries/bytestring': checked out 
'6bd69fe27af33e878e38f4c579983f6a23120a87'
Cloning into 'libraries/containers'...
Submodule path 'libraries/containers': checked out 
'a9b7224068ae60f73baacd5f76d2c27624d90120'
Cloning into 'libraries/haskeline'...
Submodule path 'libraries/haskeline': checked out 
'6ee5fc8ccdee410486a826cadfb2a0a560d60506'
Cloning into 'libraries/pretty'...
Submodule path 'libraries/pretty': checked out 
'ab7e8d91470bb94c9e184dffbec89d0aae116f9b'
Cloning into 'libraries/primitive'...
Submodule path 'libraries/primitive': checked out 
'75c3379b6d76e914cc3c7ffd290b6b1cad7ea3e6'
Cloning into 'libraries/terminfo'...
Submodule path 'libraries/terminfo': checked out 
'579d2c324e69856ff8d1ea8b5036e30c920e1973'
Cloning into 'libraries/time'...
Submodule path 'libraries/time': checked out 
'c98806fe0c9cde7371452ec30fa2900d28d16b16'
Cloning into 'libraries/transformers'...
Submodule path 'libraries/transformers': checked out 
'a59fb93860f84ccd44178dcbbb82cfea7e02cd07'
Cloning into 'libraries/vector'...
Submodule path 'libraries/vector': checked out 
'c4c5a740ec977a4300449bc85f4707ec641be923'
Cloning into 'libraries/xhtml'...
Submodule path 'libraries/xhtml': checked out 
'fb9e0bbb69e15873682a9f25d39652099a3ccac1'
ok.
 Building stage 1 compiler... ok.
GHC Version 7.7
 Building stage 2 compiler... failed; relevant barfage 
is below.
 building testsuite tools ... failed.
 running nofib (-rtsopts -O2) ... ok.
-
Respository hashes:
.|9a20e540754fc2af74c2e7392f2786a81d8d5f11
ghc-tarballs|18e0c37f8023abf469af991e2fc2d3b024319c27
libraries/array|442ff7744fb51004c5358ec626e704f4536e3d6c
libraries/base|9aa29b806cb9e6c23adf6deb50a1bd14487487a4
libraries/deepseq|420507ea418db8664a79aedaa6588b772e8c97c6
libraries/directory|2fcd7016ed71c3fdbce658ab973c3ce5aa217d76
libraries/dph|8d151264dbd8032eea7e46cb320d8e2ddd51abac
libraries/filepath|abf31a9aef45d2119a5757dafbe4adf611388ee8
libraries/ghc-prim|c2ed4a8ecffcfd8df09991e8639f665a63af069d
libraries/haskell2010|71bea78ccdbcd8bb8095dee2ebab8423e19ca959
libraries/haskell98|df1846099be1a7220e7d46aef167403eed53ebe5
libraries/hoopl|8e0ef3b7bf6d25919209f74d65c4a77c6689934d
libraries/hpc|02d402f04b2af44dd95340f1d64e81a3fcac049d
libraries/integer-gmp|a8c9be6c0a7fc56201c54c49d965c32f22b2bea8
libraries/integer-simple|30c4af5165f181ef4f089b3d245371230f0aafad
libraries/old-locale|df98c76b078de507ba2f7f23d4473c0ea09d5686

Re: The end of an era, and the dawn of a new one

2012-12-06 Thread David Terei
I think that sounds too involved. How many maintainers would we really
be looking at at this point? I think only around 5 - 10 really. So a
single file in the root seems easiest.

The other concern is some components of GHC are all over the place.
I'm also the maintainer for Safe Haskell and that involves code in a
few different folders.

On 6 December 2012 08:42, Johan Tibell johan.tib...@gmail.com wrote:
 On Thu, Dec 6, 2012 at 8:32 AM, Ian Lynagh i...@well-typed.com wrote:
 Perhaps we could have maintainers instead?

 If maintenance can be defined on a per-directory level we can put a
 MAINTAINERS file in listing maintainers for a directory and all its
 subdirectories. For example,

 ghc/MAINTAINERS would contain
 simonpj
 simonmar

 libraries/base/GHC/Event/MAINTAINERS would contain
 tibbe
 bos

 ghc/compiler/llvmGen would contain
 benl
 davidterei

 and so on. To find a maintainer (e.g. to send a request for code
 review to) you follow the directory hierarchy upwards, starting from
 the directory in which you want to make modifications, until you find
 a MAINTAINERS file. You then pick one of the maintainers there and
 assign the ticket with the attached code for them to review.

 Perhaps this is a bit too involved given the number of people involved.

 -- Johan

 ___
 Cvs-ghc mailing list
 Cvs-ghc@haskell.org
 http://www.haskell.org/mailman/listinfo/cvs-ghc

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: In FP_GCC_VERSION, test $CC not $GCC (95d8658)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/95d8658acc946f9a043ef62976d0514c0f1f449e

---

commit 95d8658acc946f9a043ef62976d0514c0f1f449e
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 12:37:52 2012 +

In FP_GCC_VERSION, test $CC not $GCC

$GCC is empty when autoreconf 2.56 or 2.59 is used, although it works
with 2.67. If testing $GCC with 2.5* worked in the past then I'm not
sure when/why it broke.

---

 aclocal.m4 |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 78e758e..127f528 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1049,7 +1049,7 @@ fi
 # output variable GccVersion.
 AC_DEFUN([FP_GCC_VERSION],
 [AC_REQUIRE([AC_PROG_CC])
-if test -z $GCC
+if test -z $CC
 then
   AC_MSG_ERROR([gcc is required])
 fi



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Whitespace only in iface/IfaceType.lhs (ccdccee)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/ccdccee2cf5656b8ba715a537c2389b08363e8b7

---

commit ccdccee2cf5656b8ba715a537c2389b08363e8b7
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 20:45:34 2012 +

Whitespace only in iface/IfaceType.lhs

 compiler/iface/IfaceType.lhs |   71 +++---
 1 files changed, 32 insertions(+), 39 deletions(-)


Diff suppressed because of size. To see it, use:

git show ccdccee2cf5656b8ba715a537c2389b08363e8b7

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc (5b746f5)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/5b746f5282395b71cfc0952375c56d1c884e8d10

---

commit 5b746f5282395b71cfc0952375c56d1c884e8d10
Merge: 3fc453a... b0626b6...
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 18:30:51 2012 +

Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc

 compiler/iface/LoadIface.lhs  |   92 ++--
 compiler/main/DynamicLoading.hs   |7 +--
 compiler/typecheck/TcRnTypes.lhs  |3 +
 compiler/typecheck/TcType.lhs |1 +
 docs/users_guide/glasgow_exts.xml |   47 ++-
 5 files changed, 107 insertions(+), 43 deletions(-)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Don't define DYNAMIC when compiling the dyn way (3fc453a)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3fc453af215a236ebf8d9ecfbf6574035e6316e2

---

commit 3fc453af215a236ebf8d9ecfbf6574035e6316e2
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 16:29:07 2012 +

Don't define DYNAMIC when compiling the dyn way

We want to compile the sources only once, and to produce both vanilla
and dyn object files. This means that the sources can't differ for the
two ways.

This needed a bit of a kludge to get keepCAFsForGHCi included only in
the dynamic library.

---

 compiler/ghc.cabal.in   |   10 ++
 compiler/ghc.mk |   20 ++--
 compiler/ghci/keepCAFsForGHCi.c |5 ++---
 compiler/main/DynFlags.hs   |4 ++--
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index a9dd62b..3e7cd42 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -20,11 +20,6 @@ Category: Development
 Build-Type: Simple
 Cabal-Version: = 1.2.3
 
-Flag dynlibs
-Description: Dynamic library support
-Default: False
-Manual: True
-
 Flag ghci
 Description: Build GHCi support.
 Default: False
@@ -101,9 +96,8 @@ Library
 c-sources:
 parser/cutils.c
 
-if flag(dynlibs)
-c-sources:
-ghci/keepCAFsForGHCi.c
+c-sources:
+ghci/keepCAFsForGHCi.c
 
 hs-source-dirs:
 basicTypes
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 0e53ca5..24c11b8 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -314,12 +314,6 @@ ifeq $(BuildSharedLibs) YES
 # so we don't build it the dyn way; see trac #5987
 ifneq $(TargetOS_CPP) mingw32
 compiler_stage2_CONFIGURE_OPTS += --enable-shared
-# If we are going to use dynamic libraries instead of .o files for ghci,
-# we will need to always retain CAFs in the compiler.
-# ghci/keepCAFsForGHCi contains a GNU C __attribute__((constructor))
-# function which sets the keepCAFs flag for the RTS before any Haskell
-# code is run.
-compiler_stage2_CONFIGURE_OPTS += --flags=dynlibs
 endif
 endif
 
@@ -451,6 +445,20 @@ $(eval $(call build-package,compiler,stage1,0))
 $(eval $(call build-package,compiler,stage2,1))
 $(eval $(call build-package,compiler,stage3,2))
 
+# We only want to turn keepCAFs on if we will be loading dynamic
+# Haskell libraries with GHCi. We therefore filter the object file
+# out for non-dynamic ways.
+define keepCAFsForGHCiDynOnly
+# $1 = stage
+# $2 = way
+ifeq $$(findstring dyn, $1) 
+compiler_stage$1_$2_C_OBJS := $$(filter-out 
%/keepCAFsForGHCi.o,$$(compiler_stage$1_$2_C_OBJS))
+endif
+endef
+$(foreach w,$(compiler_stage1_WAYS),$(eval $(call 
keepCAFsForGHCiDynOnly,1,$w)))
+$(foreach w,$(compiler_stage2_WAYS),$(eval $(call 
keepCAFsForGHCiDynOnly,2,$w)))
+$(foreach w,$(compiler_stage3_WAYS),$(eval $(call 
keepCAFsForGHCiDynOnly,3,$w)))
+
 # after build-package, because that adds --enable-library-for-ghci
 # to compiler_stage*_CONFIGURE_OPTS:
 # We don't build the GHCi library for the ghc package. We can load it
diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/ghci/keepCAFsForGHCi.c
index 805088e..2348233 100644
--- a/compiler/ghci/keepCAFsForGHCi.c
+++ b/compiler/ghci/keepCAFsForGHCi.c
@@ -1,16 +1,15 @@
 #include Rts.h
 
-// This file is only included when GhcBuildDylibs is set in mk/build.mk.
+// This file is only included in the dynamic library.
 // It contains an __attribute__((constructor)) function (run prior to main())
 // which sets the keepCAFs flag in the RTS, before any Haskell code is run.
 // This is required so that GHCi can use dynamic libraries instead of HSxyz.o
 // files.
 
-#ifdef DYNAMIC
 static void keepCAFsForGHCi(void) __attribute__((constructor));
 
 static void keepCAFsForGHCi(void)
 {
 keepCAFs = 1;
 }
-#endif
+
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 675b26e..a2d75e5 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1056,7 +1056,7 @@ wayOptc platform WayThreaded = case platformOS platform of
OSNetBSD  - [-pthread]
_ - []
 wayOptc _ WayDebug  = [-O0, -g]
-wayOptc _ WayDyn= [-DDYNAMIC]
+wayOptc _ WayDyn= []
 wayOptc _ WayProf   = [-DPROFILING]
 wayOptc _ WayEventLog   = [-DTRACING]
 wayOptc _ WayPar= [-DPAR, -w]
@@ -1096,7 +1096,7 @@ wayOptl _ WayNDP= []
 wayOptP :: Platform - Way - [String]
 wayOptP _ WayThreaded = []
 wayOptP _ WayDebug= []
-wayOptP _ WayDyn  = [-DDYNAMIC]
+wayOptP _ WayDyn  = []
 wayOptP _ WayProf = [-DPROFILING]
 wayOptP _ WayEventLog = [-DTRACING]
 wayOptP _ WayPar  = [-D__PARALLEL_HASKELL__]



___
Cvs-ghc mailing list

[commit: ghc] master: Typo (3864da2)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3864da2fcfd5a02af377c6f77dabb3f217415176

---

commit 3864da2fcfd5a02af377c6f77dabb3f217415176
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 19:27:42 2012 +

Typo

---

 compiler/iface/MkIface.lhs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index 40d1727..c410cd7 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -1124,7 +1124,7 @@ check_old_iface hsc_env mod_summary src_modified 
maybe_iface
  read_result - readIface (ms_mod mod_summary) iface_path False
  case read_result of
  Failed err - do
- traceIf (text FYI: cannont read old interface file: $$ 
nest 4 err)
+ traceIf (text FYI: cannot read old interface file: $$ 
nest 4 err)
  return Nothing
  Succeeded iface - do
  traceIf (text Read the interface file + text 
iface_path)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Add the beginnings of support for building vanilla and dynamic at the same time (b25d709)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b25d70908b8f843ecd6502281dc1d3c5dfde3876

---

commit b25d70908b8f843ecd6502281dc1d3c5dfde3876
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 21:42:50 2012 +

Add the beginnings of support for building vanilla and dynamic at the same 
time

---

 compiler/iface/LoadIface.lhs |   21 -
 compiler/main/DynFlags.hs|   25 ++---
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs
index 01a0d97..3174135 100644
--- a/compiler/iface/LoadIface.lhs
+++ b/compiler/iface/LoadIface.lhs
@@ -61,6 +61,8 @@ import FastString
 import Fingerprint
 
 import Control.Monad
+import Data.IORef
+import System.FilePath
 \end{code}
 
 
@@ -515,7 +517,9 @@ findAndReadIface doc_str mod hi_boot_file
if thisPackage dflags == modulePackageId mod 
   not (isOneShot (ghcMode dflags))
then return (Failed (homeModError mod loc))
-   else read_file file_path
+   else do r - read_file file_path
+   checkBuildDynamicToo r
+   return r
err - do
traceIf (ptext (sLit ...not found))
dflags - getDynFlags
@@ -532,6 +536,21 @@ findAndReadIface doc_str mod hi_boot_file
 | otherwise -
   return (Succeeded (iface, file_path))
 -- Don't forget to fill in the package name...
+  checkBuildDynamicToo (Succeeded (iface, filePath)) = do
+  dflags - getDynFlags
+  when (gopt Opt_BuildDynamicToo dflags) $ do
+  let ref = canGenerateDynamicToo dflags
+  b - liftIO $ readIORef ref
+  when b $ do
+  let dynFilePath = replaceExtension filePath (dynHiSuf 
dflags)
+  r - read_file dynFilePath
+  case r of
+  Succeeded (dynIface, _)
+   | mi_mod_hash iface == mi_mod_hash dynIface -
+  return ()
+  _ -
+  liftIO $ writeIORef ref False
+  checkBuildDynamicToo _ = return ()
 \end{code}
 
 @readIface@ tries just the one file.
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index a2d75e5..8686e55 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -371,6 +371,8 @@ data GeneralFlag
| Opt_KeepRawTokenStream
| Opt_KeepLlvmFiles
 
+   | Opt_BuildDynamicToo
+
-- safe haskell flags
| Opt_DistrustAllPackages
| Opt_PackageTrust
@@ -576,6 +578,10 @@ data DynFlags = DynFlags {
   hcSuf :: String,
   hiSuf :: String,
 
+  canGenerateDynamicToo :: IORef Bool,
+  dynObjectSuf  :: String,
+  dynHiSuf  :: String,
+
   outputFile:: Maybe String,
   outputHi  :: Maybe String,
   dynLibLoader  :: DynLibLoader,
@@ -1108,6 +1114,7 @@ wayOptP _ WayNDP  = []
 -- | Used by 'GHC.newSession' to partially initialize a new 'DynFlags' value
 initDynFlags :: DynFlags - IO DynFlags
 initDynFlags dflags = do
+ refCanGenerateDynamicToo - newIORef False
  refFilesToClean - newIORef []
  refDirsToClean - newIORef Map.empty
  refFilesToNotIntermediateClean - newIORef []
@@ -1115,6 +1122,7 @@ initDynFlags dflags = do
  refLlvmVersion - newIORef 28
  wrapperNum - newIORef 0
  return dflags{
+canGenerateDynamicToo = refCanGenerateDynamicToo,
 filesToClean   = refFilesToClean,
 dirsToClean= refDirsToClean,
 filesToNotIntermediateClean = refFilesToNotIntermediateClean,
@@ -1165,6 +1173,10 @@ defaultDynFlags mySettings =
 hcSuf   = phaseInputExt HCc,
 hiSuf   = hi,
 
+canGenerateDynamicToo   = panic defaultDynFlags: No 
canGenerateDynamicToo,
+dynObjectSuf= dyn_ ++ phaseInputExt StopLn,
+dynHiSuf= dyn_hi,
+
 pluginModNames  = [],
 pluginModNameOpts   = [],
 
@@ -1533,6 +1545,7 @@ getVerbFlags dflags
   | otherwise = []
 
 setObjectDir, setHiDir, setStubDir, setDumpDir, setOutputDir,
+ setDynObjectSuf, setDynHiSuf,
  setDylibInstallName,
  setObjectSuf, setHiSuf, setHcSuf, parseDynLibLoaderMode,
  setPgmP, addOptl, addOptc, addOptP,
@@ -1552,9 +1565,11 @@ setDumpDirf d = d{ dumpDir= Just f}
 setOutputDir  f = setObjectDir f . setHiDir f . setStubDir f . setDumpDir f
 setDylibInstallName  f d = d{ 

[commit: ghc] master: Use a MonadIO instance instead of an 'io' function (d842dff)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/d842dffa264e55c7bfd206298656a2bf0489acc2

---

commit d842dffa264e55c7bfd206298656a2bf0489acc2
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 22:46:33 2012 +

Use a MonadIO instance instead of an 'io' function

 compiler/main/DriverPipeline.hs |  128 ---
 1 files changed, 66 insertions(+), 62 deletions(-)


Diff suppressed because of size. To see it, use:

git show d842dffa264e55c7bfd206298656a2bf0489acc2

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] master: Refactor findAndReadIface; no functional changes (71b5ca5)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/71b5ca5a5e00e77c4fc2337db9900e0f98ed0a0f

---

commit 71b5ca5a5e00e77c4fc2337db9900e0f98ed0a0f
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Dec 5 20:35:16 2012 +

Refactor findAndReadIface; no functional changes

---

 compiler/iface/LoadIface.lhs |   97 -
 1 files changed, 47 insertions(+), 50 deletions(-)

diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs
index 85c8a78..01a0d97 100644
--- a/compiler/iface/LoadIface.lhs
+++ b/compiler/iface/LoadIface.lhs
@@ -484,57 +484,54 @@ findAndReadIface :: SDoc - Module
 -- sometimes it's ok to fail... see notes with loadInterface
 
 findAndReadIface doc_str mod hi_boot_file
-  = do  { traceIf (sep [hsep [ptext (sLit Reading), 
-  if hi_boot_file 
-then ptext (sLit [boot]) 
-else empty,
-  ptext (sLit interface for), 
-  ppr mod  semi],
-nest 4 (ptext (sLit reason:) + doc_str)])
-
--- Check for GHC.Prim, and return its static interface
-; dflags - getDynFlags
-; if mod == gHC_PRIM
-  then return (Succeeded (ghcPrimIface,
+  = do traceIf (sep [hsep [ptext (sLit Reading), 
+   if hi_boot_file 
+ then ptext (sLit [boot]) 
+ else empty,
+   ptext (sLit interface for), 
+   ppr mod  semi],
+ nest 4 (ptext (sLit reason:) + doc_str)])
+
+   -- Check for GHC.Prim, and return its static interface
+   if mod == gHC_PRIM
+   then return (Succeeded (ghcPrimIface,
built in interface for GHC.Prim))
-  else do
-
--- Look for the file
-; hsc_env - getTopEnv
-; mb_found - liftIO (findExactModule hsc_env mod)
-; case mb_found of {
-  
-  Found loc mod - do 
-
--- Found file, so read it
-{ let { file_path = addBootSuffix_maybe hi_boot_file (ml_hi_file loc) }
-
--- If the interface is in the current package then if we could
--- load it would already be in the HPT and we assume that our
--- callers checked that.
-; if thisPackage dflags == modulePackageId mod
- not (isOneShot (ghcMode dflags))
-then return (Failed (homeModError mod loc))
-else do {
-
-; traceIf (ptext (sLit readIFace) + text file_path)
-; read_result - readIface mod file_path hi_boot_file
-; case read_result of
-Failed err - return (Failed (badIfaceFile file_path err))
-Succeeded iface 
-| mi_module iface /= mod -
-  return (Failed (wrongIfaceModErr iface mod file_path))
-| otherwise -
-  return (Succeeded (iface, file_path))
--- Don't forget to fill in the package name...
-}}
-; err - do
-{ traceIf (ptext (sLit ...not found))
-; dflags - getDynFlags
-; return (Failed (cannotFindInterface dflags 
-(moduleName mod) err)) }
-}
-}
+   else do
+   dflags - getDynFlags
+   -- Look for the file
+   hsc_env - getTopEnv
+   mb_found - liftIO (findExactModule hsc_env mod)
+   case mb_found of
+   Found loc mod - do 
+
+   -- Found file, so read it
+   let file_path = addBootSuffix_maybe hi_boot_file
+   (ml_hi_file loc)
+
+   -- If the interface is in the current package
+   -- then if we could load it would already be in
+   -- the HPT and we assume that our callers checked
+   -- that.
+   if thisPackage dflags == modulePackageId mod 
+  not (isOneShot (ghcMode dflags))
+   then return (Failed (homeModError mod loc))
+   else read_file file_path
+   err - do
+   traceIf (ptext (sLit ...not found))
+   dflags - getDynFlags
+   return (Failed (cannotFindInterface dflags 
+   (moduleName mod) err))
+where read_file file_path = do
+  traceIf (ptext (sLit readIFace) + text file_path)
+  read_result - readIface mod file_path 

[commit: ghc] master: Make nativeCodeGen return the rest of its UniqSupply (6bdac1c)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6bdac1c375dc754ad3a540f704437650b43474c1

---

commit 6bdac1c375dc754ad3a540f704437650b43474c1
Author: Ian Lynagh i...@well-typed.com
Date:   Thu Dec 6 19:34:27 2012 +

Make nativeCodeGen return the rest of its UniqSupply

---

 compiler/main/CodeOutput.lhs  |5 +++--
 compiler/nativeGen/AsmCodeGen.lhs |   16 +---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/compiler/main/CodeOutput.lhs b/compiler/main/CodeOutput.lhs
index 230ba71..f76b0ef 100644
--- a/compiler/main/CodeOutput.lhs
+++ b/compiler/main/CodeOutput.lhs
@@ -83,7 +83,7 @@ codeOutput dflags this_mod location foreign_stubs pkg_deps 
cmm_stream
 ; return stubs_exist
 }
 
-doOutput :: String - (Handle - IO ()) - IO ()
+doOutput :: String - (Handle - IO a) - IO a
 doOutput filenm io_action = bracket (openFile filenm WriteMode) hClose 
io_action
 \end{code}
 
@@ -144,9 +144,10 @@ outputAsm dflags filenm cmm_stream
  | cGhcWithNativeCodeGen == YES
   = do ncg_uniqs - mkSplitUniqSupply 'n'
 
-   {-# SCC OutputAsm #-} doOutput filenm $
+   _ - {-# SCC OutputAsm #-} doOutput filenm $
\f - {-# SCC NativeCodeGen #-}
  nativeCodeGen dflags f ncg_uniqs cmm_stream
+   return ()
 
  | otherwise
   = panic This compiler was built without a native code generator
diff --git a/compiler/nativeGen/AsmCodeGen.lhs 
b/compiler/nativeGen/AsmCodeGen.lhs
index 863af12..9917619 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -151,10 +151,11 @@ data NcgImpl statics instr jumpDest = NcgImpl {
 }
 
 
-nativeCodeGen :: DynFlags - Handle - UniqSupply - Stream IO RawCmmGroup () 
- IO ()
+nativeCodeGen :: DynFlags - Handle - UniqSupply - Stream IO RawCmmGroup ()
+  - IO UniqSupply
 nativeCodeGen dflags h us cmms
  = let platform = targetPlatform dflags
-   nCG' :: (Outputable statics, Outputable instr, Instruction instr) = 
NcgImpl statics instr jumpDest - IO ()
+   nCG' :: (Outputable statics, Outputable instr, Instruction instr) = 
NcgImpl statics instr jumpDest - IO UniqSupply
nCG' ncgImpl = nativeCodeGen' dflags ncgImpl h us cmms
x86NcgImpl = NcgImpl {
  cmmTopCodeGen = X86.CodeGen.cmmTopCodeGen
@@ -239,7 +240,7 @@ noAllocMoreStack amount _
 nativeCodeGen' :: (Outputable statics, Outputable instr, Instruction instr)
= DynFlags
- NcgImpl statics instr jumpDest
-   - Handle - UniqSupply - Stream IO RawCmmGroup () - IO ()
+   - Handle - UniqSupply - Stream IO RawCmmGroup () - IO 
UniqSupply
 nativeCodeGen' dflags ncgImpl h us cmms
  = do
 let platform = targetPlatform dflags
@@ -248,7 +249,7 @@ nativeCodeGen' dflags ncgImpl h us cmms
 -- Pretty if it weren't for the fact that we do lots of little
 -- printDocs here (in order to do codegen in constant space).
 bufh - newBufHandle h
-(imports, prof) - cmmNativeGenStream dflags ncgImpl bufh us 
split_cmms [] [] 0
+(imports, prof, us') - cmmNativeGenStream dflags ncgImpl bufh us 
split_cmms [] [] 0
 bFlush bufh
 
 let (native, colorStats, linearStats)
@@ -293,7 +294,7 @@ nativeCodeGen' dflags ncgImpl h us cmms
 $ withPprStyleDoc dflags (mkCodeStyle AsmStyle)
 $ makeImportsDoc dflags (concat imports)
 
-return  ()
+return us'
 
  where  add_split tops
 | gopt Opt_SplitObjs dflags = split_marker : tops
@@ -316,13 +317,14 @@ cmmNativeGenStream :: (Outputable statics, Outputable 
instr, Instruction instr)
   - IO ( [[CLabel]],
   [([NatCmmDecl statics instr],
   Maybe [Color.RegAllocStats statics instr],
-  Maybe [Linear.RegAllocStats])] )
+  Maybe [Linear.RegAllocStats])],
+  UniqSupply )
 
 cmmNativeGenStream dflags ncgImpl h us cmm_stream impAcc profAcc count
  = do
 r - Stream.runStream cmm_stream
 case r of
-  Left () - return (reverse impAcc, reverse profAcc)
+  Left () - return (reverse impAcc, reverse profAcc, us)
   Right (cmms, cmm_stream') - do
 (impAcc,profAcc,us') - cmmNativeGens dflags ncgImpl h us cmms
   impAcc profAcc count



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: The end of an era, and the dawn of a new one

2012-12-06 Thread Johan Tibell
On Thu, Dec 6, 2012 at 1:49 PM, David Terei davidte...@gmail.com wrote:
 I think that sounds too involved. How many maintainers would we really
 be looking at at this point? I think only around 5 - 10 really. So a
 single file in the root seems easiest.

 The other concern is some components of GHC are all over the place.
 I'm also the maintainer for Safe Haskell and that involves code in a
 few different folders.

Fair enough. A single file sounds fine to me.

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


am-deb7-64 (HEAD), build 261, Success

2012-12-06 Thread Builder
am-deb7-64 (HEAD), build 261

Build succeeded
Details: http://darcs.haskell.org/ghcBuilder/builders/am-deb7-64/261.html

git clone| Success
create mk/build.mk   | Success
get subrepos | Success
repo versions| Success
touching clean-check files   | Success
setting version date | Success
booting  | Success
configuring  | Success
creating check-remove-before | Success
compiling| Success
creating check-remove-after  | Success
compiling testremove | Success
simulating clean | Success
checking clean   | Success
making bindist   | Success
testing bindist  | Success
testing  | Success
testsuite summary| Success

Build succeeded
Details: http://darcs.haskell.org/ghcBuilder/builders/am-deb7-64/261.html

File not deleted:compiler/ghc.cabal.old
File not deleted:includes/dist-derivedconstants
File not deleted:includes/dist-derivedconstants/header
File not deleted:includes/dist-derivedconstants/header/DerivedConstants.h
File not deleted:
includes/dist-derivedconstants/header/GHCConstantsHaskellExports.hs
File not deleted:
includes/dist-derivedconstants/header/GHCConstantsHaskellType.hs
File not deleted:
includes/dist-derivedconstants/header/GHCConstantsHaskellWrappers.hs
File not deleted:includes/dist-derivedconstants/header/platformConstants
File not deleted:includes/dist-derivedconstants/header/tmp.c
File not deleted:includes/dist-derivedconstants/header/tmp.o
File not deleted:inplace
File not deleted:libraries/base/include/EventConfig.h
File not deleted:mk/config.mk.old
File not deleted:mk/project.mk.old
File not deleted:rts/libs.depend
File not deleted:rts/package.conf.inplace
File not deleted:rts/package.conf.inplace.raw

OVERALL SUMMARY for test run started at Tue Dec  4 02:17:52 MSK 2012
3503 total tests, which gave rise to
   11675 test cases, of which
   0 caused framework failures
8507 were skipped

3077 expected passes
  26 had missing libraries
  35 expected failures
  23 unexpected passes
   7 unexpected failures

Unexpected passes:
   codeGen/should_runT7319 (prof)
   profiling/should_compile  2410 (normal)
   profiling/should_compile  prof001 (normal)
   profiling/should_compile  prof002 (normal)
   profiling/should_run  5314 (prof)
   profiling/should_run  T2552 (prof)
   profiling/should_run  T3001 (prof_hb)
   profiling/should_run  T3001-2 (prof_hb)
   profiling/should_run  T5363 (prof)
   profiling/should_run  T5559 (prof)
   profiling/should_run  T680 (prof)
   profiling/should_run  T949 (prof)
   profiling/should_run  callstack001 (prof)
   profiling/should_run  callstack002 (prof)
   profiling/should_run  heapprof001 (prof)
   profiling/should_run  prof-doc-fib (prof)
   profiling/should_run  prof-doc-last (prof)
   profiling/should_run  profinline001 (prof)
   profiling/should_run  scc001 (prof)
   profiling/should_run  scc002 (prof)
   profiling/should_run  scc003 (prof)
   stranal/should_compilenewtype (optasm)
   thTH_spliceE5_prof (normal)

Unexpected failures:
   codeGen/should_run cgrun068 [exit code non-0] (normal)
   ghci/scripts   T5979 [bad stderr] (ghci)
   perf/compiler  T1969 [stat not good enough] (normal)
   perf/haddock   haddock.Cabal [stat not good enough] (normal)
   perf/haddock   haddock.base [stat not good enough] (normal)
   typecheck/should_fail  T5300 [stderr mismatch] (normal)
   typecheck/should_fail  T5691 [stderr mismatch] (normal)

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


Re: The end of an era, and the dawn of a new one

2012-12-06 Thread Ben Lippmeier

On 07/12/2012, at 3:32 AM, Ian Lynagh wrote:

 On Thu, Dec 06, 2012 at 12:32:05PM +, Simon Peyton-Jones wrote:
 (Narrowing to cvs-ghc for now.)
 
 Speaking for myself, I would welcome a code-ownership model along the lines 
 that Ben suggests. If it works well it would
  a) spread the load
  b) broaden a genuine sense of ownership
  c) because of (a) and (b), perhaps encourage more people to participate
 
 What do others think?
 
 owner is a very strong word: I think other projects have had problems
 where e.g. owners have found themselves without time to deal with
 patches submitted, but have been unwilling to let anyone else touch
 their code.

Personally, I don't think we'll have problems with this. A prerequisite for 
code ownership would be to have an account on d.h.o and I think (almost) 
everyone on that list knows each other personally.

A point about using the owner label is that it makes the person directly 
responsible for the quality of their code base. I think up until now the 
contributors have been working under a pretence of I'll help out where I 
can, but it's not really my responsibility. In contrast, if you make someone a 
code owner you trust them to be committed to the good of the project.

We would want the new code owners to make an initial time investment in going 
though and cleaning up / understanding their code. If that means they're not 
prepared to accept some half-baked patches due to the increased maintenance 
burden, then so be it. I think GHC HQ occasionally palms off contributed 
patches for this reason anyway.


 We actually already have something similar to this proposal here:
http://hackage.haskell.org/trac/ghc/wiki/Contributors
 although it's quite out-of-date, mostly because people tend to fade away
 rather than have a definite date on which they stop maintaining
 something.

Having a specified end-date is a good idea. Maybe people should take ownership 
of some code for periods of one year at a time, and then don't need to feel bad 
if their circumstances change and they don't have time for it anymore.

Ben.



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] ghc-7.6: Document promotion of existential data types (f630eb5)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/f630eb5122b5d6c16b449451e33adda5341b6775

---

commit f630eb5122b5d6c16b449451e33adda5341b6775
Author: Simon Peyton Jones simo...@microsoft.com
Date:   Wed Dec 5 16:41:53 2012 +

Document promotion of existential data types

Thanks to Richard Eisenberg for writing this.

---

 docs/users_guide/glasgow_exts.xml |   47 ++--
 1 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/docs/users_guide/glasgow_exts.xml 
b/docs/users_guide/glasgow_exts.xml
index 4870490..2a1002a 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -5500,8 +5500,9 @@ The following restrictions apply to promotion:
  higher-kinded datatypes such as literaldata Fix f = In (f (Fix 
f))/literal,
  or datatypes whose kinds involve promoted types such as
  literalVec :: * - Nat - */literal./para/listitem
- listitemparaWe do not promote datatypes whose constructors are kind
- polymorphic, involve constraints, or use existential quantification.
+ listitemparaWe do not promote data constructors that are kind
+ polymorphic, involve constraints, mention type or data families, or involve 
types that
+ are not promotable.
  /para/listitem
  listitemparaWe do not promote data family instances (xref 
linkend=data-families/).
  /para/listitem
@@ -5556,7 +5557,7 @@ Note that this requires option-XTypeOperators/option.
 sect2 id=promoted-literals
 titlePromoted Literals/title
 para
-Numeric and string literals are prmoted to the type level, giving convenient
+Numeric and string literals are promoted to the type level, giving convenient
 access to a large number of predefined type-level constants.  Numeric literals
 are of kind literalNat/literal, while string literals are of kind
 literalSymbol/literal.  These kinds are defined in the module
@@ -5597,6 +5598,46 @@ example = from (Point 1 2) (Get :: Label x)
 /para
 /sect2
 
+sect2 id=promotion-existentials
+titlePromoting existential data constructors/title
+para
+Note that we do promote existential data constructors that are otherwise 
suitable.
+For example, consider the following:
+programlisting
+data Ex :: * where
+  MkEx :: forall a. a - Ex
+/programlisting
+Both the type literalEx/literal and the data constructor 
literalMkEx/literal
+get promoted, with the polymorphic kind literal'MkEx :: forall k. k - 
Ex/literal. 
+Somewhat surprisingly, you can write a type family to extract the member
+of a type-level existential:
+programlisting
+type family UnEx (ex :: Ex) :: k
+type instance UnEx (MkEx x) = x
+/programlisting
+At first blush, literalUnEx/literal seems poorly-kinded. The return kind
+literalk/literal is not mentioned in the arguments, and thus it would seem
+that an instance would have to return a member of literalk/literal 
+emphasisfor any/emphasis literalk/literal. However, this is not the
+case. The type family literalUnEx/literal is a kind-indexed type family.
+The return kind literalk/literal is an implicit parameter to 
literalUnEx/literal.
+The elaborated definitions are as follows:
+programlisting
+type family UnEx (k :: BOX) (ex :: Ex) :: k
+type instance UnEx k (MkEx k x) = x
+/programlisting
+Thus, the instance triggers only when the implicit parameter to 
literalUnEx/literal
+matches the implicit parameter to literalMkEx/literal. Because 
literalk/literal
+is actually a parameter to literalUnEx/literal, the kind is not escaping 
the
+existential, and the above code is valid.
+/para
+
+para
+See also ulink url=http://hackage.haskell.org/trac/ghc/ticket/7347;Trac 
#7347/ulink.
+/para
+/sect2
+
+
 /sect1
 
 



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] ghc-7.6: More release notes (3e1925a)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/3e1925ac18b6e976d3ee73c723593c4aefa0363f

---

commit 3e1925ac18b6e976d3ee73c723593c4aefa0363f
Author: Ian Lynagh i...@well-typed.com
Date:   Fri Dec 7 00:41:07 2012 +

More release notes

---

 docs/users_guide/7.6.2-notes.xml |   58 ++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/docs/users_guide/7.6.2-notes.xml b/docs/users_guide/7.6.2-notes.xml
index d17bfbd..54c96e3 100644
--- a/docs/users_guide/7.6.2-notes.xml
+++ b/docs/users_guide/7.6.2-notes.xml
@@ -75,6 +75,13 @@
 
listitem
   para
+A bug in the RTS, which could cause programs to hang or
+segfault just before they terminate, has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
 It is now possible to build on Sparc/Solaris with a
 non-GNU linker.
   /para
@@ -87,6 +94,57 @@
 use a 32bit address space on 64bit Windows.
   /para
/listitem
+
+   listitem
+  para
+An interaction between Template Haskell and
+literal-fdefer-type-errors/literal that could cause
+segfaults has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+If reloading some modules fails, GHCi will now not unload
+modules that are unaffected by the failure.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug that caused crashes when
+literalthreadDelay/literal is used with large arguments
+has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug which could cause segfaults when the
+literal-xc/literal RTS flag is used has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug which caused duplicate type signatures to not be
+reported in some circumstance has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+Using the literal-fth/literal flag now gives a
+deprecated message.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug that could cause spurious warnings when making rules
+involving primops has been fixed.
+  /para
+   /listitem
 /itemizedlist
   /sect2
 



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] ghc-7.6: Start on release notes for 7.6.2 (d99810d)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/d99810d8d8e126961e5caab3324adfcc67c87eea

---

commit d99810d8d8e126961e5caab3324adfcc67c87eea
Author: Ian Lynagh i...@well-typed.com
Date:   Fri Dec 7 00:18:29 2012 +

Start on release notes for 7.6.2

---

 docs/users_guide/7.6.2-notes.xml |  196 ++
 docs/users_guide/intro.xml   |1 +
 docs/users_guide/ug-ent.xml.in   |1 +
 3 files changed, 198 insertions(+), 0 deletions(-)

diff --git a/docs/users_guide/7.6.2-notes.xml b/docs/users_guide/7.6.2-notes.xml
new file mode 100644
index 000..d17bfbd
--- /dev/null
+++ b/docs/users_guide/7.6.2-notes.xml
@@ -0,0 +1,196 @@
+?xml version=1.0 encoding=iso-8859-1?
+sect1 id=release-7-6-2
+  titleRelease notes for version 7.6.2/title
+
+  para
+The 7.6.2 release is a bugfix release. The changes relative to
+7.6.1 are listed below.
+  /para
+
+  sect2
+titleGHC/title
+
+itemizedlist
+   listitem
+  para
+A long-standing typechecker bug which allowed
+literalunsafeCoerce/literal to be written has been
+fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug has been fixed that caused GHC to sometimes not
+realise that recompilation was necessary.
+  /para
+   /listitem
+
+   listitem
+  para
+If both literal-H/literal and a
+literal-Mlt;sizegt;/literal flag are given, then
+GHC will no longer exceed the maximum heap size.
+  /para
+   /listitem
+
+   listitem
+  para
+An off-by-one error, which could cause segfaults, in the
+RTS flag parsing has been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+Various bugs that could cause GHC to panic when compiling
+certain source files have been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+Some bugs in type checking the
+literalDataKinds/literal and
+literalPolyKinds/literal
+extensions have been fixed.
+  /para
+   /listitem
+
+   listitem
+  para
+Performance of compiled programs has been improved in
+some cases.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug in the RTS, which caused programs to keep waking up
+when they should be idle, has been fixed. This will
+particularly help long-running often-idle programs such as
+xmonad.
+  /para
+   /listitem
+
+   listitem
+  para
+It is now possible to build on Sparc/Solaris with a
+non-GNU linker.
+  /para
+   /listitem
+
+   listitem
+  para
+A bug which caused GHCi to fail to start on some 64bit
+Windows installations has been fixed. GHCi can now only
+use a 32bit address space on 64bit Windows.
+  /para
+   /listitem
+/itemizedlist
+  /sect2
+
+  sect2
+titleHaddock/title
+
+itemizedlist
+   listitem
+  para
+Haddock now handles deprecation messages for re-exported
+entities correctly.
+  /para
+   /listitem
+/itemizedlist
+  /sect2
+
+  sect2
+titleHsc2hs/title
+
+itemizedlist
+   listitem
+  para
+Hsc2hs now handles absolute filenames on Windows correctly.
+  /para
+   /listitem
+/itemizedlist
+  /sect2
+
+  sect2
+titleLibraries/title
+
+sect3
+titlebase/title
+itemizedlist
+   listitem
+  para
+Version number 4.6.0.1 (was 4.6.0.0)
+  /para
+   /listitem
+   listitem
+  para
+A bug in division of 64bit values on 32bit platforms has
+been fixed.
+  /para
+   /listitem
+   listitem
+  para
+The literallabelThread/literal function now handles
+Unicode values correctly.
+  /para
+   /listitem
+   listitem
+  para
+There have been some build fixes for building on NetBSD.
+  /para
+   /listitem
+/itemizedlist
+/sect3
+
+sect3
+titlebytestring/title
+itemizedlist
+listitem
+para
+Version number 0.10.0.2 (was 0.10.0.0)
+/para
+/listitem
+listitem
+para
+A bug has been fixed that could cause programs using
+literalByteString/literals to 

[commit: ghc] ghc-7.6: Allow existential data constructors to be promoted (e3dc71d)

2012-12-06 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/e3dc71de7307d30f6063a8447b93e54f1551a041

---

commit e3dc71de7307d30f6063a8447b93e54f1551a041
Author: Simon Peyton Jones simo...@microsoft.com
Date:   Wed Dec 5 11:07:38 2012 +

Allow existential data constructors to be promoted

This reverts the change in Trac #7347, which prevented promotion
of existential data constructors.  Ones with constraints in
their types, or kind polymorphism, still can't be promoted.

---

 compiler/basicTypes/DataCon.lhs |8 +---
 compiler/types/TyCon.lhs|6 --
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs
index c82f018..edb3627 100644
--- a/compiler/basicTypes/DataCon.lhs
+++ b/compiler/basicTypes/DataCon.lhs
@@ -391,6 +391,7 @@ data DataCon
-- The actual fixity is stored elsewhere
 
 dcPromoted :: Maybe TyCon-- The promoted TyCon if this DataCon is 
promotable
+ -- See Note [Promoted data constructors] 
in TyCon
   }
   deriving Data.Typeable.Typeable
 
@@ -559,9 +560,10 @@ mkDataCon name declared_infix
  mkFunTys rep_arg_tys $
  mkTyConApp rep_tycon (mkTyVarTys univ_tvs)
 
-mb_promoted 
-  | is_vanilla   -- No existentials or context
-  , all (isLiftedTypeKind . tyVarKind) univ_tvs
+mb_promoted   -- See Note [Promoted data constructors] in TyCon
+  | all (isLiftedTypeKind . tyVarKind) (univ_tvs ++ ex_tvs)
+  -- No kind polymorphism, and all of kind *
+  , null full_theta   -- No constraints
   , all isPromotableType orig_arg_tys
   = Just (mkPromotedDataCon con name (getUnique name) prom_kind arity)
   | otherwise 
diff --git a/compiler/types/TyCon.lhs b/compiler/types/TyCon.lhs
index 5398adc..e90cdec 100644
--- a/compiler/types/TyCon.lhs
+++ b/compiler/types/TyCon.lhs
@@ -581,8 +581,10 @@ Note [Promoted data constructors]
 A data constructor can be promoted to become a type constructor,
 via the PromotedTyCon alternative in TyCon.
 
-* Only vanilla data constructors are promoted; ones with no GADT
-  stuff, no existentials, etc.  We might generalise this later.
+* Only data constructors with  
+ (a) no kind polymorphism
+ (b) no constraints in its type (eg GADTs)
+  are promoted.  Existentials are ok; see Trac #7347.
 
 * The TyCon promoted from a DataCon has the *same* Name and Unique as
   the DataCon.  Eg. If the data constructor Data.Maybe.Just(unique 78,



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[nightly] 06-Dec-2012 build of STABLE on x86_64-unknown-linux (cam-04-unx)

2012-12-06 Thread GHC Build Reports
Build description = STABLE on x86_64-unknown-linux (cam-04-unx)
Build location= /64playpen/simonmar/nightly/STABLE-cam-04-unx
Build config file = /home/simonmar/nightly/site/msrc/conf-STABLE-cam-04-unx

Nightly build started on cam-04-unx at Thu Dec 6 18:10:01 GMT 2012.
 checking out new source tree ... warning: Remote branch 
ghc-7.6 not found in upstream origin, using HEAD instead
ok.
 Building stage 1 compiler... ok.
GHC Version 7.6.1.20121203
 Building stage 2 compiler... ok.
 Building stage 3 compiler... ok.
 building source distribution ... ok.
 uploading source distribution... ok.
 building testsuite tools ... ok.
 running tests... ok (summary below).
 building compiler binary distribution... ok.
 uploading binary distribution... ok.
 running nofib (-rtsopts -O2) ... ok.
 running nofib (-rtsopts -O2 -fllvm)  ... ok.
 running nofib (-rtsopts -O2 -prof -auto-all -static)... ok.
 running nofib (-rtsopts -O2 -prof -auto-all -fllvm -static)... ok.
 publishing logs  ... ok.
Logs  are at http://www.haskell.org/ghc/dist/stable/logs
Dists are at http://www.haskell.org/ghc/dist/stable/dist
Docs  are at http://www.haskell.org/ghc/dist/stable/docs
-
Respository hashes:
.|b637a24dbb471d99887e5544037a2abe10af26ee
ghc-tarballs|18e0c37f8023abf469af991e2fc2d3b024319c27
libraries/Cabal|e7e7ce1029707a67d26e6dc29de11141734898e3
libraries/Win32|e13098aecd0489399435dbf8643e1db2272e1e02
libraries/array|8dcd15240a9c2ba142fcbd31f597b51cf2f560bf
libraries/base|066fb9edecb3f293dbab36b87317100722a3c57c
libraries/binary|2d31cea238d0d08885c457475fc354dbf2b88976
libraries/bytestring|65e40bdf5b3a2484b36221a71b054e4400361a5f
libraries/containers|a9b7224068ae60f73baacd5f76d2c27624d90120
libraries/deepseq|4821349305c2a73efacdd58d2ba485b07eb84eda
libraries/directory|ef17afe1bd44ae10ef413146e5ade8867cb05625
libraries/filepath|2d60d0dd5d8fc924420bb238902266929f4e2cfb
libraries/ghc-prim|03144fbee792555bfd6de6184228ebaeffed2896
libraries/haskeline|f4040ab5831866c260e03fc8601edf7e1ed77049
libraries/haskell2010|d7e33da36585c250cd0bfb45b518c95e44197f3c
libraries/haskell98|c5a0db5eb4ce6a3736bf4f5caac3ff465b3dbaf9
libraries/hoopl|293d339303097641e7f14a1c0365a3801a87918d
libraries/hpc|c1b783dbbb0ab917208655c53a0af5c7538c2a0b
libraries/integer-gmp|2d9eca147f5c8b6f390eca15e03b315f67f2df01
libraries/integer-simple|47737f6f16d891b743a3d02b0a016100fd3a36d1
libraries/old-locale|47542432234f6fc406a9abf5d3f94e43d9bd10f6
libraries/old-time|cf225c367e5490201a5b04b1b8cb322f6e230d46
libraries/pretty|0a22cc0b3a4f8db876c4019013a30bfd1c0dd9a2
libraries/process|0ab69a65edae8c1a34ecee3a97b3839c833985f2
libraries/template-haskell|db0b4de55926b0bc98717c92ba543bcf9b89d024
libraries/terminfo|579d2c324e69856ff8d1ea8b5036e30c920e1973
libraries/transformers|a59fb93860f84ccd44178dcbbb82cfea7e02cd07
libraries/unix|b95a003b20436863ef2f5fc01e6cd77f5bef94a0
libraries/utf8-string|73ca1b9def3f350ad28e55fcba077e6be3b67e93
libraries/xhtml|fb9e0bbb69e15873682a9f25d39652099a3ccac1
nofib|14bccff2c547c0e06fe8f98607b9cf18890ef051
testsuite|c96a151e2e48092efe58bfb2ba11aad428480b27
utils/haddock|1d480b49a2d9098993889ca29dd82ef228ae5c0d
utils/hsc2hs|67b8c663216690150b6f762e09b32ebbe6334ddd
-
All done!
Nightly build finished successfully at Fri Dec 7 01:34:40 GMT 2012

- GHC Test summary -

OVERALL SUMMARY for test run started at Thu Dec  6 21:38:30 GMT 2012
3402 total tests, which gave rise to
   16613 test cases, of which
  10 caused framework failures
3563 were skipped

   12537 expected passes
 367 had missing libraries
 131 expected failures
   0 unexpected passes
  15 unexpected failures

Unexpected failures:
   perf/compilerT6048 [stat not good enough] (optasm)
   perf/haddock haddock.Cabal [stat not good enough] (normal)
   perf/haddock haddock.base [stat not good enough] (normal)
   perf/haddock haddock.compiler [stat not good enough] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly01 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly02 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly03 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly04 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly05 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly06 [exit code non-0] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly07 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly08 [stderr mismatch] (normal)
   safeHaskell/check/pkg01  ImpSafeOnly09 

[commit: ghc] overlapping-tyfams: Removed confluent overlap check from branched type family instances. (67835fa)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/67835fa4fe6e367a80adf62d717337818908bc94

---

commit 67835fa4fe6e367a80adf62d717337818908bc94
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Mon Dec 3 12:54:36 2012 -0500

Removed confluent overlap check from branched type family instances.

It was discovered that confluent overlap within groups implemented
the obvious way doesn't support substitution. We (Simon PJ,
Stephanie Weirich, Conor McBride, and I) were unable to come up with
a simple solution to this problem. In any case, we'll wait until
someone shouts loudly enough to make this worthwhile.

---

 compiler/types/FamInstEnv.lhs |   88 ++---
 1 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/compiler/types/FamInstEnv.lhs b/compiler/types/FamInstEnv.lhs
index ea84816..5f91eef 100644
--- a/compiler/types/FamInstEnv.lhs
+++ b/compiler/types/FamInstEnv.lhs
@@ -589,39 +589,38 @@ no such other instance exists.
 
 Note [Confluence checking within groups]
 
-Consider the following definition:
+GHC allows type family instances to have overlapping patterns as long as the
+right-hand sides are coincident in the region of overlap. Can we extend this
+notion of confluent overlap to branched instances? Not in any obvious way.
 
-type family And (a :: Bool) (b :: Bool) :: Bool
+Consider this:
 
 type instance where
-  And False a = False
-  And True  b = b
-  And c False = False
-  And d True  = d
-
-We wish to simplify (And e True). The search (using a one-way match
-from type patterns to target) quickly eliminates the first three
-possibilities. The fourth one matches, with subst [d |- e]. We then
-go back and check the first three. We check each one to see if it
-can possibly unify with the target (And e True). The first one does,
-with subst [a |- True, e |- False]. To show that this is consistent
-with the fourth equation, we must apply both substitutions to the
-RHS of the fourth equation. Similarly, unifying with the second
-equation gives us a subst [b |- True, e |- True], also requiring
-the application of both substitutions to show consistency. The
-third equation does not unify, so we're done and can simplify
-(And e True) to e, as desired.
-
-Why don't we just unify the two equations in the group? Because, in
-general, we don't want to. Consider this:
-
-type family F a b
-type instance where
-  F a a = Int
-  F a b = b
-
-We should be able to simplify (F x Int) but not (F y Bool). We need
-the information from matching the target to differentiate these cases.
+  F Int = Int
+  F a = a
+
+Without confluence checking (in other words, as implemented), we cannot now
+simplify an application of (F b) -- b might unify with Int later on, so this
+application is stuck. However, it would seem easy to just check that, in the
+region of overlap, (i.e. b |- Int), the right-hand sides coincide, so we're
+OK. The problem happens when we are simplifying an application (F (G a)),
+where (G a) is stuck. What, now, is the region of overlap? We can't soundly
+simplify (F (G a)) without knowing that the right-hand sides are confluent
+in the region of overlap, but we also can't in any obvious way identify the
+region of overlap. We don't want to do analysis on the instances of G, because
+that is not sound in a world with open type families. (If G were known to be
+closed, there might be a way forward here.) To find the region of overlap,
+it is conceivable that we might convert (G a) to some fresh type variable and
+then unify, but we must be careful to convert every (G a) to the same fresh
+type variable. And then, what if there is an (H a) lying around? It all seems
+rather subtle, error-prone, confusing, and probably won't help anyone. So,
+we're not doing it.
+
+So, why is this not a problem with non-branched confluent overlap? Because
+we don't need to verify that an application is apart from anything. The
+non-branched confluent overlap check happens when we add the instance to the
+environment -- we're unifying among patterns, which cannot contain type family
+appplications. So, we're safe there and can continue supporting that feature.
 
 \begin{code}
 -- when matching a type family application, we get a FamInst,
@@ -648,8 +647,8 @@ lookupFamInstEnv
 lookupFamInstEnv
   = lookup_fam_inst_env match True
   where
-match seen branch@(FamInstBranch { fib_tvs = tpl_tvs,
-   fib_lhs = tpl_tys })
+match seen (FamInstBranch { fib_tvs = tpl_tvs
+  , fib_lhs = tpl_tys })
   _ match_tys 
   = ASSERT( tyVarsOfTypes match_tys `disjointVarSet` tpl_tvs )
 -- Unification will break badly if 

[commit: ghc] overlapping-tyfams: Used a GADT to control appropriate use of functions on singleton axioms. (1a3c0d3)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/1a3c0d345ba1f514f747b7791260672d74d1cd10

---

commit 1a3c0d345ba1f514f747b7791260672d74d1cd10
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Sat Dec 1 17:37:13 2012 -0500

Used a GADT to control appropriate use of functions on singleton axioms.

The list of branches in CoAxioms and in FamInsts is now a BranchList b,
where the type index b is either Branched or Unbranched. A handful
of functions work only on singleton (unbranched) axioms, and with this
change, the type checker verifies that we are calling these functions
appropriately.

 compiler/basicTypes/MkId.lhs  |   14 +-
 compiler/coreSyn/CoreLint.lhs |2 +-
 compiler/coreSyn/MkExternalCore.lhs   |2 +-
 compiler/iface/IfaceType.lhs  |2 +-
 compiler/iface/MkIface.lhs|8 +-
 compiler/iface/TcIface.lhs|   11 +-
 compiler/iface/TcIface.lhs-boot   |4 +-
 compiler/main/GHC.hs  |2 +-
 compiler/main/HscTypes.lhs|   19 ++-
 compiler/main/TidyPgm.lhs |2 +-
 compiler/typecheck/FamInst.lhs|   22 ++--
 compiler/typecheck/TcDeriv.lhs|4 +-
 compiler/typecheck/TcEnv.lhs  |2 +-
 compiler/typecheck/TcEvidence.lhs |   16 +-
 compiler/typecheck/TcGenDeriv.lhs |6 +-
 compiler/typecheck/TcGenGenerics.lhs  |4 +-
 compiler/typecheck/TcInstDcls.lhs |   26 ++--
 compiler/typecheck/TcRnDriver.lhs |4 +-
 compiler/typecheck/TcRnTypes.lhs  |2 +-
 compiler/typecheck/TcSplice.lhs   |8 +-
 compiler/typecheck/TcType.lhs |6 +-
 compiler/types/Coercion.lhs   |   29 ++--
 compiler/types/FamInstEnv.lhs |  153 +-
 compiler/types/OptCoercion.lhs|4 +-
 compiler/types/TyCon.lhs  |  179 -
 compiler/types/Type.lhs   |2 +-
 compiler/types/TypeRep.lhs|2 +-
 compiler/vectorise/Vectorise.hs   |3 +-
 compiler/vectorise/Vectorise/Env.hs   |2 +-
 compiler/vectorise/Vectorise/Generic/PADict.hs|3 +-
 compiler/vectorise/Vectorise/Generic/PAMethods.hs |5 +-
 compiler/vectorise/Vectorise/Generic/PData.hs |6 +-
 compiler/vectorise/Vectorise/Type/Env.hs  |   14 +-
 compiler/vectorise/Vectorise/Utils/PADict.hs  |4 +-
 34 files changed, 333 insertions(+), 239 deletions(-)


Diff suppressed because of size. To see it, use:

git show 1a3c0d345ba1f514f747b7791260672d74d1cd10

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams: Updated Template Haskell to reflect branched type family instances. (4df0d19)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/4df0d1979c36d40dcf51a291f5fed0dd7f00b5bc

---

commit 4df0d1979c36d40dcf51a291f5fed0dd7f00b5bc
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Tue Dec 4 08:57:13 2012 -0500

Updated Template Haskell to reflect branched type family instances.

 compiler/deSugar/DsMeta.hs  |   67 +-
 compiler/hsSyn/Convert.lhs  |   25 +--
 compiler/typecheck/TcSplice.lhs |   28 +---
 3 files changed, 74 insertions(+), 46 deletions(-)


Diff suppressed because of size. To see it, use:

git show 4df0d1979c36d40dcf51a291f5fed0dd7f00b5bc

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams: Updated user manual to include a section on branched type family (86e4ca3)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/86e4ca3070018aa72d09797d95339790efc5f908

---

commit 86e4ca3070018aa72d09797d95339790efc5f908
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Tue Dec 4 13:45:29 2012 -0500

Updated user manual to include a section on branched type family
instances.

---

 docs/users_guide/glasgow_exts.xml |   96 
 1 files changed, 74 insertions(+), 22 deletions(-)

diff --git a/docs/users_guide/glasgow_exts.xml 
b/docs/users_guide/glasgow_exts.xml
index aac9994..a728249 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -4858,31 +4858,66 @@ F Bool -- WRONG: unsaturated application
   sect3 id=type-instance-declarations
 titleType instance declarations/title
 para
-  Instance declarations of type families are very similar to standard type
-  synonym declarations.  The only two differences are that the
-  keyword literaltype/literal is followed
-  by literalinstance/literal and that some or all of the type
-  arguments can be non-variable types, but may not contain forall types or
-  type synonym families. However, data families are generally allowed, and
-  type synonyms are allowed as long as they are fully applied and expand
-  to a type that is admissible - these are the exact same requirements as
-  for data instances.  For example, the literal[e]/literal instance
-  for literalElem/literal is
+  There are two forms of type family instance declaration: unbranched and
+  branched. Branched instances list any number of alternatives, to be
+  checked in order from top to bottom, similarly to normal function
+  declarations. Unbranched instances supply only one left-hand side.
+
+  Unbranched instance declarations of type families are very similar to
+  standard type synonym declarations. The only two differences are that
+  the keyword literaltype/literal is followed by
+  literalinstance/literal and that some or all of the type arguments
+  can be non-variable types, but may not contain forall types or type
+  synonym families. However, data families are generally allowed, and type
+  synonyms are allowed as long as they are fully applied and expand to a
+  type that is admissible - these are the exact same requirements as for
+  data instances. For example, the literal[e]/literal instance for
+  literalElem/literal is
 programlisting
 type instance Elem [e] = e
 /programlisting
 /para
+
+para
+  Branched instance declarations, on the other hand, allow many different
+  left-hand-side type patterns. These patterns are tried in order, from
+  top to bottom, when simplifying a type family application. A branched 
instance
+  declaration is introduced by literaltype instance where/literal. For 
example:
+programlisting
+type instance where
+  F Int  = Double
+  F Bool = Char
+  F a= String
+/programlisting
+  In this example, we declare an instance for literalF/literal such
+  that literalF Int/literal simplifies to literalDouble/literal,
+  literalF Bool/literal simplifies to literalChar/literal, and for
+  any other type literala/literal that is known not to be
+  literalInt/literal or literalBool/literal, literalF
+  a/literal simplifies to literalString/literal. Note that GHC must
+  be sure that literala/literal cannot unify with
+  literalInt/literal or literalBool/literal in that last case; if
+  a programmer specifies just literalF a/literal in their code, GHC 
will
+  not be able to simplify the type. After all, literala/literal might 
later
+  be instantiated with literalInt/literal.
+/para
+
+para
+  Branched instances and unbranched instances may be mixed freely for the 
same
+  type family.
+/para
+
 para
   Type family instance declarations are only legitimate when an
   appropriate family declaration is in scope - just like class instances
-  require the class declaration to be visible.  Moreover, each instance
+  require the class declaration to be visible. Moreover, each instance
   declaration has to conform to the kind determined by its family
   declaration, and the number of type parameters in an instance
   declaration must match the number of type parameters in the family
-  declaration.   Finally, the right-hand side of a type instance must be a
+  declaration. Finally, the right-hand side of a type instance must be a
   monotype (i.e., it may not include foralls) and after the expansion of
   all saturated vanilla type synonyms, no synonyms, except family synonyms
-  may remain.  Here are some examples of 

[commit: ghc] overlapping-tyfams: Made a new file types/CoAxiom.lhs to declare CoAxioms, and updated (467d575)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/467d575eb1280b16eccd60138acb4597cc86698f

---

commit 467d575eb1280b16eccd60138acb4597cc86698f
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Wed Dec 5 12:29:55 2012 -0500

Made a new file types/CoAxiom.lhs to declare CoAxioms, and updated
docs/core-spec to reflect new axioms.

 compiler/basicTypes/MkId.lhs  |1 +
 compiler/coreSyn/CoreLint.lhs |   31 +--
 compiler/coreSyn/MkExternalCore.lhs   |1 +
 compiler/ghc.cabal.in |1 +
 compiler/iface/IfaceType.lhs  |1 +
 compiler/iface/MkIface.lhs|1 +
 compiler/iface/TcIface.lhs|1 +
 compiler/main/HscTypes.lhs|1 +
 compiler/typecheck/FamInst.lhs|1 +
 compiler/typecheck/TcEnv.lhs  |1 +
 compiler/typecheck/TcEvidence.lhs |1 +
 compiler/typecheck/TcGenDeriv.lhs |1 +
 compiler/typecheck/TcGenGenerics.lhs  |1 +
 compiler/typecheck/TcInstDcls.lhs |1 +
 compiler/typecheck/TcSplice.lhs   |1 +
 compiler/typecheck/TcType.lhs |1 +
 compiler/types/CoAxiom.lhs|  258 +
 compiler/types/Coercion.lhs   |1 +
 compiler/types/FamInstEnv.lhs |1 +
 compiler/types/OptCoercion.lhs|1 +
 compiler/types/TyCon.lhs  |  232 +--
 compiler/types/Type.lhs   |1 +
 compiler/types/TypeRep.lhs|1 +
 compiler/vectorise/Vectorise/Generic/PADict.hs|1 +
 compiler/vectorise/Vectorise/Generic/PAMethods.hs |1 +
 compiler/vectorise/Vectorise/Type/Env.hs  |1 +
 compiler/vectorise/Vectorise/Utils/PADict.hs  |1 +
 docs/core-spec/CoreLint.ott   |   36 +++-
 docs/core-spec/CoreSyn.ott|   37 ++-
 docs/core-spec/core-spec.mng  |   21 ++-
 docs/core-spec/core-spec.pdf  |  Bin 303537 - 308357 bytes
 31 files changed, 366 insertions(+), 273 deletions(-)


Diff suppressed because of size. To see it, use:

git show 467d575eb1280b16eccd60138acb4597cc86698f

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams: Merge branch 'master' into overlapping-tyfams (4f08c12)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/4f08c12fc7457926e325342b5f0d9f450f8f4e2f

---

commit 4f08c12fc7457926e325342b5f0d9f450f8f4e2f
Merge: 86e4ca3... e6ce335...
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Tue Dec 4 13:58:04 2012 -0500

Merge branch 'master' into overlapping-tyfams

Conflicts:
compiler/types/TyCon.lhs

 .gitignore |1 -
 .gitmodules|3 +
 boot   |   43 
 compiler/cmm/CmmPipeline.hs|   19 ++-
 compiler/coreSyn/CoreLint.lhs  |   55 -
 compiler/coreSyn/CoreSyn.lhs   |   20 ++
 compiler/ghc.cabal.in  |2 +-
 compiler/ghc.mk|3 +
 compiler/ghci/ByteCodeGen.lhs  |2 +-
 compiler/ghci/ByteCodeLink.lhs |2 +-
 compiler/ghci/LibFFI.hsc   |   34 +--
 compiler/ghci/Linker.lhs   |   26 +-
 compiler/iface/BinIface.hs |2 +-
 compiler/iface/IfaceSyn.lhs|2 +-
 compiler/iface/LoadIface.lhs   |2 +-
 compiler/iface/MkIface.lhs |2 +-
 compiler/main/DriverMkDepend.hs|4 +-
 compiler/main/DriverPipeline.hs|6 +-
 compiler/main/DynFlags.hs  |8 +-
 compiler/main/GHC.hs   |2 +-
 compiler/main/GhcMake.hs   |4 +-
 compiler/main/InteractiveEval.hs   |   20 +-
 compiler/main/Packages.lhs |   12 +-
 compiler/main/StaticFlagParser.hs  |6 +-
 compiler/main/StaticFlags.hs   |2 +-
 compiler/main/SysTools.lhs |8 +-
 compiler/parser/Parser.y.pp|1 +
 compiler/prelude/TysPrim.lhs   |2 +
 compiler/types/Coercion.lhs|4 +
 compiler/types/Kind.lhs|5 +
 compiler/types/TyCon.lhs   |6 +
 compiler/types/Type.lhs|2 +
 compiler/types/TypeRep.lhs |3 +
 compiler/utils/Outputable.lhs  |3 +-
 compiler/utils/Panic.lhs   |6 +-
 configure.ac   |   59 +-
 docs/core-spec/.gitignore  |5 +
 docs/core-spec/CoreLint.ott|  400 
 docs/core-spec/CoreSyn.ott |  283 ++
 docs/core-spec/Makefile|   17 ++
 docs/core-spec/README  |   83 +++
 docs/core-spec/core-spec.mng   |  306 
 docs/core-spec/core-spec.pdf   |  Bin 0 - 303537 bytes
 ghc.mk |3 +-
 ghc/GhciTags.hs|8 +-
 ghc/InteractiveUI.hs   |   68 +++---
 ghc/Main.hs|   18 +-
 ghc/ghc-bin.cabal.in   |2 +-
 libraries/Cabal|2 +-
 libraries/haskeline|2 +-
 libraries/tarballs/time-1.4.0.1.tar.gz |  Bin 87466 - 0 bytes
 libraries/time |1 +
 mk/config.mk.in|8 +-
 packages   |   24 +-
 rts/ghc.mk |   53 -
 rts/package.conf.in|3 +
 rts/posix/OSThreads.c  |3 +-
 sync-all   |   40 +++-
 utils/ghc-pkg/Main.hs  |   11 +-
 utils/ghc-pkg/ghc-pkg.cabal|2 +-
 utils/runghc/runghc.cabal.in   |2 +-
 61 files changed, 1510 insertions(+), 215 deletions(-)

diff --cc compiler/types/TyCon.lhs
index 98c100d,c686847..36b93d8
--- a/compiler/types/TyCon.lhs
+++ b/compiler/types/TyCon.lhs
@@@ -718,122 -709,20 +721,125 @@@ so the coercion tycon CoT must hav
  %*  *
  %
  
 +Note [Coercion axiom branches]
 +~~
 +In order to allow type family instance groups, an axiom needs to contain an
 +ordered list of alternatives, called branches. The kind of the coercion is
 +chosen based on which branch contains patterns that match the type variables
 +the axiom is instantiated with. The first such match is chosen.
 +
 +For type-checking, it is also necessary to check that no previous pattern
 +can unify with the supplied arguments. After all, it is possible that some
 +of the type arguments are lambda-bound type variables whose instantiation may
 +cause an earlier match among the branches. We wish to prohibit this behavior,
 +so the type checker rules out the choice of a branch where a previous branch
 +can unify. See also [Instance checking within groups] in FamInstEnv.hs.
 +
 +Note [Singleton axioms]
 +~~~
 +Although a CoAxiom has the 

[commit: ghc] overlapping-tyfams: Merge branch 'master' into overlapping-tyfams (52f2ba1)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/52f2ba1861e693776787cfee9de807f52db918db

---

commit 52f2ba1861e693776787cfee9de807f52db918db
Merge: 467d575... b0626b6...
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Wed Dec 5 12:33:46 2012 -0500

Merge branch 'master' into overlapping-tyfams

 compiler/basicTypes/DataCon.lhs   |8 ++-
 compiler/iface/LoadIface.lhs  |   92 +---
 compiler/main/DynamicLoading.hs   |7 +-
 compiler/rename/RnNames.lhs   |   40 +
 compiler/typecheck/TcRnTypes.lhs  |3 +
 compiler/typecheck/TcType.lhs |4 +-
 compiler/types/TyCon.lhs  |6 +-
 compiler/types/Type.lhs   |   10 +---
 compiler/utils/Outputable.lhs |3 +-
 configure.ac  |  118 ++--
 docs/users_guide/glasgow_exts.xml |   47 ++-
 11 files changed, 207 insertions(+), 131 deletions(-)

diff --cc compiler/types/Type.lhs
index 44d605f,f741078..bc3ae07
--- a/compiler/types/Type.lhs
+++ b/compiler/types/Type.lhs
@@@ -154,10 -152,9 +154,10 @@@ import VarSe
  import Class
  import TyCon
  import TysPrim
- import {-# SOURCE #-} TysWiredIn ( eqTyCon, mkBoxedTupleTy )
+ import {-# SOURCE #-} TysWiredIn ( eqTyCon )
  import PrelNames ( eqTyConKey, ipClassNameKey, 
 constraintKindTyConKey, liftedTypeKindTyConKey )
 +import CoAxiom
  
  -- others
  import Unique ( Unique, hasKey )



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams: Change output of CoAxioms to look prettier. (77e5aa7)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/77e5aa7766432c97ffebb06717c54dd8d8f413cb

---

commit 77e5aa7766432c97ffebb06717c54dd8d8f413cb
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Thu Dec 6 20:26:44 2012 -0500

Change output of CoAxioms to look prettier.

---

 compiler/types/Coercion.lhs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs
index a03dae2..c17650c 100644
--- a/compiler/types/Coercion.lhs
+++ b/compiler/types/Coercion.lhs
@@ -463,7 +463,7 @@ ppr_forall_co p ty
 \begin{code}
 pprCoAxiom :: CoAxiom br - SDoc
 pprCoAxiom ax@(CoAxiom { co_ax_tc = tc, co_ax_branches = branches })
-  = hang (ptext (sLit axiom) + ppr ax)
+  = hang (ptext (sLit axiom) + ppr ax + dcolon)
2 (vcat (map (pprCoAxBranch tc) $ fromBranchList branches))
 
 pprCoAxBranch :: TyCon - CoAxBranch - SDoc



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams: Miscellaneous bug fixes that came up during validation. (e5ded8b)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/e5ded8b76486bebc4fa5835a3e57d6012163cf3c

---

commit e5ded8b76486bebc4fa5835a3e57d6012163cf3c
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Thu Dec 6 20:06:56 2012 -0500

Miscellaneous bug fixes that came up during validation.

---

 compiler/typecheck/TcDeriv.lhs  |   13 ++---
 compiler/typecheck/TcInstDcls.lhs   |2 +-
 compiler/typecheck/TcRnDriver.lhs   |6 +-
 compiler/types/FamInstEnv.lhs   |1 +
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs
index 8e1adcb..15bfc72 100644
--- a/compiler/typecheck/TcDeriv.lhs
+++ b/compiler/typecheck/TcDeriv.lhs
@@ -43,6 +43,7 @@ import RdrName
 import Name
 import NameSet
 import TyCon
+import CoAxiom
 import TcType
 import Var
 import VarSet
@@ -348,8 +349,8 @@ tcDeriving tycl_decls inst_decls deriv_decls
 ; return (addTcgDUs gbl_env rn_dus, inst_info, rn_binds) }
   where
 ddump_deriving :: Bag (InstInfo Name) - HsValBinds Name
-   - Bag TyCon -- ^ Empty data constructors
-   - Bag (FamInst br)  -- ^ Rep type family instances
+   - Bag TyCon -- ^ Empty data constructors
+   - Bag (FamInst Unbranched)  -- ^ Rep type family instances
- SDoc
 ddump_deriving inst_infos extra_binds repMetaTys repFamInsts
   =hang (ptext (sLit Derived instances:))
@@ -359,10 +360,16 @@ tcDeriving tycl_decls inst_decls deriv_decls
   hangP Generated datatypes for meta-information:
(vcat (map ppr (bagToList repMetaTys)))
$$ hangP Representation types:
-(vcat (map ppr (bagToList repFamInsts
+(vcat (map pprRepTy (bagToList repFamInsts
 
 hangP s x = text  $$ hang (ptext (sLit s)) 2 x
 
+-- Prints the representable type family instance
+pprRepTy :: FamInst Unbranched - SDoc
+pprRepTy fi@(FamInst { fi_branches = FirstBranch (FamInstBranch { fib_lhs = lhs
+, fib_rhs = 
rhs }) })
+  = ptext (sLit type) + ppr (mkTyConApp (famInstTyCon fi) lhs) +
+  equals + ppr rhs 
 
 
 -- As of 24 April 2012, this only shares MetaTyCons between derivations of
diff --git a/compiler/typecheck/TcInstDcls.lhs 
b/compiler/typecheck/TcInstDcls.lhs
index ad24ab5..d15869d 100644
--- a/compiler/typecheck/TcInstDcls.lhs
+++ b/compiler/typecheck/TcInstDcls.lhs
@@ -434,7 +434,7 @@ addFamInsts :: [FamInst Branched] - TcM a - TcM a
 --(b) the type envt with stuff from data type decls
 addFamInsts fam_insts thing_inside
   = tcExtendLocalFamInstEnv fam_insts $ 
-tcExtendGlobalEnvImplicit things  $ 
+tcExtendGlobalEnv things  $ 
 do { traceTc addFamInsts (pprFamInsts fam_insts)
; tcg_env - tcAddImplicits things
; setGblEnv tcg_env thing_inside }
diff --git a/compiler/typecheck/TcRnDriver.lhs 
b/compiler/typecheck/TcRnDriver.lhs
index 4c3e5c4..c907a96 100644
--- a/compiler/typecheck/TcRnDriver.lhs
+++ b/compiler/typecheck/TcRnDriver.lhs
@@ -488,6 +488,8 @@ tc_rn_src_decls boot_details ds
 setEnvs (tcg_env, tcl_env) $
 case group_tail of {
Nothing - do { tcg_env - checkMain ;   -- Check for `main'
+   traceTc returning from tc_rn_src_decls:  $
+ ppr $ nameEnvElts $ tcg_type_env tcg_env ; -- RAE
return (tcg_env, tcl_env)
   } ;
 
@@ -955,7 +957,7 @@ tcTopSrcDecls boot_details
  -- tcg_dus: see Note [Newtype constructor 
usage in foreign declarations]
 
 addUsedRdrNames fo_rdr_names ;
-
+traceTc Tc8: type_env:  (ppr $ nameEnvElts $ tcg_type_env tcg_env') 
; -- RAE
 return (tcg_env', tcl_env)
 }}
   where
@@ -1635,6 +1637,8 @@ tcRnDeclsi hsc_env ictxt local_decls =
 
 tcg_env'' - setGlobalTypeEnv tcg_env' final_type_env
 
+traceTc returning from tcRnDeclsi:  $ ppr $ nameEnvElts $ tcg_type_env 
tcg_env'' -- RAE
+
 return tcg_env''
 
 
diff --git a/compiler/typecheck/TcTyClsDecls.lhs 
b/compiler/typecheck/TcTyClsDecls.lhs
index 065103b..7f12e49 100644
diff --git a/compiler/types/FamInstEnv.lhs b/compiler/types/FamInstEnv.lhs
index 3a9853d..f64d7ee 100644
--- a/compiler/types/FamInstEnv.lhs
+++ b/compiler/types/FamInstEnv.lhs
@@ -511,6 +511,7 @@ identicalFamInst :: FamInst br1 - FamInst br2 - Bool
 -- Used for overriding in GHCi
 identicalFamInst (FamInst { fi_axiom = ax1 }) (FamInst { fi_axiom = ax2 })
   =  nameModule (coAxiomName ax1) == nameModule (coAxiomName ax2)
+  coAxiomTyCon ax1 == coAxiomTyCon ax2
   brListLength brs1 == 

[commit: ghc] overlapping-tyfams: Merge branch 'master' into overlapping-tyfams (81a2dd3)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/81a2dd3b1e3c703acaea64993b7c3f72400f5063

---

commit 81a2dd3b1e3c703acaea64993b7c3f72400f5063
Merge: 77e5aa7... 9b2882c...
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Thu Dec 6 20:32:34 2012 -0500

Merge branch 'master' into overlapping-tyfams

 aclocal.m4|2 +-
 compiler/ghc.cabal.in |   10 +--
 compiler/ghc.mk   |   20 +++-
 compiler/ghci/keepCAFsForGHCi.c   |5 +-
 compiler/iface/IfaceType.lhs  |   71 ++---
 compiler/iface/LoadIface.lhs  |  116 -
 compiler/iface/MkIface.lhs|2 +-
 compiler/main/CodeOutput.lhs  |5 +-
 compiler/main/DriverPipeline.hs   |  128 ---
 compiler/main/DynFlags.hs |   29 +-
 compiler/main/TidyPgm.lhs |  207 +++-
 compiler/nativeGen/AsmCodeGen.lhs |   16 ++--
 12 files changed, 329 insertions(+), 282 deletions(-)

diff --cc compiler/iface/IfaceType.lhs
index 2bb6122,fd12af1..103d336
--- a/compiler/iface/IfaceType.lhs
+++ b/compiler/iface/IfaceType.lhs
@@@ -356,23 -348,22 +349,23 @@@ toIfaceContext = toIfaceType
  
  coToIfaceType :: Coercion - IfaceType
  coToIfaceType (Refl ty) = IfaceCoConApp IfaceReflCo [toIfaceType 
ty]
- coToIfaceType (TyConAppCo tc cos)   
+ coToIfaceType (TyConAppCo tc cos)
| tc `hasKey` funTyConKey
, [arg,res] - cos= IfaceFunTy (coToIfaceType arg) 
(coToIfaceType res)
-   | otherwise   = IfaceTyConApp (toIfaceTyCon tc) 
+   | otherwise   = IfaceTyConApp (toIfaceTyCon tc)
  (map coToIfaceType cos)
- coToIfaceType (AppCo co1 co2)   = IfaceAppTy(coToIfaceType co1) 
+ coToIfaceType (AppCo co1 co2)   = IfaceAppTy(coToIfaceType co1)
  (coToIfaceType co2)
- coToIfaceType (ForAllCo v co)   = IfaceForAllTy (toIfaceTvBndr v) 
+ coToIfaceType (ForAllCo v co)   = IfaceForAllTy (toIfaceTvBndr v)
  (coToIfaceType co)
  coToIfaceType (CoVarCo cv)  = IfaceTyVar  (toIfaceCoVar cv)
 -coToIfaceType (AxiomInstCo con cos) = IfaceCoConApp (coAxiomToIfaceType con)
 +coToIfaceType (AxiomInstCo con ind cos)
 += IfaceCoConApp (coAxiomToIfaceType con 
ind)
  (map coToIfaceType cos)
- coToIfaceType (UnsafeCo ty1 ty2)= IfaceCoConApp IfaceUnsafeCo 
+ coToIfaceType (UnsafeCo ty1 ty2)= IfaceCoConApp IfaceUnsafeCo
  [ toIfaceType ty1
  , toIfaceType ty2 ]
- coToIfaceType (SymCo co)= IfaceCoConApp IfaceSymCo 
+ coToIfaceType (SymCo co)= IfaceCoConApp IfaceSymCo
  [ coToIfaceType co ]
  coToIfaceType (TransCo co1 co2) = IfaceCoConApp IfaceTransCo
  [ coToIfaceType co1
diff --cc compiler/main/TidyPgm.lhs
index 7b1b6f3,0ea01d5..39ccd62
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@@ -153,9 -153,9 +153,9 @@@ mkBootModDetailsTc hsc_en
  }
where
  
 -mkBootTypeEnv :: NameSet - [Id] - [TyCon] - [FamInst] - TypeEnv
 +mkBootTypeEnv :: NameSet - [Id] - [TyCon] - [FamInst Branched] - TypeEnv
  mkBootTypeEnv exports ids tcs fam_insts
-   = tidyTypeEnv True False exports $
+   = tidyTypeEnv True $
 typeEnvFromEntities final_ids tcs fam_insts
where
  -- Find the LocalIds in the type env that are exported



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: ghc] overlapping-tyfams's head updated: Merge branch 'master' into overlapping-tyfams (81a2dd3)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

Branch 'overlapping-tyfams' now includes:

 2334112... Fix broken -fPIC on Darwin/PPC (#7442)
 77ef6ca... Replace all uses of ghcError with throwGhcException and purge 
ghcError.
 10edb42... Whitespace only in compiler/ghci/LibFFI.hsc
 c2f9b74... Small refactoring
 bd9e029... Remove a use of printf
 3005e90... Add configure option to use system provided libffi; fixes #5743
 2ec32a8... Add :info! to GHCi.  This shows all instances without 
filtering first.
 c793cc3... libffi build system tweaks
 e9f38cb... Remove accidentally-commited testing aid
 495ef78... Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/ghc
 779f10f... Extend parser to allow specification of RULES that never fire. 
#7162
 2c6939a... Make ghc-pkg print less on error.
 0bb2274... Remove unused PYTHON in build system
 7ee5bed... Link in-tree libffi to rts. Fixes trac #5743.
 7009f58... Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
 e305fc7... Detab
 d53e222... typo
 2332b4b... Remove case from coreLintExpr dealing with types, as it is not 
used.
 d2ff25f... Update dependencies
 4ef1bd4... Update submodules
 cfb9696... Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
 81b7e58... Added GHC formalism to the GHC source tree.
 959d5a9... Added the docs/core-spec README
 fe1fce8... Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/ghc
 b5ce9de... Remove dead code predTreePredType
 61f770f... isTauTy should be True for LitTy (see Trac #7459)
 1a3c0d3... Used a GADT to control appropriate use of functions on 
singleton axioms.
 0cb35b5... Mac OS X 10.6 needed for pthread_threadid_np(), fixes #7356
 45e70a1... Merge branch 'ticket-7442' of git://github.com/phonohawk/ghc
 d6d1559... Tweak comments
 56240c1... Update haskeline submodule
 691c8a8... Don't get submodules when 'get'ing
 8fd3f3c... Use a submodule for the time package
 ccce9fe... When pulling, only 'fetch' in submodules
 4b4f014... Add a check for old time packaes
 c3db2b2... Tweak sync-all
 31d771b... Use -e rather than -f when checking for libraries/time/.git
 3a40456... Make sync-all pull --rebase work
 67835fa... Removed confluent overlap check from branched type family 
instances.
 156d30d... Fix buglet in -ddump-minimal-imports (Trac #7476)
 9467f73... Merge branch 'master' of http://darcs.haskell.org/ghc
 e6ce335... Fix pprPanic so that it doesn't throw away the SDoc part of the 
error.
 88eeabc... Merge branch 'master' of http://darcs.haskell.org/ghc
 4df0d19... Updated Template Haskell to reflect branched type family 
instances.
 70c4e4b... Rearrange configure.ac a bit
 3c06c09... Rearrange configure.ac a bit
 86e4ca3... Updated user manual to include a section on branched type 
family instances.
 4f08c12... Merge branch 'master' into overlapping-tyfams
 50905e1... Revert Fix pprPanic so that it doesn't throw away the SDoc 
part of the error.
 c0d8469... Allow existential data constructors to be promoted
 431e804... Merge branch 'master' of http://darcs.haskell.org/ghc
 bb2f56a... Add comment
 f971e75... Merge branch 'master' of darcs.haskell.org:/home/darcs/ghc
 95d8658... In FP_GCC_VERSION, test $CC not $GCC
 3fc453a... Don't define DYNAMIC when compiling the dyn way
 57d6798... When using a GHC plugin, load its interface file very 
partially: just enough that it can be used, without its rules and instances 
affecting (and being linked from!) the module being compiled.
 b0626b6... Document promotion of existential data types
 467d575... Made a new file types/CoAxiom.lhs to declare CoAxioms, and 
updated docs/core-spec to reflect new axioms.
 52f2ba1... Merge branch 'master' into overlapping-tyfams
 5b746f5... Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
 3864da2... Typo
 71b5ca5... Refactor findAndReadIface; no functional changes
 ccdccee... Whitespace only in iface/IfaceType.lhs
 b25d709... Add the beginnings of support for building vanilla and dynamic 
at the same time
 d842dff... Use a MonadIO instance instead of an 'io' function
 9a20e54... Stop attempting to trim data types in interface files
 8a0534f... Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
 6bdac1c... Make nativeCodeGen return the rest of its UniqSupply
 9b2882c... Merge branch 'master' of mac:ghc/git/val64/.
 e5ded8b... Miscellaneous bug fixes that came up during validation.
 77e5aa7... Change output of CoAxioms to look prettier.
 81a2dd3... Merge branch 'master' into overlapping-tyfams

___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: testsuite] overlapping-tyfams: Updated Template Haskell tests to reflect change to TySynInstD. (d64423c)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/d64423c86131ac4008e81ffc762c5427a31b604f

---

commit d64423c86131ac4008e81ffc762c5427a31b604f
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Tue Dec 4 08:56:39 2012 -0500

Updated Template Haskell tests to reflect change to TySynInstD.

---

 tests/th/TH_TyInstWhere1.hs |   17 +
 tests/th/TH_TyInstWhere1.stderr |9 +
 tests/th/TH_TyInstWhere2.hs |   15 +++
 tests/th/TH_TyInstWhere2.stderr |5 +
 tests/th/TH_TyInstWhere3.hs |   18 ++
 tests/th/TH_TyInstWhere3.stderr |3 +++
 tests/th/TH_TyInstWhere4.hs |   20 
 tests/th/TH_TyInstWhere4.stderr |   16 
 8 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tests/th/TH_TyInstWhere1.hs b/tests/th/TH_TyInstWhere1.hs
new file mode 100644
index 000..8352d4b
--- /dev/null
+++ b/tests/th/TH_TyInstWhere1.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies #-}
+
+module TH_TyInstWhere1 where
+
+type family F (a :: k) (b :: k) :: Bool
+
+$([d| type instance where
+F a a = True
+F a b = False |])
+
+data Proxy a = P
+
+f :: Proxy True - Proxy (F Int Int)
+f x = x
+
+g :: Proxy False - Proxy (F Int Bool)
+g x = x 
\ No newline at end of file
diff --git a/tests/th/TH_TyInstWhere1.stderr b/tests/th/TH_TyInstWhere1.stderr
new file mode 100644
index 000..480e5bf
--- /dev/null
+++ b/tests/th/TH_TyInstWhere1.stderr
@@ -0,0 +1,9 @@
+TH_TyInstWhere1.hs:1:1: Splicing declarations
+[d| type instance where
+  F a a = True
+  F a b = False |]
+  ==
+TH_TyInstWhere1.hs:(7,3)-(9,24)
+type instance where
+  F a a = True
+  F a b = False
diff --git a/tests/th/TH_TyInstWhere2.hs b/tests/th/TH_TyInstWhere2.hs
new file mode 100644
index 000..ec27ced
--- /dev/null
+++ b/tests/th/TH_TyInstWhere2.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies #-}
+
+module TH_TyInstWhere2 where
+
+import Language.Haskell.TH
+
+type family F (a :: k) (b :: k) :: Bool
+
+$( do { decs - [d| type instance where
+  F a a = True
+  F a b = False |]
+  ; reportWarning (pprint decs)
+  ; return [] })
+
+
diff --git a/tests/th/TH_TyInstWhere2.stderr b/tests/th/TH_TyInstWhere2.stderr
new file mode 100644
index 000..4ed490e
--- /dev/null
+++ b/tests/th/TH_TyInstWhere2.stderr
@@ -0,0 +1,5 @@
+
+TH_TyInstWhere2.hs:9:4: Warning:
+type instance where
+TH_TyInstWhere2.F a_0 a_0 = 'GHC.Types.True
+TH_TyInstWhere2.F a_1 b_2 = 'GHC.Types.False
diff --git a/tests/th/TH_TyInstWhere3.hs b/tests/th/TH_TyInstWhere3.hs
new file mode 100644
index 000..54d76f5
--- /dev/null
+++ b/tests/th/TH_TyInstWhere3.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies #-}
+
+module TH_TyInstWhere3 where
+
+import Language.Haskell.TH
+
+type family F a
+
+$( do { decs - [d| type instance where
+  F Int = Int |]
+  ; reportWarning (pprint decs)
+  ; return decs })
+
+type instance F a = a 
+
+-- When this test was written, TH considered all singleton type family instance
+-- as unbranched. Thus, even though the two instances above would not play 
nicely
+-- without TH, they should be fine with TH.
diff --git a/tests/th/TH_TyInstWhere3.stderr b/tests/th/TH_TyInstWhere3.stderr
new file mode 100644
index 000..eaebfec
--- /dev/null
+++ b/tests/th/TH_TyInstWhere3.stderr
@@ -0,0 +1,3 @@
+
+TH_TyInstWhere3.hs:9:4: Warning:
+type instance TH_TyInstWhere3.F GHC.Types.Int = GHC.Types.Int
diff --git a/tests/th/TH_TyInstWhere4.hs b/tests/th/TH_TyInstWhere4.hs
new file mode 100644
index 000..86415ff
--- /dev/null
+++ b/tests/th/TH_TyInstWhere4.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies #-}
+
+module TH_TyInstWhere4 where
+
+import Language.Haskell.TH
+
+type family F a b :: Bool
+type instance where
+  F a a = True
+  F a b = False
+
+$( do { info1 - reify ''F
+  ; reportWarning (pprint info1)
+  ; info2 - reifyInstances ''F [ConT ''Int, ConT ''Int]
+  ; reportWarning (pprint info2)
+  ; info3 - reifyInstances ''F [ConT ''Int, ConT ''Bool]
+  ; reportWarning (pprint info3)
+  ; return [] })
+
+
diff --git a/tests/th/TH_TyInstWhere4.stderr b/tests/th/TH_TyInstWhere4.stderr
new file mode 100644
index 000..70dfe85
--- /dev/null
+++ b/tests/th/TH_TyInstWhere4.stderr
@@ -0,0 +1,16 @@
+
+TH_TyInstWhere4.hs:12:4: Warning:
+type family TH_TyInstWhere4.F a_0 b_1 :: * - * - GHC.Types.Bool
+type instance where
+TH_TyInstWhere4.F a_2 a_2 = GHC.Types.True
+TH_TyInstWhere4.F a_3 b_4 = GHC.Types.False
+
+TH_TyInstWhere4.hs:12:4: 

[commit: testsuite] overlapping-tyfams: Merge branch 'master' into overlapping-tyfams (495a1b4)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/495a1b478a3b10b1b7c8f5cebffacb07ded94430

---

commit 495a1b478a3b10b1b7c8f5cebffacb07ded94430
Merge: 741f6be... 7ef55d7...
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Wed Dec 5 12:33:56 2012 -0500

Merge branch 'master' into overlapping-tyfams

 tests/polykinds/Holdermans.hs |   11 ---
 tests/polykinds/Holdermans.stderr |6 --
 tests/polykinds/T7347.hs  |4 ++--
 tests/polykinds/T7347.stderr  |6 --
 tests/polykinds/all.T |3 +--
 5 files changed, 3 insertions(+), 27 deletions(-)



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


[commit: testsuite] overlapping-tyfams: Updated test cases to reflect removal of type instance where confluent (f915be8)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/f915be8fefe9b69a9e21e606da924b3f59764196

---

commit f915be8fefe9b69a9e21e606da924b3f59764196
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Mon Dec 3 12:53:44 2012 -0500

Updated test cases to reflect removal of type instance where confluent
overlap checking.

---

 .../Overlap6.hs = should_compile/Overlap12.hs}|8 +++---
 tests/indexed-types/should_compile/all.T   |3 +-
 .../{should_compile = should_fail}/Overlap11.hs   |0 
 tests/indexed-types/should_fail/Overlap11.stderr   |6 
 .../{should_compile = should_fail}/Overlap5.hs|0 
 tests/indexed-types/should_fail/Overlap5.stderr|   29 
 tests/indexed-types/should_fail/all.T  |2 +
 7 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/tests/indexed-types/should_fail/Overlap6.hs 
b/tests/indexed-types/should_compile/Overlap12.hs
similarity index 67%
copy from tests/indexed-types/should_fail/Overlap6.hs
copy to tests/indexed-types/should_compile/Overlap12.hs
index c97992e..414c9d9 100644
--- a/tests/indexed-types/should_fail/Overlap6.hs
+++ b/tests/indexed-types/should_compile/Overlap12.hs
@@ -1,16 +1,16 @@
 {-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-}
 
-module Overlap6 where
+module Overlap12 where
 
 type family And (a :: Bool) (b :: Bool) :: Bool
 type instance where
   And False x = False
-  And True x = False -- this is wrong!
+  And True x = x
   And x False = False
   And x True = x
   And x x = x
 
 data Proxy p = P
 
-g :: Proxy x - Proxy (And x True)
-g x = x
+i :: Proxy (And False x)
+i = (P :: Proxy False)
\ No newline at end of file
diff --git a/tests/indexed-types/should_compile/all.T 
b/tests/indexed-types/should_compile/all.T
index 72ea340..583ab7c 100644
--- a/tests/indexed-types/should_compile/all.T
+++ b/tests/indexed-types/should_compile/all.T
@@ -199,8 +199,7 @@ test('T7082', normal, compile, [''])
 
 test('Overlap1', normal, compile, [''])
 test('Overlap2', normal, compile, [''])
-test('Overlap5', normal, compile, [''])
-test('Overlap11', normal, compile, [''])
+test('Overlap12', normal, compile, [''])
 test('T7156', normal, compile, [''])
 test('T5591a', normal, compile, [''])
 test('T5591b', normal, compile, [''])
diff --git a/tests/indexed-types/should_compile/Overlap11.hs 
b/tests/indexed-types/should_fail/Overlap11.hs
similarity index 100%
rename from tests/indexed-types/should_compile/Overlap11.hs
rename to tests/indexed-types/should_fail/Overlap11.hs
diff --git a/tests/indexed-types/should_fail/Overlap11.stderr 
b/tests/indexed-types/should_fail/Overlap11.stderr
new file mode 100644
index 000..0d657da
--- /dev/null
+++ b/tests/indexed-types/should_fail/Overlap11.stderr
@@ -0,0 +1,6 @@
+
+Overlap11.hs:11:6:
+Couldn't match expected type `F a Int' with actual type `Int'
+Relevant bindings include g :: F a Int (bound at Overlap11.hs:11:1)
+In the expression: (5 :: Int)
+In an equation for `g': g = (5 :: Int)
diff --git a/tests/indexed-types/should_compile/Overlap5.hs 
b/tests/indexed-types/should_fail/Overlap5.hs
similarity index 100%
rename from tests/indexed-types/should_compile/Overlap5.hs
rename to tests/indexed-types/should_fail/Overlap5.hs
diff --git a/tests/indexed-types/should_fail/Overlap5.stderr 
b/tests/indexed-types/should_fail/Overlap5.stderr
new file mode 100644
index 000..329d410
--- /dev/null
+++ b/tests/indexed-types/should_fail/Overlap5.stderr
@@ -0,0 +1,29 @@
+
+Overlap5.hs:16:7:
+Couldn't match type `x' with `And x 'True'
+  `x' is a rigid type variable bound by
+  the type signature for
+g :: Proxy Bool x - Proxy Bool (And x 'True)
+  at Overlap5.hs:15:6
+Expected type: Proxy Bool (And x 'True)
+  Actual type: Proxy Bool x
+Relevant bindings include
+  g :: Proxy Bool x - Proxy Bool (And x 'True)
+(bound at Overlap5.hs:16:1)
+  x :: Proxy Bool x (bound at Overlap5.hs:16:3)
+In the expression: x
+In an equation for `g': g x = x
+
+Overlap5.hs:19:7:
+Couldn't match type `x' with `And x x'
+  `x' is a rigid type variable bound by
+  the type signature for h :: Proxy Bool x - Proxy Bool (And x x)
+  at Overlap5.hs:18:6
+Expected type: Proxy Bool (And x x)
+  Actual type: Proxy Bool x
+Relevant bindings include
+  h :: Proxy Bool x - Proxy Bool (And x x)
+(bound at Overlap5.hs:19:1)
+  x :: Proxy Bool x (bound at Overlap5.hs:19:3)
+In the expression: x
+In an equation for `h': h x = x
diff --git a/tests/indexed-types/should_fail/all.T 
b/tests/indexed-types/should_fail/all.T
index 4b7f99b..eaf1b19 100644
--- a/tests/indexed-types/should_fail/all.T
+++ b/tests/indexed-types/should_fail/all.T
@@ -80,11 

[commit: testsuite] overlapping-tyfams: Changed expected output of one test to account for pretty-printer (063c8db)

2012-12-06 Thread Richard Eisenberg
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : overlapping-tyfams

http://hackage.haskell.org/trac/ghc/changeset/063c8db1f41379c5425fce3f2b293ae01c59706e

---

commit 063c8db1f41379c5425fce3f2b293ae01c59706e
Author: Richard Eisenberg e...@cis.upenn.edu
Date:   Thu Dec 6 21:15:54 2012 -0500

Changed expected output of one test to account for pretty-printer
change.

---

 tests/indexed-types/should_compile/T3017.stderr |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/indexed-types/should_compile/T3017.stderr 
b/tests/indexed-types/should_compile/T3017.stderr
index 30b5e01..b7bedae 100644
--- a/tests/indexed-types/should_compile/T3017.stderr
+++ b/tests/indexed-types/should_compile/T3017.stderr
@@ -15,7 +15,7 @@ TYPE CONSTRUCTORS
   = L :: forall a. [a] - ListColl a Stricts: _
   FamilyInstance: none
 COERCION AXIOMS
-  axiom Foo.TFCo:R:ElemListColl forall a. Elem (ListColl a) ~# a
+  axiom Foo.TFCo:R:ElemListColl :: forall a. Elem (ListColl a) ~# a
 INSTANCES
   instance Coll (ListColl a) -- Defined at T3017.hs:12:11
 FAMILY INSTANCES



___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc


  1   2   >