I’m sure this is naive, but what if we went with the <no-marker>
approach, and then for givens used something like this:
given instance Ord[Int]
def compare(x: Int, y: Int) =
if x < y then -1 else if x > y then +1 else 0
given alias Ord[Int] =
someInstance
My reasoning for this is that when people say “given alias” or “given instance,” I can’t remember which one is which, but if I see keywords like that, they become much more obvious.
I have previously preferred the :
approach, but if that’s not feasible, at this point I prefer the <no-marker>
approach. Part of Scala’s appeal is its conciseness, and if we use with
for every class, it will require 2-3 keywords just to define a class:
// 2 keywords required
class Foo with
...
// 3 keywords required, 5 words overall
class Bar with
...
end Bar
Again, just spitballing. I comment because I care.