Abstract given seems useless
See original GitHub issueAbstract given were introduced in https://github.com/lampepfl/dotty/pull/10538 . But these seem useless, as one can always define an abstract field and use a given alias:
def ord: Ord[T]
given Ord[T] = ord
Would it be possible to drop this feature, as it forces us to add an uncanny with
to givens even when no structural part is needed https://github.com/lampepfl/dotty-feature-requests/issues/156
Issue Analytics
- State:
- Created 3 years ago
- Comments:25 (21 by maintainers)
Top Results From Across the Web
What are examples of useful and useless abstractions? - Quora
An abstract of a long article such as a PHD is beneficial to the reader to get the main points of the writer's...
Read more >I believe that a lot of forms of abstract art are pointless ... - Reddit
I can't even try to give you an answer to the incredibly complex "what is art?" question you're kind of implicitly asking, because...
Read more >Good VS. Worthless Abstract Art and What Sets It Apart
While good abstract art is more about the meaning, intent,expression and skill, worthless abstract art lacks it.
Read more >Science Unshackled: How Obscure, Abstract, Seemingly ...
Buy Science Unshackled: How Obscure, Abstract, Seemingly Useless Scientific Research Turned Out to Be the Basis for Modern Life on Amazon.com ✓ FREE ......
Read more >[no-useless-constructor] Skipping constructors with explicit ...
I routinely make use of inheritance and composition in my daily work, choosing whichever one is more appropriate given the circumstance. Modern ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I find abstract givens useful, indeed. Abstract definitions are a common means of abstraction (abstract methods and abstract type members). We can observe that in Scala 2 abstract implicit definitions are used (e.g. in cats, endpoints4s, akka, and maybe at other places that I’m not aware of).
From a more fundamental perspective, there is a correspondence between parameters and abstract members. Both are means of abstractions, and you can refactor from one form to the other:
However, if we remove abstract givens, this will make it impossible to refactor this:
into that:
You mentioned a workaround, which in my opinion is not only verbose, but very low-level and “mechanism-oriented” (as opposed to “intent-oriented”). I like how abstract givens removed half of the lines of this part of the compiler.
That being said, if abstract givens are the only reason why we need the
with
connector, I agree that it’s an important drawback. Is it true that we could removewith
if we didn’t support abstract givens?