An implicit equality typeclass instance, 2015: implicit val intEqual: Eq[Int] = new Eq[Int] { def equal(x: Int, y: Int): Boolean = x == y } (1/8)
-
Show this thread
-
SAM types introduced, 2016: implicit val intEqual: Eq[Int] = (x: Int, y: Int) => x == y (2/8)
1 reply 0 retweets 2 likesShow this thread -
Type inference improves, 2017: implicit val intEq: Eq[Int] = (x, y) => x == y (3/8)
1 reply 0 retweets 2 likesShow this thread -
Developers get lazier, 2018: implicit val intEq: Eq[Int] = _ == _ (4/8)
1 reply 1 retweet 4 likesShow this thread -
Some forgotten experiments, 2019: witness intEq: Eq[Int] = _ == _ (5/8)
1 reply 0 retweets 3 likesShow this thread -
We settle on `given`, 2020: given intEq: Eq[Int] = _ == _ (6/8)
1 reply 0 retweets 3 likesShow this thread -
Scala 3.0, 2021: given Eq[Int] = _ == _ (7/8)
3 replies 2 retweets 21 likesShow this thread -
-
Replying to @propensive
My favorite is the "forgotten experiment." It says what you mean; it declares a witness to `Eq Int`, with a name. That means it can be used both directly as an object (by name), and by inference to satisfy constraints. Seems ideal.
1 reply 0 retweets 1 like -
Replying to @BrianGoetz
Around that time
@odersky was considering about five different keywords to replace "implicit". I joked at the time that if we started calling them "witnesses", to work around the other changes to implicit scopes, we'd need a "witness relocation program"...2 replies 0 retweets 3 likes
Anyway, the "forgotten" is more of a reference to my memory—I don't remember the exact syntax! But what we're getting in Scala 3 can also be named, but it's optional... and it gets an ugly generated name if you don't specify one.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.