RE: How to best display type variables with the same name

2016-10-19 Thread Simon Peyton Jones via ghc-devs
I’m afraid I didn’t understand the issue in the link below.  It speaks of 
“querying the type”, but I’m not sure what that means.  A GHCi session perhaps? 
 Does this relate to the way GHCi displays types?

I’m a bit lost.  A from-the-beginning example, showing steps and what the 
unexpected behaviour is would be helpful (to me anyway)

Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Christopher 
Done
Sent: 19 October 2016 12:46
To: ghc-devs@haskell.org
Subject: How to best display type variables with the same name

We've encountered a problem in Intero which is that when inspecting types of 
expressions and patterns, sometimes it happens that the type, when pretty 
printing, yields variables of the same name but which have different provenance.

Here's a summary of the issue:

https://github.com/commercialhaskell/intero/issues/280#issuecomment-254784904

And a strawman proposal of how it could be solved:

https://github.com/commercialhaskell/intero/issues/280#issuecomment-254787927

What do you think?

Also, if I were to implement the strawman proposal, is it possible to recover 
from a `tyvar :: Type` its original quantification/its "forall"? I've had a 
look through the API briefly and it looks like a _maybe_.

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


Re: Master recently broke on OS X

2016-10-19 Thread Ben Gamari
Simon Marlow  writes:

> It appears to be passing now.  I did commit a sequence of 3 patches, 2 of
> which should have been squashed together (my bad) and the intermediate
> builds were broken, but the final state was OK except for a failure in
> setnumcapabilities001.  I'll try to reproduce that one today.
>
Thanks Simon!

I think this emphasizes the need for a auto-push bot like what we
discussed at HIW. This is something that I'll try to prototype this
week.

Cheers,

- Ben


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


Re: How to best display type variables with the same name

2016-10-19 Thread Alan & Kim Zimmerman
This sounds like a thing that should be in the GHC API (the tyvar to
provenance lookup).

Alan

On Wed, Oct 19, 2016 at 2:48 PM, Richard Eisenberg 
wrote:

> Interesting problem & solution.
>
> Here's a wacky idea, from a position of utter ignorance about your
> environment: could you use color? Already, when I saw `b :: a` in the
> commentary there, where `b` is in scope as a type variable, it seemed wrong
> to me.
>
> In any case, I can answer your simpler question: yes, with some work, you
> can get from a tyvar to its provenance. A tyvar's Name will have its
> binding location in it. If you also keep track of binding locations as you
> spot foralls, you should be able to match them up. In theory.
>
> Richard
>
> On Oct 19, 2016, at 7:45 AM, Christopher Done  wrote:
>
> We've encountered a problem in Intero which is that when inspecting types
> of expressions and patterns, sometimes it happens that the type, when
> pretty printing, yields variables of the same name but which have different
> provenance.
>
> Here's a summary of the issue:
>
> https://github.com/commercialhaskell/intero/issues/280#
> issuecomment-254784904
>
> And a strawman proposal of how it could be solved:
>
> https://github.com/commercialhaskell/intero/issues/280#
> issuecomment-254787927
>
> What do you think?
>
> Also, if I were to implement the strawman proposal, is it possible to
> recover from a `tyvar :: Type` its original quantification/its "forall"?
> I've had a look through the API briefly and it looks like a _maybe_.
>
> Ciao!
> ___
> 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
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: How to best display type variables with the same name

2016-10-19 Thread Richard Eisenberg
Interesting problem & solution.

Here's a wacky idea, from a position of utter ignorance about your environment: 
could you use color? Already, when I saw `b :: a` in the commentary there, 
where `b` is in scope as a type variable, it seemed wrong to me.

In any case, I can answer your simpler question: yes, with some work, you can 
get from a tyvar to its provenance. A tyvar's Name will have its binding 
location in it. If you also keep track of binding locations as you spot 
foralls, you should be able to match them up. In theory.

Richard

> On Oct 19, 2016, at 7:45 AM, Christopher Done  wrote:
> 
> We've encountered a problem in Intero which is that when inspecting types of 
> expressions and patterns, sometimes it happens that the type, when pretty 
> printing, yields variables of the same name but which have different 
> provenance.
> 
> Here's a summary of the issue:
> 
> https://github.com/commercialhaskell/intero/issues/280#issuecomment-254784904 
> 
> 
> And a strawman proposal of how it could be solved:
> 
> https://github.com/commercialhaskell/intero/issues/280#issuecomment-254787927 
> 
> 
> What do you think? 
> 
> Also, if I were to implement the strawman proposal, is it possible to recover 
> from a `tyvar :: Type` its original quantification/its "forall"? I've had a 
> look through the API briefly and it looks like a _maybe_.
> 
> Ciao!
> ___
> 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


How to best display type variables with the same name

2016-10-19 Thread Christopher Done
We've encountered a problem in Intero which is that when inspecting types
of expressions and patterns, sometimes it happens that the type, when
pretty printing, yields variables of the same name but which have different
provenance.

Here's a summary of the issue:

https://github.com/commercialhaskell/intero/issues/280#issuecomment-
254784904

And a strawman proposal of how it could be solved:

https://github.com/commercialhaskell/intero/issues/280#issuecomment-
254787927

What do you think?

Also, if I were to implement the strawman proposal, is it possible to
recover from a `tyvar :: Type` its original quantification/its "forall"?
I've had a look through the API briefly and it looks like a _maybe_.

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


Re: Improving GHC GC for latency-sensitive networked services

2016-10-19 Thread Alexander Kjeldaas
On Tue, Oct 18, 2016 at 4:46 PM, Niklas Hambüchen  wrote:

> I'll be lazy and answer the simplest question in this thread :)
>
> On 18/10/16 16:32, Simon Marlow wrote:
> > If not, are you willing to recompile GHC and all your libraries?
>
> Yes.
>

I'll add that managing this is probably a lot easier now than it was back
then.  Today you would just add a flag in stack.yaml, get a cup of coffee,
and the tooling would guarantee that there's no breakage.



> ___
> 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: Master recently broke on OS X

2016-10-19 Thread Simon Marlow
It appears to be passing now.  I did commit a sequence of 3 patches, 2 of
which should have been squashed together (my bad) and the intermediate
builds were broken, but the final state was OK except for a failure in
setnumcapabilities001.  I'll try to reproduce that one today.

Cheers
Simon

On 18 October 2016 at 23:08, Ben Gamari  wrote:

> Hello Simon,
>
> It looks like one of the patches that you pushed to master today may
> have broken the build on OS X. According to Harbormaster something in
> the range of f148513ccd93..7129861397f8 caused T5611 to fail on the OS X
> build bot [1]. Could you have a look?
>
> Cheers,
>
> - Ben
>
>
> [1] https://phabricator.haskell.org/harbormaster/build/14220/?l=100
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs