Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-23 Thread Richard Eisenberg
To clarify my comments in this thread around desugaring: I was referring to the 
concrete Haskell code as written in GHC, not at all to an abstract desugaring 
algorithm. The implementation of arrows in GHC uses fixM, which is a nuisance. 
And I don't understand the code well enough to be able to untie the knot. I 
have a solid workaround for the time being, but it's indeed a workaround.

Richard

> On Dec 21, 2016, at 5:09 PM, Tom Ellis 
>  wrote:
> 
> On Wed, Dec 21, 2016 at 01:49:33PM -0600, amin...@gmail.com wrote:
>> Additionally, Opaleye uses Arrow syntax pretty heavily iirc.
> 
> If I were writing the Opaleye tutorial today (and if I rewrite it) I will
> shy away from arrows and encourage users to use applicative style.  There's
> only one operator where applicative is not enough, 'restrict', and that can
> be wrapped up as a different combinator so that no one knows they're ever
> using arrows.
> 
> Tom
> 
> ___
> 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: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Tom Ellis
On Wed, Dec 21, 2016 at 01:49:33PM -0600, amin...@gmail.com wrote:
> Additionally, Opaleye uses Arrow syntax pretty heavily iirc.

If I were writing the Opaleye tutorial today (and if I rewrite it) I will
shy away from arrows and encourage users to use applicative style.  There's
only one operator where applicative is not enough, 'restrict', and that can
be wrapped up as a different combinator so that no one knows they're ever
using arrows.

Tom

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


Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread amindfv


