RE: Local evidence and type class instances

2010-10-18 Thread Simon Peyton-Jones
| Now that the Glorious New type checker can handle local evidence
| seamlessly, is it a big implementation burden to extend it to deal
| with local *type class instances* in addition to local *equality
| constraints*?
...
| Are there big theoretical problems with this extension, or is it just
| a lack of engineering effort that has prevented its implementation?

The issues I know about are

a) overlap (of course)
b) coherence (two different instances in two places)
c) if you add associated types, then soundness too
d) completeness

Concerning (c) you can't define (type instance F Int = Bool) in one place and 
(type instance F Int = Char) somewhere else, or you'll have seg faults.  GHC 
checks that you don't, but it can only do that because the instances are global.

Perhaps most important

Concerning (d) we only have a theory for local *constraints*, not for local 
*constraint schemes* (ie with foralls in them).  To get complete inference with 
assumptions like (F (G x) ~ G x) was tricky enough.  Adding schemes would make 
it harder.

But yes, it'd be useful.  As well as Oleg and Ken's paper, the "Derivable type 
classes" paper that Ralf and I wrote some time ago argues for local constraint 
schemes.

Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: ghc7 typing problem

2010-10-18 Thread Simon Peyton-Jones
Thanks.  We knew about this -- in flight changes happening now -- but I've 
added it as a new regression test even so.

Simon

