Re: Superclass Equality constraints cp FunDeps

2017-05-08 Thread Richard Eisenberg
> On May 7, 2017, at 8:42 PM, Anthony Clayden > wrote: > > Is that worth adding to the docos? The best way to evaluate this is to submit a concrete patch -- better if it’s a patch directly to the manual than just a note on Trac. (Better ==> it will be adopted

Re: Superclass Equality constraints cp FunDeps

2017-05-07 Thread Anthony Clayden
Now that I've got the bit between my teeth ... Superclass constraints are not subject to the Paterson conditions. IOW I can write superclass constraints that are not permitted as instance constraints. (Superclass constraints are required to be non-cyclic, which ensures they're terminating.) Is

Re: Superclass Equality constraints cp FunDeps

2017-05-06 Thread Anthony Clayden
> On Sun Apr 30 19:45:34 UTC 2017, Richard Eisenberg wrote: > Documentation is just about always suboptimal -- but the > best people to suggest concrete improvements are those who > were confused to begin with. So, by all means, submit > patches! Thanks for the invite ;-). OK. Done. See #13657.

Re: Superclass Equality constraints cp FunDeps

2017-05-06 Thread Anthony Clayden
> On Sun Apr 30 19:35:17 UTC 2017 Brandon Allbery wrote: >> On Sun, Apr 30, 2017 at 3:31 PM, Richard Eisenberg wrote: >>> >>> On Apr 30, 2017, at 6:37 AM, Anthony Clayden wrote: >>> Is that behaviour officially documented somewhere? >> >> Not that I can find. ... > > ... the originally cited

Re: Superclass Equality constraints cp FunDeps

2017-04-30 Thread Richard Eisenberg
Documentation is just about always suboptimal -- but the best people to suggest concrete improvements are those who were confused to begin with. So, by all means, submit patches! Some relevant discussion on this point is on https://ghc.haskell.org/trac/ghc/ticket/10431 Currently, there is no

Re: Superclass Equality constraints cp FunDeps

2017-04-30 Thread Brandon Allbery
On Sun, Apr 30, 2017 at 3:31 PM, Richard Eisenberg wrote: > > > On Apr 30, 2017, at 6:37 AM, Anthony Clayden < > anthony_clay...@clear.net.nz> wrote: > > Is that behaviour officially documented somewhere? > > Not that I can find. Documentation on functional dependencies is

Re: Superclass Equality constraints cp FunDeps

2017-04-30 Thread Richard Eisenberg
> On Apr 30, 2017, at 6:37 AM, Anthony Clayden > wrote: > > Is that behaviour officially documented somewhere? Not that I can find. Documentation on functional dependencies is somewhat lacking. This may be because fundeps has received little love of late.

Re: Superclass Equality constraints cp FunDeps

2017-04-30 Thread Anthony Clayden
> On at Apr 29 05:55:14 UTC 2017, Anthony Clayden wrote: > ... > So should I reasonably have known that > a superclass constraint > with FunDeps on the superclass > induces FunDeps on the sub-class > without explicitly needing to declare so? > > (I'm not complaining, more surprised/impressed.)

Re: Superclass Equality constraints cp FunDeps

2017-04-28 Thread Anthony Clayden
> On Sat Apr 29 02:23:10 UTC 2017, Richard Eisenberg wrote: > > I'm not quite sure what a restriction on (~) might be, Thanks Richard, I was thinking that FunDeps are restricted to bare type vars. I can't write either of these: > class C a b c | a -> (b, c) -- per my O.P. (~) > class C a b

Re: Superclass Equality constraints cp FunDeps

2017-04-28 Thread Richard Eisenberg
I'm not quite sure what a restriction on (~) might be, but (~) is effectively declared as > class a ~ b | a -> b, b -> a So I agree with your observations. Richard > On Apr 27, 2017, at 8:14 PM, Anthony Clayden > wrote: > > The docos say [User Guide 10.14.1.

Superclass Equality constraints cp FunDeps

2017-04-27 Thread Anthony Clayden
The docos say [User Guide 10.14.1. on Equality Constraints] > Equality constraints can also appear in class and instance contexts. > The former enable a simple translation of programs using > functional dependencies into programs using family synonyms instead.