Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-24 Thread Richard O'Keefe
* For record selectors, currently written (x r), writing r.x is exactly right Algol 68 used 'x of r', which I always found rather readable. COBOL has always used 'x of r' and 'x in r' with the same meaning. BCPL uses 'f O§F r' which may I believe also be written 'f::r'. Fortran uses 'r%x'.

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-23 Thread Ketil Malde
Simon Peyton-Jones simo...@microsoft.com writes: Personally I think there are strong advantages to .: I'm sorry, but I don't see it. Function composition is one of /the/ most central concepts to functionaly programming. Overloading dot further is a terrible idea. I don't see why using it for

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-20 Thread Simon Peyton-Jones
|* General Type Directed Name Resolution (GTDNR): |For every function application f x in the program where f is a |name, f is resolved based on the type of the argument x. | ... | You suggest that GTDNR might not be a good idea, well why not? One | reason is that it can

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-20 Thread John A. De Goes
GTDNR is what I really want anyway... whether or not it's possible. :-) At any given time, importing everything unqualified from every module used by a typical hs leads only to a handful of ambiguities. While the general case might be intractable, real-world cases might be trivial. Regards,

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread Stephen Tetley
2009/11/18 Twan van Laarhoven twa...@gmail.com: The TDNR proposal really tries to do two separate things:  1. Record syntax for function application.    The proposal is to tread x.f or a variation thereof the same as (f x)  2. Type directed name lookup.    The proposal is to look up

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread Simon Peyton-Jones
| The proposal has this sentence, apparently in reference to using | qualified imports: This is sufficient, but it is just sufficiently | inconvenient that people don't use it much. Does this mean qualified | imports? I clarified. | One thing I'd really like that this would provide is shorter

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread Nicolas Pouillard
Excerpts from Twan van Laarhoven's message of Thu Nov 19 00:59:25 +0100 2009: Levi Greenspan wrote: What's the status of the TDNR proposal [1]? Personally I think it is a very good idea and I'd like to see it in Haskell'/GHC rather sooner than later. Working around the limitations of the

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread Twan van Laarhoven
Nicolas Pouillard wrote: The TDNR proposal really tries to do two separate things: 1. Record syntax for function application. The proposal is to tread x.f or a variation thereof the same as (f x) It is more like (ModuleToGuess.f x) than (f x). My point is that desugaring x.f to (f

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread wren ng thornton
Twan van Laarhoven wrote: My point is that desugaring x.f to (f x) and treating some instances of (f x) as (ModuleToGuess.f x) are two separate things. In the current proposal these two are combined, but I see no reason to do so. To be a bit more concrete, I would propose: * General Type

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Simon Peyton-Jones
| Simon, have you given any thought to how this interacts with type system | extensions, in particular with GADTs and type families? The proposal relies | on being able to find the type of a term but it's not entirely clear to me | what that means. Here is an example: | | foo :: F Int - Int | foo

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Simon Peyton-Jones
November 2009 03:07 | To: Haskell Cafe | Subject: Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal? | | Neil Brown wrote: | Having skimmed the page, it seems like the re-use of . is one of the | major difficulties of the proposal. Would it be possible to use -? | It has been used

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Roman Leshchinskiy
On 18/11/2009, at 21:10, Simon Peyton-Jones wrote: Yes I think it can, although you are right to point out that I said nothing about type inference. One minor thing is that you've misunderstood the proposal a bit. It ONLY springs into action when there's a dot. So you'd have to write

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Simon Peyton-Jones
| Each 'foo' gives a type instance for TDNR_foo, mapping the type of the first | argument to the type of that foo. | | Hmm... GHC doesn't allow this: | | type instance TDNR_foo () = forall a. () - a - a | | IIUC this restriction is necessary to guarantee termination. Given your analogy, |

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Luke Palmer
You know, another solution to the records problem, which is not quite as convenient but much simpler (and has other applications) is to allow local modules. module Foo where module Bar where data Bar = Bar { x :: Int, y :: Int } module Baz where data Baz = Baz { x :: Int, y :: Int }

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Evan Laforge
The proposal has this sentence, apparently in reference to using qualified imports: This is sufficient, but it is just sufficiently inconvenient that people don't use it much. Does this mean qualified imports? I use them exclusively, and I'd love it if everyone else used them too. Anyway, a

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Edward Kmett
On Wed, Nov 18, 2009 at 3:53 PM, Evan Laforge qdun...@gmail.com wrote: The proposal has this sentence, apparently in reference to using qualified imports: This is sufficient, but it is just sufficiently inconvenient that people don't use it much. Does this mean qualified imports? I use them

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread David Menendez
On Wed, Nov 18, 2009 at 4:12 PM, Edward Kmett ekm...@gmail.com wrote: Qualified imports are some times problematic when you need to work with classes from the module. You can't define a member of two instances from different two modules that define classes with conflicting member names. This

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Edward Kmett
Thanks! Learn something new every day. =) -Edward Kmett On Wed, Nov 18, 2009 at 4:29 PM, David Menendez d...@zednenem.com wrote: On Wed, Nov 18, 2009 at 4:12 PM, Edward Kmett ekm...@gmail.com wrote: Qualified imports are some times problematic when you need to work with classes from the

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-18 Thread Twan van Laarhoven
Levi Greenspan wrote: What's the status of the TDNR proposal [1]? Personally I think it is a very good idea and I'd like to see it in Haskell'/GHC rather sooner than later. Working around the limitations of the current record system is one of my biggest pain points in Haskell and TDNR would be a

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Simon Peyton-Jones
| What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record | system is one of my biggest pain points in Haskell and TDNR would be a | major

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Matthijs Kooijman
I've added an informal straw poll to the bottom of [1] to allow you to express an opinion. [1]: ? signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Neil Brown
Simon Peyton-Jones wrote: | What's the status of the TDNR proposal [1]? It's stalled. As far as I know, there's been very little discussion about it. It's not a trivial thing to implement, and it treads on delicate territory (how . is treated). Having skimmed the page, it seems like the

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Levi Greenspan
On Tue, Nov 17, 2009 at 1:18 PM, Simon Peyton-Jones simo...@microsoft.com wrote: | What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record |

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Levi Greenspan
On Tue, Nov 17, 2009 at 1:18 PM, Simon Peyton-Jones simo...@microsoft.com wrote: I've added an informal straw poll to the bottom of [1] to allow you to express an opinion. Forgive my ignorance, but I can not find a way to edit the wiki page. What am I doing wrong? Cheers, Levi

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Daniel Fischer
Am Dienstag 17 November 2009 15:36:52 schrieb Levi Greenspan: As pointed out by others one may choose a different string instead of . like -  if this makes the implementation of TDNR feasible. Or, if both of these strings would make the implementation awkward, one can choose a different but

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Luke Palmer
On Tue, Nov 17, 2009 at 5:18 AM, Simon Peyton-Jones simo...@microsoft.com wrote: | What's the status of the TDNR proposal [1]? Personally I think it is a | very good idea and I'd like to see it in Haskell'/GHC rather sooner | than later. Working around the limitations of the current record |

RE: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Simon Peyton-Jones
...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On | Behalf Of Luke Palmer | Sent: 17 November 2009 17:08 | To: Simon Peyton-Jones | Cc: Levi Greenspan; Haskell Cafe | Subject: Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal? | | On Tue, Nov 17, 2009 at 5:18 AM, Simon Peyton-Jones

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread wren ng thornton
Neil Brown wrote: Having skimmed the page, it seems like the re-use of . is one of the major difficulties of the proposal. Would it be possible to use -? It has been used for accessing members in C and C++, so it is not too unusual a choice. It's also the one that Perl went with. It is

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-17 Thread Roman Leshchinskiy
Simon, have you given any thought to how this interacts with type system extensions, in particular with GADTs and type families? The proposal relies on being able to find the type of a term but it's not entirely clear to me what that means. Here is an example: foo :: F Int - Int foo :: Int -