> El 21 dic 2016, a las 02:36, Simon Peyton Jones via ghc-devs 
>  escribió:
> 
> 
> 
> I even wonder (whisper it) about taking it out altogether, when Edward says 
> “many of the original applications for arrows have been shown to be perfectly 
> suited to being handled by Applicatives” (i.e. with no extensions except 
> AppliciativeDo.  But I have no data on whether anyone (at all) is using arrow 
> notation these days, and if so how mission-critical it is to them; and old 
> packages like Yampa certainly use it. 

Unfortunately ApplicativeDo is for a very limited use-case, of the form:

do a0 <- x0
   a1 <- x1 -- x1 cannot refer to a0
   ...
   pure ...
   -- last line must be "pure", "pure $", "return" or "return $"

Additionally, Opaleye uses Arrow syntax pretty heavily iirc.

I haven't actually prototyped it, but I dream of an ApplicativeDo or ArrowDo 
which desugars do blocks with join in place of >>= , so any do-block which 
doesn't use any joins doesn't require the monad constraint...

Tom

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


Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Tom Ellis
On Wed, Dec 21, 2016 at 05:52:34PM +0100, Boespflug, Mathieu wrote:
> And Opaleye (a successor to haskellDB, for safe interaction with SQL
> databases) also uses arrow notation last I checked. As I recall do-notation
> is too powerful, whereas proc-notation provides exactly the right
> expressive power (no illegal SQL queries can be expressed). But that's not
> to say Tom (author of Opaleye) couldn't be content with a profunctor-based
> desugaring rather than an Arrow-based one?

I don't see any particular reason to oppose a profunctor-based desugaring. 
The structure of the computation would be the same, just encoded using
different classes.

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


Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Nicolas Frisby
Exploring alternative formulations is great, but I think it's (mostly?)
orthogonal to this thread's original email: Jan found the RebindableSyntax
support for Arrow to be disappointing hamstrung. I've had a similar
experience in the past; the occurrences of the combinators seem to have
overly restrictive type ascriptions in the desugared terms.

I don't think resolving that necessarily involves changing the Arrow class.
Just the desugaring algorithm would have to change (hopefully).

On Wed, Dec 21, 2016, 08:52 Boespflug, Mathieu  wrote:

> And Opaleye (a successor to haskellDB, for safe interaction with SQL
> databases) also uses arrow notation last I checked. As I recall do-notation
> is too powerful, whereas proc-notation provides exactly the right
> expressive power (no illegal SQL queries can be expressed). But that's not
> to say Tom (author of Opaleye) couldn't be content with a profunctor-based
> desugaring rather than an Arrow-based one?
>
> --
> Mathieu Boespflug
> Founder at http://tweag.io.
>
> On 21 December 2016 at 16:31, Brandon Allbery  wrote:
>
> On Wed, Dec 21, 2016 at 12:15 AM, Edward Kmett  wrote:
>
> Given that little new code seems to be being written with Arrows in mind,
> while some older code makes heavy use of it (hxt, etc.), refactoring the
> arrow hierarchy is kind of a hard sell. It is by no means impossible, just
> something that would require a fair bit of community wrangling and a lot of
> work showing clear advantages to a new status quo at a time when its very
> hard to get anybody to care about arrow notation at all.
>
>
> The arrowized-FRP folks seem to care a fair bit.
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> ___
> 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: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Boespflug, Mathieu
And Opaleye (a successor to haskellDB, for safe interaction with SQL
databases) also uses arrow notation last I checked. As I recall do-notation
is too powerful, whereas proc-notation provides exactly the right
expressive power (no illegal SQL queries can be expressed). But that's not
to say Tom (author of Opaleye) couldn't be content with a profunctor-based
desugaring rather than an Arrow-based one?

--
Mathieu Boespflug
Founder at http://tweag.io.

On 21 December 2016 at 16:31, Brandon Allbery  wrote:

> On Wed, Dec 21, 2016 at 12:15 AM, Edward Kmett  wrote:
>>
>> Given that little new code seems to be being written with Arrows in mind,
>> while some older code makes heavy use of it (hxt, etc.), refactoring the
>> arrow hierarchy is kind of a hard sell. It is by no means impossible, just
>> something that would require a fair bit of community wrangling and a lot of
>> work showing clear advantages to a new status quo at a time when its very
>> hard to get anybody to care about arrow notation at all.
>>
>
> The arrowized-FRP folks seem to care a fair bit.
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> ___
> 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: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Brandon Allbery
On Wed, Dec 21, 2016 at 12:15 AM, Edward Kmett  wrote:
>
> Given that little new code seems to be being written with Arrows in mind,
> while some older code makes heavy use of it (hxt, etc.), refactoring the
> arrow hierarchy is kind of a hard sell. It is by no means impossible, just
> something that would require a fair bit of community wrangling and a lot of
> work showing clear advantages to a new status quo at a time when its very
> hard to get anybody to care about arrow notation at all.
>

The arrowized-FRP folks seem to care a fair bit.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Edward Kmett
The S parser I was referring to was based on tracking FIRST sets, and
provided a nice linear time parsing bound for (infinite) LL(1) grammars.
(You can't really compute FOLLOW sets without knowing the grammar has a
finite number of productions, but FIRST sets work perfectly well with
infinite grammars.) By doing so you can transform parsing into more or less
a series of map lookups for dispatch.

You need to carry a set of all characters that a parser will consume in the
case of legal parses, and whether or not the parser accepts the empty
parse. http://www.cse.chalmers.se/~rjmh/afp-arrows.pdf mentions this style
of FIRST-set tracking parser as the original motivation for arrows.

Of course, they didn't see fit to stop puttering around with parsers after
1998, so referring to "the S parser" is quite ambiguous! =)

-Edward

On Wed, Dec 21, 2016 at 4:00 AM, Henrik Nilsson <
henrik.nils...@nottingham.ac.uk> wrote:

