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

2015-11-18 Thread Simon Peyton Jones
Done!

|  -Original Message-
|  From: Ben Gamari [mailto:b...@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 <simo...@microsoft.com> writes:
|  
|  > |  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
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


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

2015-11-17 Thread Ben Gamari
Simon Peyton Jones  writes:

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


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


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

2015-11-09 Thread 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
 wrote:
> 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-boun...@haskell.org] On Behalf Of
> |  g...@git.haskell.org
> |  Sent: 07 November 2015 23:50
> |  To: ghc-comm...@haskell.org
> |  Subject: [commit: ghc] master: Remove PatSynBuilderId (2208011)
> |
> |  Repository : ssh://g...@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=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe4c08d2
> |  
> e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=SQ%2fUVBd2qpKcBoN17ALE
> |  MES4qFLtEuWiJakOotW0IUM%3d
> |
> |  >---
> |
> |  commit 22080113f02f6644e2a0e3ce8adb1502346ab3b4
> |  Author: Matthew Pickering 
> |  Date:   Sat Nov 7 23:46:03 2015 +
> |
> |  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-comm...@haskell.org
> |  
> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell
> |  .org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
> |  
> commits=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe
> |  
> 4c08d2e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=BnsSFmFFBiglS%2b
> |  ZyKRkye9LUDZyIh7lDkRoyCLDvb9U%3d
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


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

2015-11-09 Thread 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-boun...@haskell.org] On Behalf Of
|  g...@git.haskell.org
|  Sent: 07 November 2015 23:50
|  To: ghc-comm...@haskell.org
|  Subject: [commit: ghc] master: Remove PatSynBuilderId (2208011)
|  
|  Repository : ssh://g...@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=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe4c08d2
|  e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=SQ%2fUVBd2qpKcBoN17ALE
|  MES4qFLtEuWiJakOotW0IUM%3d
|  
|  >---
|  
|  commit 22080113f02f6644e2a0e3ce8adb1502346ab3b4
|  Author: Matthew Pickering 
|  Date:   Sat Nov 7 23:46:03 2015 +
|  
|  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-comm...@haskell.org
|  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell
|  .org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  commits=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3ebe
|  4c08d2e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=BnsSFmFFBiglS%2b
|  ZyKRkye9LUDZyIh7lDkRoyCLDvb9U%3d
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


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

2015-11-09 Thread 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.

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 
|  wrote:
|  > 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-boun...@haskell.org] On
|  > | Behalf Of  g...@git.haskell.org
|  > |  Sent: 07 November 2015 23:50
|  > |  To: ghc-comm...@haskell.org
|  > |  Subject: [commit: ghc] master: Remove PatSynBuilderId (2208011)
|  > |
|  > |  Repository : ssh://g...@git.haskell.org/ghc
|  > |
|  > |  On branch  : master
|  > |  Link   :
|  > |
|  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fghc.haskell.
|  > |
|  > | org%2ftrac%2fghc%2fchangeset%2f22080113f02f6644e2a0e3ce8adb1502346ab
|  > | 3b4%2fgh
|  > |
|  > | c=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb4068a4d3e
|  > | be4c08d2
|  > | e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=SQ%2fUVBd2qpKc
|  > | BoN17ALE
|  > |  MES4qFLtEuWiJakOotW0IUM%3d
|  > |
|  > |  >---
|  > |
|  > |  commit 22080113f02f6644e2a0e3ce8adb1502346ab3b4
|  > |  Author: Matthew Pickering 
|  > |  Date:   Sat Nov 7 23:46:03 2015 +
|  > |
|  > |  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-comm...@haskell.org
|  > |
|  > | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail
|  > | .haskell
|  > |  .org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  > |
|  > | commits=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c761b0bb406
|  > | 8a4d3ebe
|  > | 4c08d2e7ce3c86%7c72f988bf86f141af91ab2d7cd011db47%7c1=BnsSFmFF
|  > | BiglS%2b
|  > |  ZyKRkye9LUDZyIh7lDkRoyCLDvb9U%3d
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs