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
| 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
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
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
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
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
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:
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 {