> Hi Edward,
> CC Others,
>
> On 12/21/2016 05:15 AM, Edward Kmett wrote:
>
>> Arrows haven't seen much love for a while. In part this is because many
>> of the original applications for arrows have been shown to be perfectly
>> suited to being handled by Applicatives. e.g. the Swiestra/Duponcheel
>> parser that sort of kickstarted everything.
>>
>
> Thanks for a very thorough reply.
>
> A quick side-remark: a parser library due to Sweistra (and maybe
> Dupncheel, I can't remember) used an applicative structure a long time
> before applicatives became apkicatives and even idioms. (I used a
> variation of this library myself for the Freja compiler around 1995.
> Freja was part of my PhD work and was close to what Haskell looked like at
> the time.)
>
> I've never used arrows for parsing, or seen the need for arrows in that
> context, but find arrows a very good fit for many EDSLs, including
> stream-processing/FRP/Yampa of course, along with other circuit-like
> abstractions, which I'd say were the original motivation for arrows.
> Altenkirch have also used arrow-like notions in the context of quantum
> computation. More recently for probabilistic programming and
> Bayesian inference. Except then that the current hard-wired "pseudo-
> product" in particular often gets in the way. Along with the fact
> that there is no good support for constrained arrows (or monads).
>
> Best,
>
> /Henrik
>
>
>
>
>
> This message and any attachment are intended solely for the addressee
> and may contain confidential information. If you have received this
> message in error, please send it back to me, and immediately delete it.
> Please do not use, copy or disclose the information contained in this
> message or in any attachment.  Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the
> University of Nottingham.
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses which could damage your
> computer system, you are advised to perform your own checks. Email
> communications with the University of Nottingham may be monitored as
> permitted by UK legislation.
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-21 Thread Simon Peyton Jones via ghc-devs
The frustrating part for me is that I would like to contribute to this effort. 
But again, my understanding of each and every component is fleeting at best.

Don’t be discouraged – you can learn!   And you would not be displacing anyone… 
as I say, the entire arrows story in GHC lacks leadership and vision.

I even wonder (whisper it) about taking it out altogether, when Edward says 
“many of the original applications for arrows have been shown to be perfectly 
suited to being handled by Applicatives” (i.e. with no extensions except 
AppliciativeDo.  But I have no data on whether anyone (at all) is using arrow 
notation these days, and if so how mission-critical it is to them; and old 
packages like Yampa certainly use it.

So arrow notation will probably stay.   But I don’t really understand the code, 
and it’s in “keep it limping along” mode as far as I am concerned.

All it needs is love.   But as Edward suggests, it not just a technical 
question; love would involve building a community consensus about what we want.

Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of MarLinn via 
ghc-devs
Sent: 21 December 2016 06:43
To: ghc-devs@haskell.org
Subject: Re: Help needed: Restrictions of proc-notation with RebindableSyntax


Sorry to barge into the discussion with neither much knowledge of the theory 
nor the implementation. I tried to look at both, but my understanding is 
severely lacking. However I do feel a tiny bit emboldened because my own 
findings turned out to at least have the same shadow as the contents of this 
more thorough overview.
The one part of the existing story I personally found the most promising was to 
explore the category hierarchy around Arrows, in other words the 
Gibbard/Trinkle perspective. Therefore I want to elaborate my own naive 
findings a tiny bit. Bear in mind that much of this is gleaned from 
experimental implementations or interpreted, but I do not have proofs, or even 
theory.
Almost all parts necessary for an Arrow seem to already be contained in a 
symmetrical braided category. Fascinatingly, even the braiding might be 
superfluous in some cases, leaving only the need for a monoidal category. But 
to get from a braided category to a full Arrow, there seems to be a need for 
"constructors" like (arr $ \x -> (x,x)) and "destructors" like (arr fst). There 
seem to be several options for those, and a choice would have to be made. 
Notably: is introduction done by duplicating existing values, or by introducing 
new "unit" values (for a suitable definition of "unit")? That choice doesn't 
seem impactful, but my gut feeling is that that's just because I cannot see the 
potential points of impact.

What makes this story worse is that the currently known hierarchies around 
ArrowChoice and ArrowLoop seem to be coarser still – although the work around 
profunctors might help. That said, my understanding is so bad that I can not 
even see any benefits or drawbacks of the structure of ArrowLoop's "loop" 
versus a more "standard" fix-point structure.

I do, however, think there is something to be gained. The good old Rosetta 
Stone paper still makes me think that what is now Arrow notation might be 
turned into a much more potent tool – exactly because we might be able to lift 
those restrictions. One particular idea I have in mind: If the notation can 
support purely braided categories, it might be used to describe reversible 
computation, which in turn is used in describing quantum computation.

The frustrating part for me is that I would like to contribute to this effort. 
But again, my understanding of each and every component is fleeting at best.

MarLinn

On 2016-12-21 06:15, Edward Kmett wrote:
Arrows haven't seen much love for a while. In part this is because many of the 
original applications for arrows have been shown to be perfectly suited to 
being handled by Applicatives. e.g. the Swiestra/Duponcheel parser that sort of 
kickstarted everything.

There are several options for improved arrow desugaring.

Megacz's work on GArrows at first feels like it should be applicable here, as 
it lets you change out the choice of pseudo-product while preserving the 
general arrow feel. Unfortunately, the GArrow class isn't sufficient for most 
arrow desguaring, due to the fact that the arrow desugaring inherently involves 
breaking apart patterns for almost any non-trivial use and nothing really 
requires the GArrow 'product' to actually even be product like.

Cale Gibbard and Ryan Trinkle on the other hand like to use a more CCC-like 
basis for arrows. This stays in the spirit to the GArrow class, but you still 
have the problems around pattern matching. I don't think they actually wrote 
anything to deal with the actual arrow notation and just programmed in the 
alternate style to get better introspection on the operations involved. I think 
the key insight there is that much of the notati

Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-20 Thread Edward Kmett
tanding, I think rebindable syntax will be
>> easier.
>>
>>
>>
>> I don’t know if you are up for that, but it’s a rather un-tended part of
>> GHC.
>>
>>
>>
>> Thanks
>>
>>
>>
>> Simon
>>
>>
>>
>> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Richard
>> Eisenberg
>> *Sent:* 28 November 2016 22:30
>> *To:* Jan Bracker <jan.brac...@googlemail.com>
>> *Cc:* ghc-devs@haskell.org
>> *Subject:* Help needed: Restrictions of proc-notation with
>> RebindableSyntax
>>
>>
>>
>> Jan’s question is a good one, but I don’t know enough about procs to be
>> able to answer. I do know that the answer can be found by looking for uses
>> of `tcSyntaxOp` in the TcArrows module but I just can’t translate it
>> all to source Haskell, having roughly 0 understanding of this end of the
>> language.
>>
>>
>>
>> Can anyone else help Jan here?
>>
>>
>>
>> Richard
>>
>>
>>
>> On Nov 23, 2016, at 4:34 AM, Jan Bracker via ghc-devs <
>> ghc-devs@haskell.org> wrote:
>>
>>
>>
>> Hello,
>>
>>
>>
>> I want to use the proc-notation together with RebindableSyntax. So far
>> what I am trying to do is working fine, but I would like to know what the
>> exact restrictions on the supplied functions are. I am introducing
>> additional indices and constraints on the operations. The documentation [1]
>> says the details are in flux and that I should ask directly.
>>
>>
>>
>> Best,
>>
>> Jan
>>
>>
>>
>> [1] https://downloads.haskell.org/~ghc/latest/docs/html/user
>> s_guide/glasgow_exts.html#rebindable-syntax-and-the-implicit
>> -prelude-import
>> <https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Fdownloads.haskell.org%2F~ghc%2Flatest%2Fdocs%2Fhtml%2Fusers_guide%2Fglasgow_exts.html%23rebindable-syntax-and-the-implicit-prelude-import=02%7C01%7Csimonpj%40microsoft.com%7C80e472cedf78463bd18408d417de1af5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63615969010476=ygqePSmgcPKnPmKDBfZplkyjG9BIDBO1L1MWHNpqw88%3D=0>
>>
>> ___
>> 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: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-18 Thread Richard Eisenberg

> On Dec 17, 2016, at 9:19 AM, Ross Paterson  wrote:
> 
> On Tue, Nov 29, 2016 at 12:41:53PM +, Simon Peyton Jones wrote:
>> Type checking and desugaring for arrow syntax has received Absolutely
>> No Love for several years.  I do not understand how it works very well,
>> and I would not be at all surprised if it is broken in corner cases.
>> 
>> It really needs someone to look at it carefully, document it better, and
>> perhaps refactor it – esp by using a different data type rather than
>> piggy-backing on HsExpr.
> 
> HsCmd was split from HsExpr in 2012.  It still re-uses MatchGroup, Stmt,
> etc, though.
> 
> The desugaring is made more complicated by doing a lot of analysis that
> might be better done in the renamer.

And -- unrelated to the original post in this thread -- these complications in 
desugarer (specifically, the use of fixM) are making my incoming 
levity-polymorphism update much harder (see 
https://phabricator.haskell.org/D2852). Even if you don't have time to make the 
edits yourself, if you could give a 10,000 ft view as to how to remove fixM 
from the desugarer, I'd be very grateful. I've not looked deeply at this, 
mostly because it's hard for me to make anything but very local changes to code 
I don't understand.

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


RE: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-02 Thread Simon Peyton Jones via ghc-devs
Since you suggested a rewrite of GHC's handling of proc-syntax, are there any 
opinions on integrating generalized arrows (Joseph 2014) in the process? I 
think they would greatly improve arrows! I don't know if I have the time to 
attempt this, but if I find the time I would give it a try. Why wasn't this 
integrated while it was still actively developed?

The arrow stuff was added to GHC years before this thesis (which I had not seen 
before – thanks).   I don’t have an opinions about

· the desirability

· the difficulty
of integrating generalised arrows.

You’re in the driving seat!  By all means give it a go.

Simon

From: Jan Bracker [mailto:jan.brac...@googlemail.com]
Sent: 02 December 2016 15:58
To: Simon Peyton Jones <simo...@microsoft.com>
Cc: Richard Eisenberg <r...@cs.brynmawr.edu>; ghc-devs@haskell.org; Ross 
Paterson (r...@soi.city.ac.uk) <r...@soi.city.ac.uk>; Henrik Nilsson 
<henrik.nils...@nottingham.ac.uk>
Subject: Re: Help needed: Restrictions of proc-notation with RebindableSyntax

Simon, Richard,

thank you for your answer! I don't have time to look into the GHC sources right 
now, but I will set aside some time after the holidays and take a close look at 
what the exact restrictions on proc-notation are and document them.

Since you suggested a rewrite of GHC's handling of proc-syntax, are there any 
opinions on integrating generalized arrows (Joseph 2014) in the process? I 
think they would greatly improve arrows! I don't know if I have the time to 
attempt this, but if I find the time I would give it a try. Why wasn't this 
integrated while it was still actively developed?

Best,
Jan

[Joseph 2014] 
https://www2.eecs.berkeley.edu/Pubs/TechRpts/2014/EECS-2014-130.pdf<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww2.eecs.berkeley.edu%2FPubs%2FTechRpts%2F2014%2FEECS-2014-130.pdf=02%7C01%7Csimonpj%40microsoft.com%7C0cef689885ed40a9696d08d41acbfd5f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636162910819713326=jCrF3a%2BSoTISvzA8KzGlG8AjG5iDro5SHLQr9oO%2Bv5E%3D=0>



2016-11-29 12:41 GMT+00:00 Simon Peyton Jones 
<simo...@microsoft.com<mailto:simo...@microsoft.com>>:
Jan,

Type checking and desugaring for arrow syntax has received Absolutely No Love 
for several years.  I do not understand how it works very well, and I would not 
be at all surprised if it is broken in corner cases.

It really needs someone to look at it carefully, document it better, and 
perhaps refactor it – esp by using a different data type rather than 
piggy-backing on HsExpr.

In the light of that understanding, I think rebindable syntax will be easier.

I don’t know if you are up for that, but it’s a rather un-tended part of GHC.

Thanks

Simon

From: ghc-devs 
[mailto:ghc-devs-boun...@haskell.org<mailto:ghc-devs-boun...@haskell.org>] On 
Behalf Of Richard Eisenberg
Sent: 28 November 2016 22:30
To: Jan Bracker <jan.brac...@googlemail.com<mailto:jan.brac...@googlemail.com>>
Cc: ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
Subject: Help needed: Restrictions of proc-notation with RebindableSyntax

Jan’s question is a good one, but I don’t know enough about procs to be able to 
answer. I do know that the answer can be found by looking for uses of 
`tcSyntaxOp` in the TcArrows module but I just can’t translate it all to 
source Haskell, having roughly 0 understanding of this end of the language.

Can anyone else help Jan here?

Richard

On Nov 23, 2016, at 4:34 AM, Jan Bracker via ghc-devs 
<ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>> wrote:

Hello,

I want to use the proc-notation together with RebindableSyntax. So far what I 
am trying to do is working fine, but I would like to know what the exact 
restrictions on the supplied functions are. I am introducing additional indices 
and constraints on the operations. The documentation [1] says the details are 
in flux and that I should ask directly.

Best,
Jan

[1] 
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#rebindable-syntax-and-the-implicit-prelude-import<https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Fdownloads.haskell.org%2F~ghc%2Flatest%2Fdocs%2Fhtml%2Fusers_guide%2Fglasgow_exts.html%23rebindable-syntax-and-the-implicit-prelude-import=02%7C01%7Csimonpj%40microsoft.com%7C80e472cedf78463bd18408d417de1af5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63615969010476=ygqePSmgcPKnPmKDBfZplkyjG9BIDBO1L1MWHNpqw88%3D=0>
___
ghc-devs mailing list
ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs=02%7C01%7Csimonpj%40microsoft.com%7C0cef689885ed40a9696d08d41acbfd5f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636162910819713326=Mj7yhWsfRtRjn9KxJjjQ6sxNC2b8EP

Re: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-12-02 Thread Jan Bracker via ghc-devs
Simon, Richard,

thank you for your answer! I don't have time to look into the GHC sources
right now, but I will set aside some time after the holidays and take a
close look at what the exact restrictions on proc-notation are and document
them.

Since you suggested a rewrite of GHC's handling of proc-syntax, are there
any opinions on integrating generalized arrows (Joseph 2014) in the
process? I think they would greatly improve arrows! I don't know if I have
the time to attempt this, but if I find the time I would give it a try. Why
wasn't this integrated while it was still actively developed?

Best,
Jan

[Joseph 2014] https://www2.eecs.berkeley.edu/Pubs/TechRpts/
2014/EECS-2014-130.pdf



2016-11-29 12:41 GMT+00:00 Simon Peyton Jones <simo...@microsoft.com>:

> Jan,
>
>
>
> Type checking and desugaring for arrow syntax has received Absolutely No
> Love for several years.  I do not understand how it works very well, and I
> would not be at all surprised if it is broken in corner cases.
>
>
>
> It really needs someone to look at it carefully, document it better, and
> perhaps refactor it – esp by using a different data type rather than
> piggy-backing on HsExpr.
>
>
>
> In the light of that understanding, I think rebindable syntax will be
> easier.
>
>
>
> I don’t know if you are up for that, but it’s a rather un-tended part of
> GHC.
>
>
>
> Thanks
>
>
>
> Simon
>
>
>
> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Richard
> Eisenberg
> *Sent:* 28 November 2016 22:30
> *To:* Jan Bracker <jan.brac...@googlemail.com>
> *Cc:* ghc-devs@haskell.org
> *Subject:* Help needed: Restrictions of proc-notation with
> RebindableSyntax
>
>
>
> Jan’s question is a good one, but I don’t know enough about procs to be
> able to answer. I do know that the answer can be found by looking for uses
> of `tcSyntaxOp` in the TcArrows module but I just can’t translate it
> all to source Haskell, having roughly 0 understanding of this end of the
> language.
>
>
>
> Can anyone else help Jan here?
>
>
>
> Richard
>
>
>
> On Nov 23, 2016, at 4:34 AM, Jan Bracker via ghc-devs <
> ghc-devs@haskell.org> wrote:
>
>
>
> Hello,
>
>
>
> I want to use the proc-notation together with RebindableSyntax. So far
> what I am trying to do is working fine, but I would like to know what the
> exact restrictions on the supplied functions are. I am introducing
> additional indices and constraints on the operations. The documentation [1]
> says the details are in flux and that I should ask directly.
>
>
>
> Best,
>
> Jan
>
>
>
> [1] https://downloads.haskell.org/~ghc/latest/docs/html/
> users_guide/glasgow_exts.html#rebindable-syntax-and-the-
> implicit-prelude-import
> <https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Fdownloads.haskell.org%2F~ghc%2Flatest%2Fdocs%2Fhtml%2Fusers_guide%2Fglasgow_exts.html%23rebindable-syntax-and-the-implicit-prelude-import=02%7C01%7Csimonpj%40microsoft.com%7C80e472cedf78463bd18408d417de1af5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63615969010476=ygqePSmgcPKnPmKDBfZplkyjG9BIDBO1L1MWHNpqw88%3D=0>
>
> ___
> 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: Help needed: Restrictions of proc-notation with RebindableSyntax

2016-11-29 Thread Simon Peyton Jones via ghc-devs
Jan,

Type checking and desugaring for arrow syntax has received Absolutely No Love 
for several years.  I do not understand how it works very well, and I would not 
be at all surprised if it is broken in corner cases.

It really needs someone to look at it carefully, document it better, and 
perhaps refactor it – esp by using a different data type rather than 
piggy-backing on HsExpr.

In the light of that understanding, I think rebindable syntax will be easier.

I don’t know if you are up for that, but it’s a rather un-tended part of GHC.

Thanks

Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Richard 
Eisenberg
Sent: 28 November 2016 22:30
To: Jan Bracker <jan.brac...@googlemail.com>
Cc: ghc-devs@haskell.org
Subject: Help needed: Restrictions of proc-notation with RebindableSyntax

Jan’s question is a good one, but I don’t know enough about procs to be able to 
answer. I do know that the answer can be found by looking for uses of 
`tcSyntaxOp` in the TcArrows module but I just can’t translate it all to 
source Haskell, having roughly 0 understanding of this end of the language.

Can anyone else help Jan here?

Richard

On Nov 23, 2016, at 4:34 AM, Jan Bracker via ghc-devs 
<ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>> wrote:

Hello,

I want to use the proc-notation together with RebindableSyntax. So far what I 
am trying to do is working fine, but I would like to know what the exact 
restrictions on the supplied functions are. I am introducing additional indices 
and constraints on the operations. The documentation [1] says the details are 
in flux and that I should ask directly.

Best,
Jan

[1] 
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#rebindable-syntax-and-the-implicit-prelude-import<https://na01.safelinks.protection.outlook.com/?url=https:%2F%2Fdownloads.haskell.org%2F~ghc%2Flatest%2Fdocs%2Fhtml%2Fusers_guide%2Fglasgow_exts.html%23rebindable-syntax-and-the-implicit-prelude-import=02%7C01%7Csimonpj%40microsoft.com%7C80e472cedf78463bd18408d417de1af5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63615969010476=ygqePSmgcPKnPmKDBfZplkyjG9BIDBO1L1MWHNpqw88%3D=0>
___
ghc-devs mailing list
ghc-devs@haskell.org<mailto: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


Help needed: Restrictions of proc-notation with RebindableSyntax

2016-11-28 Thread Richard Eisenberg
Jan’s question is a good one, but I don’t know enough about procs to be able to 
answer. I do know that the answer can be found by looking for uses of 
`tcSyntaxOp` in the TcArrows module but I just can’t translate it all to 
source Haskell, having roughly 0 understanding of this end of the language.

Can anyone else help Jan here?

Richard

> On Nov 23, 2016, at 4:34 AM, Jan Bracker via ghc-devs  
> wrote:
> 
> Hello,
> 
> I want to use the proc-notation together with RebindableSyntax. So far what I 
> am trying to do is working fine, but I would like to know what the exact 
> restrictions on the supplied functions are. I am introducing additional 
> indices and constraints on the operations. The documentation [1] says the 
> details are in flux and that I should ask directly.
> 
> Best,
> Jan
> 
> [1] 
> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#rebindable-syntax-and-the-implicit-prelude-import
>  
> ___
> 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