RE: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-20 Thread Simon Peyton-Jones
Evan, Lennart Thanks for the provocation. I've committed a patch that fixes all these issues. Try now! Simon Thu Aug 20 13:34:43 BST 2009 simo...@microsoft.com * Improvements to record puns, wildcards * Make C { A.a } work with punning, expanding to C { A.a = a } * Make it so

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-12 Thread Evan Laforge
| Even is suggesting that instead of reporting an error, in the second | case we could use the translation: | |   f (A.A { A.a }) = a   --   f (A.A { A.a = a }) | | (i.e., when punning occurs with a qualified name, use just the | unqualified part of the name in the pattern) Yes, that'd be

RE: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-09 Thread Simon Peyton-Jones
Oh, now I get it, thanks. This message concerns design choices for record-syntax-related GHC extensions. Lennart, pls tune in. You don’t need to have read the thread to understand this message. | I think that Even refers to an example like this: | | module A where | data A = A { a :: Int

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-08-09 Thread Lennart Augustsson
At a minimum I think the error message should be better. I also think it would be natural to use the DisambiguateRecordFields for the places where RecordWildcards are used. I mean, if I change from unqualified import to a qualified one, and then change all visible names to be qualified I would

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-07-30 Thread Evan Laforge
On Fri, Jul 24, 2009 at 4:48 PM, Iavor Diatchkiiavor.diatc...@gmail.com wrote: Hello, I think that Even refers to an example like this: ... Yeah, that's exactly what I meant, sorry if it wasn't clear initially. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-07-24 Thread Iavor Diatchki
Hello, I think that Even refers to an example like this: module A where data A = A { a :: Int } The following works: {-# LANGUAGE NamedFieldPuns #-} module B where import A f (A { a }) = a However, if we import A qualified, then punning does not seem to work: {-# LANGUAGE

RE: [Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-07-23 Thread Simon Peyton-Jones
Can you give a concrete program to illustrate your point, please? I'm not getting it. Simon | -Original Message- | From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On | Behalf Of Evan Laforge | Sent: 17 July 2009 23:57 | To: haskell | Subject:

[Haskell-cafe] generalize RecordPuns and RecordWildCards to work with qualified names?

2009-07-17 Thread Evan Laforge
Record punning is not all that useful with qualified module names. If I write '(M.Record { M.rec_x })' it says Qualified variable in pattern and if I write '(M.Record { rec_x })' it says 'Not in scope: `rec_x''. Could it be this extension be further extended slightly so that 'f (M.Record {