Re: [GHC] #876: Length is not a good consumer

2016-12-13 Thread George Colpitts
Joachim, thanks for the kind words but I'll be more careful not to waste
people's time with bad bug reports like that.

I got confused; when I  I google   "haskell list length" I end up at
https://hackage.haskell.org/package/base-4.9.0.0/docs/*Data-List*.html
.
When I look at the source code for length by clicking on "Source" It takes
me to the start of the file
https://hackage.haskell.org/package/base-4.9.0.0/docs/src/*Data.Foldable*
.html#length
.
instead of the definition of length in
https://hackage.haskell.org/package/base-4.9.0.0/docs/src/*GHC.List.*
html#length

.

To me, this seems like a bug in haddock. In *Data.List*.html when I click
on the source code for init I go to
https://hackage.haskell.org/package/base-4.9.0.0/docs/src/GHC.List.html#init.
This is the file  I should go to for the source code for length also.
Perhaps the problem is that the type of length in Data.List is Foldable t
=> t a -> Int while init is [a] -> [a] ? Should I file a haddock bug for
the preceding?

There seems to be two minor related problems with the Users Guide
(8.0.1.20161117) in section 10.32.6,List fusion. First, it should mention
length as a good consumer. Secondly, it says: "If you want to write your
own good consumers or producers, look at the Prelude definitions of the
above functions to see how to do so." However if you go to
https://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude.html and look
at the source code for length you end up at
https://hackage.haskell.org/package/base-4.9.0.0/docs/src/Data.Foldable.html#length
which
is not a good consumer. I think the User's Guide should be changed to
replace "Prelude" with "Data.List" in the quoted sentence. I'll file a doc
bug on the User's Guide for these two issues.  Also making a function
implement list fusion is not always easy, e.g. the bug, length is not a
good consumer, was open for six years before being fixed. Thus I will
suggest in the bug that we delete "readily" and change "Prelude" to
"Data.List" in "This list could readily be extended; if there are Prelude
functions that you use a lot which are not included, please tell us."

Of course the preceding is not an excuse for giving space allocations of
interpreted code when I reopened the bug but at that point I was convinced
that there was a problem and wasn't critical of the "evidence" I was giving
to support my claim.

Thanks
George


On Mon, Dec 12, 2016 at 11:44 AM Joachim Breitner 
wrote:

Am Montag, den 12.12.2016, 12:44 + schrieb George Colpitts:
> my apologies, sorry for the terrible bug report

No worries! Better a bug report closed as invalid than a real bug
unreported.

Greetings,
Joachim

--
--
Joachim “nomeata” Breitner
  m...@joachim-breitner.de • https://www.joachim-breitner.de/
  XMPP: nome...@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nome...@debian.org
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Explicit inequality evidence

2016-12-13 Thread Richard Eisenberg
I've thought about inequality on and off for years now, but it's a hard nut to 
crack. If we want this evidence to affect closed type family reduction, then we 
would need evidence of inequality in Core, and a brand-spanking-new type safety 
proof. I don't wish to discourage this inquiry, but I also don't think this 
battle will be won easily.

Richard

> On Dec 13, 2016, at 1:02 AM, David Feuer  wrote:
> 
> On Tue, Dec 13, 2016 at 12:49 AM, Oleg Grenrus  wrote:
>> First the bike shedding: I’d prefer /~ and :/~:.
> 
> Those are indeed better.
> 
>> new Typeable [1] would actually provide heterogenous equality:
>> 
>> eqTypeRep' :: forall k1 k2 (a :: k1) (b :: k2).
>>TypeRep a -> TypeRep b -> Maybe (a :~~: b)
>> 
>> And this one is tricky, should it be:
>> 
>> eqTypeRep' :: forall k1 k2 (a :: k1) (b :: k2).
>>   TypeRep a -> TypeRep b ->
>>   Either (Either (k1 :/~: k2) (a :/~: b)) (a :~~: b)
>> 
>> i.e. how kind inequality would work?
> 
> I don't know. It sounds like some details of how kinds are expressed
> in TypeRep might still be a bit uncertain, but I'm not tuned in. Maybe
> we should punt and use heterogeneous inequality? That's over my head.
> 
>> I'm not sure about propagation rules, with inequality you have to be *very* 
>> careful!
>> 
>> irreflexivity, x /~ x and symmetry x /~ y <=> y /~ x are clear.
>> 
>> I assume that in your rules, variables are not type families, otherwise
>> 
>> x /~ y => f x /~ f y doesn't hold if `f` isn't injective. (e.g. type family 
>> F x where F x = ())
>> other direction is true though.
> 
> I was definitely imagining them as first-class types; your point that
> f x /~ f y => x /~ y even if f is a type family is an excellent one.
> 
>> Also:
>> 
>> f x ~ a -> b, is true with f ~ (->) a, x ~ b.
> 
> Whoops! Yeah, I momentarily forgot that (->) is a constructor. Just
> leave out that bogus piece.
> 
> Thanks,
> David Feuer
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: [GHC] #876: Length is not a good consumer

2016-12-13 Thread Joachim Breitner
Dear George,

Am Dienstag, den 13.12.2016, 12:24 + schrieb George Colpitts:
> I got confused; when I  I google   "haskell list length" I end up at 
> https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-List.html.
> When I look at the source code for length by clicking on "Source" It
> takes me to the start of the file https://hackage.haskell.org/package
> /base-4.9.0.0/docs/src/Data.Foldable.html#length. instead of the
> definition of length in https://hackage.haskell.org/package/base-4.9.
> 0.0/docs/src/GHC.List.html#length. 
> 
> To me, this seems like a bug in haddock. In Data.List.html when I
> click on the source code for init I go to https://hackage.haskell.org
> /package/base-4.9.0.0/docs/src/GHC.List.html#init.  This is the file
>  I should go to for the source code for length also. Perhaps the
> problem is that the type of length in Data.List is Foldable t => t a
> -> Int while init is [a] -> [a] ? Should I file a haddock bug for the
> preceding?

not, this is all right and intentional. Data.List re-exports
Data.Foldable.length so that you do not get import conflicts when
importing both. This was a design decision back then when the FTP
(Foldable/Traversable) proposal was enacted.

> There seems to be two minor related problems with the Users Guide
> (8.0.1.20161117) in section 10.32.6,List fusion. First, it should
> mention length as a good consumer. Secondly, it says: "If you want to
> write your own good consumers or producers, look at the Prelude
> definitions of the above functions to see how to do so." However if
> you go to https://hackage.haskell.org/package/base-
> 4.9.0.0/docs/Prelude.html and look at the source code for length you
> end up at https://hackage.haskell.org/package/base-
> 4.9.0.0/docs/src/Data.Foldable.html#length which is not a good
> consumer. I think the User's Guide should be changed to replace
> "Prelude" with "Data.List" in the quoted sentence. I'll file a doc
> bug on the User's Guide for these two issues.

Yes, that would be helpful. The text has not been added since FTP.

Maybe even better, the user’s guide could simply contain a section that
explains how to make good consumers and producer, including the hoops
that one has to jump through when one wants to use the library’s
version of a function when no fusion happens. Maybe together with David
Feuer, who most recently battled with that.


Maybe I can write that, I just had to write about list fusion for a
paper anyways.

Greetings,
Joachim
-- 
Joachim “nomeata” Breitner
  m...@joachim-breitner.de • https://www.joachim-breitner.de/
  XMPP: nome...@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nome...@debian.org

signature.asc
Description: This is a digitally signed message part
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Reason for fixing minimum bootstrap version at 2 major releases ago?

2016-12-13 Thread Shea Levy
Hi all,

I'm wondering, why do we require ghc to be bootstrappable with the past
2 major releases instead of just the past 1? Is it a common case that
someone is compiling GHC but can't easily get the latest release?

Thanks,
Shea


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Reason for fixing minimum bootstrap version at 2 major releases ago?

2016-12-13 Thread Matthias Kilian
Hi,

On Tue, Dec 13, 2016 at 12:48:25PM -0500, Shea Levy wrote:
> I'm wondering, why do we require ghc to be bootstrappable with the past
> 2 major releases instead of just the past 1? Is it a common case that
> someone is compiling GHC but can't easily get the latest release?

Well, I can't speak for those who made this decision, but supporting
more than one major release eases the life of os distribution package
maintainers, especially in cases where the distribution package had
been left behind for too long, which may happen for many reasons,
like a maintainer dropped maintainership and a new one has to be
found first, or like a maintainer missing a major release because
he's to busy or too lazy. (The latter sometimes applies to me ;-))

Ciao,
Kili
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Reverted f723ba2f3b6d778f903fb1de4a5af93fe65eed10

2016-12-13 Thread Ben Gamari
Hi Simon,

Earlier today I noticed that the testsuite started failing with
f723ba2f3b6d778f903fb1de4a5af93fe65eed10 due to break024 and break011.
See https://phabricator.haskell.org/harbormaster/build/16407/ (I've
included the output differences below).

I've reverted the patch to keep the tree buildable but obviously feel
free to commit again when it validates.

Cheers,

- Ben



--- "/tmp/ghctest-zc_e5ng4/test   
spaces/./ghci.debugger/scripts/break011.run/break011.stdout.normalised"   
2016-12-13 01:09:56.868988119 +
+++ "/tmp/ghctest-zc_e5ng4/test   
spaces/./ghci.debugger/scripts/break011.run/break011.run.stdout.normalised"   
2016-12-13 01:09:56.868988119 +
@@ -40,17 +40,9 @@
 CallStack (from HasCallStack):
   error, called at Test7.hs:: in :Main
 Stopped in , 
-_exception :: e = SomeException
-(ErrorCallWithLocation
-   "foo"
-   "CallStack (from HasCallStack):
-  error, called at Test7.hs:: in :Main")
+_exception :: e = _
 Stopped in , 
-_exception :: e = SomeException
-(ErrorCallWithLocation
-   "foo"
-   "CallStack (from HasCallStack):
-  error, called at Test7.hs:: in :Main")
+_exception :: e = _
 *** Exception: foo
 CallStack (from HasCallStack):
   error, called at Test7.hs:: in :Main
--- "/tmp/ghctest-zc_e5ng4/test   
spaces/./ghci.debugger/scripts/break024.run/break024.stdout.normalised"   
2016-12-13 01:09:57.464988119 +
+++ "/tmp/ghctest-zc_e5ng4/test   
spaces/./ghci.debugger/scripts/break024.run/break024.run.stdout.normalised"   
2016-12-13 01:09:57.464988119 +
@@ -11,8 +11,7 @@
(GHC.IO.Exception.IOError
   Nothing GHC.IO.Exception.UserError [] "error" Nothing 
Nothing)
 Stopped in , 
-_exception :: e = SomeException
-(GHC.IO.Exception.IOError Nothing 
GHC.IO.Exception.UserError )
+_exception :: e = _
 Stopped in , 
 _exception :: e = _
_exception = SomeException


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Reverted f723ba2f3b6d778f903fb1de4a5af93fe65eed10

2016-12-13 Thread Simon Peyton Jones via ghc-devs
Sorry about that.  Didn't break for me.  I'll check.

Simon

| -Original Message-
| From: Ben Gamari [mailto:b...@well-typed.com]
| Sent: 13 December 2016 22:44
| To: Simon Peyton Jones 
| Cc: GHC developers 
| Subject: Reverted f723ba2f3b6d778f903fb1de4a5af93fe65eed10
| 
| Hi Simon,
| 
| Earlier today I noticed that the testsuite started failing with
| f723ba2f3b6d778f903fb1de4a5af93fe65eed10 due to break024 and break011.
| See https://phabricator.haskell.org/harbormaster/build/16407/ (I've
| included the output differences below).
| 
| I've reverted the patch to keep the tree buildable but obviously feel
| free to commit again when it validates.
| 
| Cheers,
| 
| - Ben
| 
| 
| 
| --- "/tmp/ghctest-zc_e5ng4/test
| spaces/./ghci.debugger/scripts/break011.run/break011.stdout.normalised"
|   2016-12-13 01:09:56.868988119 +
| +++ "/tmp/ghctest-zc_e5ng4/test
| spaces/./ghci.debugger/scripts/break011.run/break011.run.stdout.normalise
| d"2016-12-13 01:09:56.868988119 +
| @@ -40,17 +40,9 @@
|  CallStack (from HasCallStack):
|error, called at Test7.hs:: in :Main
| Stopped in ,  -_exception :: e = SomeException
| -(ErrorCallWithLocation
| -   "foo"
| -   "CallStack (from HasCallStack):
| -  error, called at Test7.hs:: in :Main")
| +_exception :: e = _
|  Stopped in ,  -_exception :: e =
| SomeException
| -(ErrorCallWithLocation
| -   "foo"
| -   "CallStack (from HasCallStack):
| -  error, called at Test7.hs:: in :Main")
| +_exception :: e = _
|  *** Exception: foo
|  CallStack (from HasCallStack):
|error, called at Test7.hs:: in :Main
| --- "/tmp/ghctest-zc_e5ng4/test
| spaces/./ghci.debugger/scripts/break024.run/break024.stdout.normalised"
|   2016-12-13 01:09:57.464988119 +
| +++ "/tmp/ghctest-zc_e5ng4/test
| spaces/./ghci.debugger/scripts/break024.run/break024.run.stdout.normalise
| d"2016-12-13 01:09:57.464988119 +
| @@ -11,8 +11,7 @@
| (GHC.IO.Exception.IOError
|Nothing GHC.IO.Exception.UserError [] "error" Nothing
| Nothing)  Stopped in ,  -_exception :: e =
| SomeException
| -(GHC.IO.Exception.IOError Nothing
| GHC.IO.Exception.UserError )
| +_exception :: e = _
|  Stopped in ,   _exception :: e = _ _exception
| = SomeException
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs