Re: ORF for fields of higher-ranked type [was: TDNR without new operators or syntax changes]

2016-06-22 Thread Adam Gundry
On 15/06/16 04:29, AntC wrote: > ... > > The earlier design for SORF tried to support higher-ranked fields. > https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/SORF > > That had to be abandoned, > until explicit type application was available IIRC. > > We now have type applicat

ORF for fields of higher-ranked type [was: TDNR without new operators or syntax changes]

2016-06-14 Thread AntC
> Adam Gundry writes: > ... Having spent more time thinking about record field overloading > than perhaps I should, ... Thanks Adam, another thing on the back burner ... The earlier design for SORF tried to support higher-ranked fields. https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRec

Re: TDNR without new operators or syntax changes

2016-05-29 Thread Peter
any function, but only helps with disambiguation. There is some overlap, but it is a different solution for different requirements. -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927p5836818.html Sent

Re: TDNR without new operators or syntax changes

2016-05-28 Thread AntC
> Evan Laforge gmail.com> writes: > > That's why I was trying to emphasize "not an operator". > TDNR is complicated because ... >> Peter voldermort writes: >> A slightly more refined definition for disambiguation: ... Hi Evan, Peter, (and even James), I'm not seeing you're proposing anything t

Re: TDNR without new operators or syntax changes

2016-05-28 Thread Evan Laforge
On Sat, May 28, 2016 at 3:13 AM, AntC wrote: >> Evan Laforge gmail.com> writes: > >> ... what would happen if you tried to do records >> just like C structs? So e.g. a•b requires 'a' to be a record with a >> 'b' field, and is just one identifier, no functions involved, and 'b' >> is not a separa

Re: TDNR without new operators or syntax changes

2016-05-28 Thread Peter
(although it may require two passes to disambiguate on the inferred type of an argument), and disambiguating one name will not depend on disambiguating any other name. -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes

Re: TDNR without new operators or syntax changes

2016-05-28 Thread AntC
> Evan Laforge gmail.com> writes: > ... what would happen if you tried to do records > just like C structs? So e.g. a•b requires 'a' to be a record with a > 'b' field, and is just one identifier, no functions involved, and 'b' > is not a separate value. Hi Evan, um, that's the original TDNR isn

Re: TDNR without new operators or syntax changes

2016-05-27 Thread Evan Laforge
As long as were back on this topic again (sort of), and just to satisfy my curiousity, what would happen if you tried to do records just like C structs? So e.g. a•b requires 'a' to be a record with a 'b' field, and is just one identifier, no functions involved, and 'b' is not a separate value. I

Re: TDNR without new operators or syntax changes

2016-05-27 Thread AntC
> Dan Doel gmail.com> writes: > >> On Thu, May 26, 2016 at 5:14 AM, Peter hotmail.com> wrote: >> Solving for everything but f, we get f :: T -> Int. > > So TDNR happens for things in function position (applied to something). Before we get carried away, TDNR doesn't happen at all. You're specul

Re: TDNR without new operators or syntax changes

2016-05-26 Thread Dan Doel
On Thu, May 26, 2016 at 5:14 AM, Peter wrote: > Solving for everything but f, we get f :: T -> Int. So TDNR happens for things in function position (applied to something). > Solving for everything but f, we get f :: T -> Int. So TDNR happens for things in argument position. > May not be solvab

Re: TDNR without new operators or syntax changes

2016-05-26 Thread Peter
:: Int > i3 = f v May not be solvable, would fail to disambiguate. -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927p5836657.html Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

Re: TDNR without new operators or syntax changes

2016-05-25 Thread Dan Doel
As a supplement, here's a series of definitions to think about. The question is: what should happen in each section, and why? The more detailed the answer, the better. Definitions from previous sections are in scope in subsequent ones, for convenience. The examples are arranged in a slippery slope,

Re: TDNR without new operators or syntax changes

2016-05-24 Thread Adam Gundry
Thanks for starting this discussion! Having spent more time thinking about record field overloading than perhaps I should, here are some things to think about... On 22/05/16 16:01, Jeremy wrote: > Bertram Felgenhauer-2 wrote >>> 1. If the compiler encounters a term f a, and there is more than one

Re: TDNR without new operators or syntax changes

2016-05-22 Thread Jeremy
of a at a given time, then you need special treatment for > unambiguous names or even trivial programs will fail to type-check, just > as Anthony said. Why special treatment for unambiguous names? They shouldn't be effected at all by this. -- View this message in context: http://

Re: TDNR without new operators or syntax changes

2016-05-22 Thread Bertram Felgenhauer
Jeremy . wrote: > Yes, that it indeed was I meant. AntC seems to be replying to a much > more complicated/invasive proposal than what I had intended, apologies > if I wasn't clear. (I see in retrospect that I may have misunderstood > the original TDNR proposal, understandably leading to confusion.)

Re: TDNR without new operators or syntax changes

2016-05-22 Thread Jeremy
e. -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927p5836376.html Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com. ___ Glasgow-haskell-users ma

Re: TDNR without new operators or syntax changes

2016-05-22 Thread Henning Thielemann
On Sun, 22 May 2016, Jeremy . wrote: 1. If the compiler encounters a term f a, and there is more than one definition for f in scope (after following all of the usual rules for qualified imports); 2. And exactly one of these definitions matches the type of a (or the expected type of f if give

Re: TDNR without new operators or syntax changes

2016-05-22 Thread Jeremy .
Yes, that it indeed was I meant. AntC seems to be replying to a much more complicated/invasive proposal than what I had intended, apologies if I wasn't clear. (I see in retrospect that I may have misunderstood the original TDNR proposal, understandably leading to confusion.) 1. If the compiler

Re: TDNR without new operators or syntax changes

2016-05-21 Thread AntC
> Bertram Felgenhauer googlemail.com> writes: > ... > I don't understand your conclusion. Hi Bertram, I'm trying to tease out of Jeremy, what he thinks his proposal amounts to. Seeing as he's given very little clue so far. So if I've arrived at an incorrect conclusion, I want him to tell me wher

Re: TDNR without new operators or syntax changes

2016-05-21 Thread Bertram Felgenhauer
AntC wrote: > > > > With syntaxless TDNR enabled, the last line could be: > > > > f b c = do { reset b; reset c } > > > > Heck, I didn't think you meant something that radical. > So bare name in a function application context is to need disambiguating. > > I think you'll find rather a lot

Re: TDNR without new operators or syntax changes

2016-05-19 Thread AntC
> Jeremy hotmail.com> writes: > > AntC wrote > > I think you'll find rather a lot of those in existing code. > > So this is a code-breaking change. > > Could you give an example of existing code that would break? > This certainly wasn't what I had in mind. Then what do you have in mind? "Do not

Re: TDNR without new operators or syntax changes

2016-05-18 Thread Jeremy
.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927p5836060.html Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://mail.haskell.org

Re: TDNR without new operators or syntax changes

2016-05-18 Thread AntC
> > With syntaxless TDNR enabled, the last line could be: > > f b c = do { reset b; reset c } > Heck, I didn't think you meant something that radical. So bare name in a function application context is to need disambiguating. I think you'll find rather a lot of those in existing code. So th

Re: TDNR without new operators or syntax changes

2016-05-17 Thread Jeremy
for reset, and in each case, pick the one which matches its argument. -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927p5835978.html Sent from the Haskell - Glasgow-haskell-users mailing list

Re: TDNR without new operators or syntax changes

2016-05-16 Thread AntC
> Jeremy hotmail.com> writes: Hi Jeremy, I feel your frustration at the slow evolution of records proposals. There are many reasons, including that there has been much debate and little consensus. > > Previous attempts to propose TDNR [1] have met with opposition over the > accompanying proposal

TDNR without new operators or syntax changes

2016-05-16 Thread Jeremy
l.org/wiki/TypeDirectedNameResolution -- View this message in context: http://haskell.1045720.n5.nabble.com/TDNR-without-new-operators-or-syntax-changes-tp5835927.html Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabbl