Recognizing default method implementations

Erdi, Gergo Gergo.Erdi at sc.com
Thu Dec 2 07:51:37 UTC 2021


PUBLIC


PUBLIC

Basically I want to skip everything that can't possibly needed after full specialization, i.e. dictionary and default method definitions and method accesors. But I realize now that I should just look at the types, and skip anything with a non-empty context, since after full specialization I should, transitively, also have no need for normal top-level function definitions that have a context.

From: Simon Peyton Jones <simonpj at microsoft.com>
Sent: Wednesday, December 1, 2021 4:57 PM
To: Erdi, Gergo <Gergo.Erdi at sc.com>
Cc: GHC <ghc-devs at haskell.org>
Subject: [External] RE: Recognizing default method implementations


PUBLIC

ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails. Always report suspicious emails using the Report As Phishing button in Outlook to protect the Bank and our clients.

Is there a way to recognize that an Id / Var refers to a default method implementation, e.g. $dm/= in the following?

I'm afraid not.  There has never been a reason to do so.  And it might not be robust e.g. it might be inlined.

What is the problem you are trying to solve?

Simon

PS: I am leaving Microsoft at the end of November 2021, at which point simonpj at microsoft.com<mailto:simonpj at microsoft.com> will cease to work.  Use simon.peytonjones at gmail.com<mailto:simon.peytonjones at gmail.com> instead.  (For now, it just forwards to simonpj at microsoft.com<mailto:simonpj at microsoft.com>.)

From: ghc-devs <ghc-devs-bounces at haskell.org<mailto:ghc-devs-bounces at haskell.org>> On Behalf Of Erdi, Gergo via ghc-devs
Sent: 01 December 2021 05:22
To: 'GHC' <ghc-devs at haskell.org<mailto:ghc-devs at haskell.org>>
Subject: [EXTERNAL] Recognizing default method implementations


PUBLIC

Hi,

Is there a way to recognize that an Id / Var refers to a default method implementation, e.g. $dm/= in the following?

$dm/= :: forall a. Eq a => a -> a -> Bool
[GblId, Arity=3, Unf=OtherCon []]
$dm/=
  = \ (@a_ahz)
      ($dEq_sI6 [Occ=Once1] :: Eq a_ahz)
      (x_sI7 [Occ=Once1] :: a_ahz)
      (y_sI8 [Occ=Once1] :: a_ahz) ->
      case == @a_ahz $dEq_sI6 x_sI7 y_sI8 of {
        False -> True;
        True -> False
      }


Thanks,
Gergo

This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at https: //www.sc.com/en/our-locations

Where you have a Financial Markets relationship with Standard Chartered PLC, Standard Chartered Bank and their subsidiaries (the "Group"), information on the regulatory standards we adhere to and how it may affect you can be found in our Regulatory Compliance Statement at https: //www.sc.com/rcs/ and Regulatory Compliance Disclosures at http: //www.sc.com/rcs/fm

Insofar as this communication is not sent by the Global Research team and contains any market commentary, the market commentary has been prepared by the sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute research material, independent research, recommendation or financial advice. Any market commentary is for information purpose only and shall not be relied on for any other purpose and is subject to the relevant disclaimers available at https: //www.sc.com/en/regulatory-disclosures/#market-disclaimer.

Insofar as this communication is sent by the Global Research team and contains any research materials prepared by members of the team, the research material is for information purpose only and shall not be relied on for any other purpose, and is subject to the relevant disclaimers available at https: //research.sc.com/research/api/application/static/terms-and-conditions.

Insofar as this e-mail contains the term sheet for a proposed transaction, by responding affirmatively to this e-mail, you agree that you have understood the terms and conditions in the attached term sheet and evaluated the merits and risks of the transaction. We may at times also request you to sign the term sheet to acknowledge the same.

Please visit https: //www.sc.com/en/regulatory-disclosures/dodd-frank/ for important information with respect to derivative products.

This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at https: //www.sc.com/en/our-locations

Where you have a Financial Markets relationship with Standard Chartered PLC, Standard Chartered Bank and their subsidiaries (the "Group"), information on the regulatory standards we adhere to and how it may affect you can be found in our Regulatory Compliance Statement at https: //www.sc.com/rcs/ and Regulatory Compliance Disclosures at http: //www.sc.com/rcs/fm

Insofar as this communication is not sent by the Global Research team and contains any market commentary, the market commentary has been prepared by the sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute research material, independent research, recommendation or financial advice. Any market commentary is for information purpose only and shall not be relied on for any other purpose and is subject to the relevant disclaimers available at https: //www.sc.com/en/regulatory-disclosures/#market-disclaimer.

Insofar as this communication is sent by the Global Research team and contains any research materials prepared by members of the team, the research material is for information purpose only and shall not be relied on for any other purpose, and is subject to the relevant disclaimers available at https: //research.sc.com/research/api/application/static/terms-and-conditions. 

Insofar as this e-mail contains the term sheet for a proposed transaction, by responding affirmatively to this e-mail, you agree that you have understood the terms and conditions in the attached term sheet and evaluated the merits and risks of the transaction. We may at times also request you to sign the term sheet to acknowledge the same.

Please visit https: //www.sc.com/en/regulatory-disclosures/dodd-frank/ for important information with respect to derivative products.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20211202/735b4f1c/attachment.html>


More information about the ghc-devs mailing list