RE: [commit: ghc] master: Remove PatSynBuilderId (2208011)

Matthew,
| Remove PatSynBuilderId
Thanks for doing this. But it can be simpler still! Suggestion:
- remove the new 'labels' field from RecordCon; you only use it in dsExpr
- In dsExpr, use the hsRecFieldSel of the first item in 'rbinds' to get a selector-Id
- Inside that selector-Id you'll find RecSelId IdInfo; you can use that to
get the labels.
Would that work?
Simon
| -----Original Message-----
| From: ghc-commits [mailto:ghc-commits-bounces@haskell.org] On Behalf Of
| git@git.haskell.org
| Sent: 07 November 2015 23:50
| To: ghc-commits@haskell.org
| Subject: [commit: ghc] master: Remove PatSynBuilderId (2208011)
|
| Repository : ssh://git@git.haskell.org/ghc
|
| On branch : master
| Link :
| https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fghc.haskell.
| org%2ftrac%2fghc%2fchangeset%2f22080113f02f6644e2a0e3ce8adb1502346ab3b4%2fgh
| c&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe4c08d2
| e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=SQ%2fUVBd2qpKcBoN17ALE
| MES4qFLtEuWiJakOotW0IUM%3d
|
| >---------------------------------------------------------------
|
| commit 22080113f02f6644e2a0e3ce8adb1502346ab3b4
| Author: Matthew Pickering

I don't think this would work in the case where there are no fields initialised?
Concretely, I am thinking of a case like this:
https://phabricator.haskell.org/P72
If I understand right, rbinds would be an empty list so there would be
no selector Id to get the relevant ConLike from.
On Mon, Nov 9, 2015 at 10:20 AM, Simon Peyton Jones
Matthew,
| Remove PatSynBuilderId
Thanks for doing this. But it can be simpler still! Suggestion:
- remove the new 'labels' field from RecordCon; you only use it in dsExpr
- In dsExpr, use the hsRecFieldSel of the first item in 'rbinds' to get a selector-Id
- Inside that selector-Id you'll find RecSelId IdInfo; you can use that to get the labels.
Would that work?
Simon
| -----Original Message----- | From: ghc-commits [mailto:ghc-commits-bounces@haskell.org] On Behalf Of | git@git.haskell.org | Sent: 07 November 2015 23:50 | To: ghc-commits@haskell.org | Subject: [commit: ghc] master: Remove PatSynBuilderId (2208011) | | Repository : ssh://git@git.haskell.org/ghc | | On branch : master | Link : | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fghc.haskell. | org%2ftrac%2fghc%2fchangeset%2f22080113f02f6644e2a0e3ce8adb1502346ab3b4%2fgh | c&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe4c08d2 | e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=SQ%2fUVBd2qpKcBoN17ALE | MES4qFLtEuWiJakOotW0IUM%3d | | >--------------------------------------------------------------- | | commit 22080113f02f6644e2a0e3ce8adb1502346ab3b4 | Author: Matthew Pickering
| Date: Sat Nov 7 23:46:03 2015 +0000 | | Remove PatSynBuilderId | | Summary: | It was only used to pass field labels between the typechecker and | desugarer. Instead we add an extra field the RecordCon to carry this | information. | | Reviewers: austin, goldfire, bgamari | | Reviewed By: bgamari | | Subscribers: thomie | | Differential Revision: https://phabricator.haskell.org/D1443 | | GHC Trac Issues: #11057 | | | >--------------------------------------------------------------- | | 22080113f02f6644e2a0e3ce8adb1502346ab3b4 | compiler/basicTypes/Id.hs | 11 +---------- | compiler/basicTypes/IdInfo.hs | 3 --- | compiler/deSugar/Coverage.hs | 5 +++-- | compiler/deSugar/DsExpr.hs | 4 +--- | compiler/deSugar/DsMeta.hs | 2 +- | compiler/hsSyn/Convert.hs | 4 +++- | compiler/hsSyn/HsExpr.hs | 4 +++- | compiler/hsSyn/PlaceHolder.hs | 2 ++ | compiler/parser/RdrHsSyn.hs | 4 ++-- | compiler/rename/RnExpr.hs | 6 +++--- | compiler/typecheck/TcExpr.hs | 5 +++-- | compiler/typecheck/TcHsSyn.hs | 4 ++-- compiler/typecheck/TcPatSyn.hs | | 14 ++++++-------- | 13 files changed, 30 insertions(+), 38 deletions(-) | | Diff suppressed because of size. To see it, use: | | git diff-tree --root --patch-with-stat --no-color --find-copies-harder - | -ignore-space-at-eol --cc 22080113f02f6644e2a0e3ce8adb1502346ab3b4 | _______________________________________________ | ghc-commits mailing list | ghc-commits@haskell.org | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell | .org%2fcgi-bin%2fmailman%2flistinfo%2fghc- | commits&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe | 4c08d2e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=BnsSFmFFBiglS%2b | ZyKRkye9LUDZyIh7lDkRoyCLDvb9U%3d

| I don't think this would work in the case where there are no fields
| initialised?
Oh yes, silly me. I was thinking that then we wouldn’t need to look at 'labels' at all, but that's not true.
Well, at least then I'd replace [PostTc id [FieldLabel] with (PostTc ConLike). This makes it like ConPatOut in HsPat. Then the (Located id) field is redundant (we can get it from the ConLike), but that’s only true after typechecking, so maybe simpler to keep both.
It amounts to moving the call to conLikeFieldLabels from tcExpr (RecordCon ...) to dsExpr (RecordCon ...). A small thing but I think it'd be better.
Simon
|
| Concretely, I am thinking of a case like this:
| https://phabricator.haskell.org/P72
|
| If I understand right, rbinds would be an empty list so there would be no
| selector Id to get the relevant ConLike from.
|
| On Mon, Nov 9, 2015 at 10:20 AM, Simon Peyton Jones

Simon Peyton Jones
| I don't think this would work in the case where there are no fields | initialised?
Oh yes, silly me. I was thinking that then we wouldn’t need to look at 'labels' at all, but that's not true.
Well, at least then I'd replace [PostTc id [FieldLabel] with (PostTc ConLike). This makes it like ConPatOut in HsPat. Then the (Located id) field is redundant (we can get it from the ConLike), but that’s only true after typechecking, so maybe simpler to keep both.
It amounts to moving the call to conLikeFieldLabels from tcExpr (RecordCon ...) to dsExpr (RecordCon ...). A small thing but I think it'd be better.
Mathew, did you ever get to this? Cheers, - Ben

I will do it if Matthew doesn't get to it
Simon
| -----Original Message-----
| From: Ben Gamari [mailto:ben@well-typed.com]
| Sent: 17 November 2015 16:41
| To: Simon Peyton Jones; Matthew Pickering
| Cc: ghc-devs@haskell.org
| Subject: RE: [commit: ghc] master: Remove PatSynBuilderId (2208011)
|
| Simon Peyton Jones

Done!
| -----Original Message-----
| From: Ben Gamari [mailto:ben@well-typed.com]
| Sent: 17 November 2015 16:41
| To: Simon Peyton Jones; Matthew Pickering
| Cc: ghc-devs@haskell.org
| Subject: RE: [commit: ghc] master: Remove PatSynBuilderId (2208011)
|
| Simon Peyton Jones
participants (3)
-
Ben Gamari
-
Matthew Pickering
-
Simon Peyton Jones