| -Original Message-
| From: Christian Maeder [mailto:christian.mae...@dfki.de]
| Sent: 15 October 2010 17:53
| To: GHC Users Mailing List
| Cc: Simon Peyton-Jones
| Subject: ghc7 typing problem
| 
| Hi,
| 
| I've looked at:
| http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7
| 
| but still have a problem with the attached program that fails with:
| 
| GHCi, version 7.1.20101010: http://www.haskell.org/ghc/  :? for help Loading 
package
| ghc-prim ... linking ... done.
| Loading package integer-gmp ... linking ... done.
| Loading package base ... linking ... done.
| Loading package ffi-1.0 ... linking ... done.
| [1 of 1] Compiling Main ( HasKey.hs, interpreted )
| 
| HasKey.hs:17:10:
| Couldn't match type `key' with `key1'
|   because this skolem type variable would escape: `key1'
| This skolem is bound by the instance declaration
| In the instance declaration for `Ord (Keyed x)'
| 
| at the final instance for Ord.
| 
| The original code comes from
| http://hackage.haskell.org/packages/archive/uni-util/2.2.0.0/doc/html/Util-
| VariableSet.html
| 
| Cheers Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC 7.0.1 Release Candidate 1

2010-10-18 Thread Evan Laforge
>> I created
>> http://hackage.haskell.org/trac/ghc/ticket/4354 and attached the
>> patch.
>
> We now have a mixture of
>    org.haskell.ghc
> and
>    org.haskell.GHC
>
> Is that deliberate, or should I lowercase them all?

Not deliberate.  I updated the patch in my client to lowercase them
all.  Haven't uploaded it yet because of the question below.

>> The main question is whether or not I can kill Uninstaller, as it's
>> even more broken now than it was before.  If yes, I'll attach another
>> patch that removes it.
>
> I'd prefer to fix it, if possible. Is there anything magic about the
> name, or could we have Uninstaller-7.0.1 etc?

I don't think there's anything magic about the name.  The tricky thing
about uninstallation is detecting when you uninstalled the currently
"active" version (as defined by the plain 'ghc' symlinks and thy
Current symlink), and either remove the links in that case, or pick
the highest remaining version and relink it.  And then there's the
question of the man pages.  We should probably install versioned man
pages and play the same game with links for what happens when you type
'man ghc' (hopefully it's the version that runs when you type 'ghc'!).
 I'd also want to hook into the configure system to create a versioned
uninstall script from a template... I assume there's already machinery
for that stuff, I just don't know how to plug it in.  If it's ok, I
could submit the patch with the template version and let you plug in
the magic to make configure replace the VERSION macro.

This is all getting a little complicated.  Well, it's not complicated
for a real programming language, but this is shell we're talking
about.  So as long as I'm rewriting it, I'm tempted to do so in
python, which all OS X installs have.  So the steps would be:

- install versioned man pages
- add man pages to create-links
- write a new uninstaller that does all the magic above

WRT stuff like versioned man pages, I'm also reluctant to diverge from
what the standard unix install does.  How does it handle multiple
versions and uninstalls?
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Template Haskell: onward and upward

2010-10-18 Thread Simon Peyton-Jones
Folks

Following lots of feedback from users, especially at ICFP, I've evolved some 
proposals for Template Haskell, that should make it both more expressive, and 
more secure.

http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal

Do let me know what you think.  Discussion by email is fine (cc me if it's on 
Haskell-cafe), or comments direct on the Trac.

(None of this will be in GHC 7.0; it's a proposed plan for post-release 
improvements.)

Thanks

Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Has something about -prof -auto-all changed in GHC 7?

2010-10-18 Thread Bryan O'Sullivan
On Tue, Oct 12, 2010 at 2:08 AM, Simon Marlow  wrote:

> Nothing has changed in this area that I'm aware of.  Could you give more
> details?
>

Sure. I'm building darcs HEAD of the text library using both 6.12.3 and 7:

darcs get http://code.haskell.org/text
cd text
cabal install --enable-library-profiling


It gets built with -prof -auto-all (see ghc-prof-opts in text.cabal).

If you then go into the tests/benchmarks directory, you can build and run
the Equality benchmark:

ghc -prof -auto-all -O --make Equality


(add -rtsopts if using 7)

Grab this sample file: http://www.facebook.com/jobs_puzzles/twl06.txt

Then run Equality on it:

time ./Equality text twl06.txt +RTS -P


I've attached samples of the .prof files generated by each version of GHC so
you can see the rather dramatic difference. To my eye, it looks like
something is quite wrong with the version from 7.
Mon Oct 18 21:38 2010 Time and Allocation Profiling Report  (Final)

   Equality +RTS -P -RTS text /home/bos/Download/twl06.txt

total time  =   10.76 secs   (538 ticks @ 20 ms)
total alloc = 8,639,840,712 bytes  (excludes profiling overheads)

COST CENTREMODULE   %time %alloc  ticks 
bytes

stream Data.Text.Fusion  58.9   77.8317 
840142256
==_a2R5Data.Text.Fusion.Internal  11.00.0 59
 0
==_aFRUData.Text  9.70.0 52 0
text   Main   8.00.0 43
227712
unsafeIndexData.Text.Array5.87.0 31  
76017314
unsafeChr  Data.Text.UnsafeChar   3.57.0 19  
76017314
maxSizeData.Text.Fusion.Size   1.76.6  9  
71476400



   individualinherited
COST CENTRE  MODULE   
no.entries  %time %alloc   %time %alloc  ticks bytes

MAIN MAIN   
1   0   0.00.0   100.0  100.0  0   672
 mainMain 
334   1   0.00.0   100.0  100.0  0 0
  text   Main 
336   1   8.00.0   100.0  100.0 43   1821696
   ==_aFRU   Data.Text
34817869100   9.70.090.5   98.5 52 0
==_a2R5  Data.Text.Fusion.Internal
35517869100  11.00.011.00.0 59 0
stream   Data.Text.Fusion 
34935738200  58.9   77.869.9   98.5317 6721138048
 unsafeChr   Data.Text.UnsafeChar 
35738008657   3.57.0 3.57.0 19 608138512
 unsafeIndex Data.Text.Array  
35638008657   5.87.0 5.87.0 31 608138512
 maxSize Data.Text.Fusion.Size
35435738200   1.76.6 1.76.6  9 571811200
   lines Data.Text
346  178691   0.00.2 0.91.4  0  20013392
unsafeTail   Data.Text.Unsafe 
358  178690   0.00.1 0.00.1  0   5718080
 iter_   Data.Text.Unsafe 
359  178690   0.00.0 0.00.0  0 0
spanBy   Data.Text
350  714763   0.60.4 0.91.2  3  31449600
 iterData.Text.Unsafe 
352 1763166   0.20.5 0.20.5  1  42315984
 textP   Data.Text.Internal   
351  357382   0.00.2 0.20.3  0  14295280
  text   Data.Text.Internal   
353  357381   0.20.1 0.20.1  1  11436192
null Data.Text
347  357382   0.00.0 0.00.0  0 0
   decodeUtf8Data.Text.Encoding   
337   1   0.00.0 0.60.0  0 0
decodeUtf8With   Data.Text.Encoding   
338   2   0.60.0 0.60.0  380
 textP   Data.Text.Internal   
344   1   0.00.0 0.00.0  0 0
  text   Data.Text.Internal   
345   1   0.0