In Scala 2.8 language specification, §6.26.5 Eta Expansion, it states that we need a maximal sub-expression, however, no definition of this can be found. Can someone clarify this?
What is a "Maximal Sub-expression" in Scala 2.8 specification §6.26.5 Eta Expansion?
160 Views Asked by Felix At
1
There are 1 best solutions below
Related Questions in SCALA
- Datadog query to filter if a string is contained within a tag
- Trying to use a dynamic block in Terraform to create multiple of the same widget in Datadog
- Is there a way to have division when writing terraform code for a log alert in Datadog?
- How create a multi alert monitor in Datadog via Terraform?
- Datadog Log based monitor using Terraform - invalid query
- Why is the threshold value repeated in query and monitor_thresholds, in the datadog_monitor terraform resource?
- DataDog Monitor alert notification are not send to Distribution lists
- How do I create a Monitor for a Specific Log in DataDog
- Datadog deployment through ArgoCD
- Multiple Version datadog Agent installation on EC2 ubuntu machine
Related Questions in TYPE-INFERENCE
- Datadog query to filter if a string is contained within a tag
- Trying to use a dynamic block in Terraform to create multiple of the same widget in Datadog
- Is there a way to have division when writing terraform code for a log alert in Datadog?
- How create a multi alert monitor in Datadog via Terraform?
- Datadog Log based monitor using Terraform - invalid query
- Why is the threshold value repeated in query and monitor_thresholds, in the datadog_monitor terraform resource?
- DataDog Monitor alert notification are not send to Distribution lists
- How do I create a Monitor for a Specific Log in DataDog
- Datadog deployment through ArgoCD
- Multiple Version datadog Agent installation on EC2 ubuntu machine
Related Questions in EXPANSION
- Datadog query to filter if a string is contained within a tag
- Trying to use a dynamic block in Terraform to create multiple of the same widget in Datadog
- Is there a way to have division when writing terraform code for a log alert in Datadog?
- How create a multi alert monitor in Datadog via Terraform?
- Datadog Log based monitor using Terraform - invalid query
- Why is the threshold value repeated in query and monitor_thresholds, in the datadog_monitor terraform resource?
- DataDog Monitor alert notification are not send to Distribution lists
- How do I create a Monitor for a Specific Log in DataDog
- Datadog deployment through ArgoCD
- Multiple Version datadog Agent installation on EC2 ubuntu machine
Related Questions in LANGUAGE-SPECIFICATIONS
- Datadog query to filter if a string is contained within a tag
- Trying to use a dynamic block in Terraform to create multiple of the same widget in Datadog
- Is there a way to have division when writing terraform code for a log alert in Datadog?
- How create a multi alert monitor in Datadog via Terraform?
- Datadog Log based monitor using Terraform - invalid query
- Why is the threshold value repeated in query and monitor_thresholds, in the datadog_monitor terraform resource?
- DataDog Monitor alert notification are not send to Distribution lists
- How do I create a Monitor for a Specific Log in DataDog
- Datadog deployment through ArgoCD
- Multiple Version datadog Agent installation on EC2 ubuntu machine
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Consider the following:
And then:
Here
(list1 ++ list2).foldLeft(empty)is the expression of method type, andlist1 ++ list2andemptyare its maximal sub-expressions, which are just literally its largest constituent expressions. We're using_to force eta expansion, but in some contexts that wouldn't be necessary.It makes sense that we wouldn't want
list1 ++ list2to be evaluated every time we use the functionfoo, for example, and that's what the conversion described in §6.26.5 accomplishes—it makes sure that the sub-expressions are evaluated and saved once, before the function is created.If we'd started the REPL with
-print, we'd have seen the following (reformatted for clarity):If you're ever wondering what exactly constitutes a sub-expression in a given situation, this is an easy way to check—just look for the lines starting with
<synthetic> val.