# Scala 3 specific stdlib improvements

**URL:** <https://contributors.scala-lang.org/t/scala-3-specific-stdlib-improvements/6661>\
**Category:** Scala Standard Library\
**Created:** [May 16, 2024, 7:32am UTC](https://contributors.scala-lang.org/t/scala-3-specific-stdlib-improvements/6661 "2024-05-16T07:32:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![OndrejSpanel](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/ondrejspanel/32/1238_2.png) [@OndrejSpanel](https://contributors.scala-lang.org/u/OndrejSpanel)\
**Post date:** [May 16, 2024, 7:32am UTC](https://contributors.scala-lang.org/t/scala-3-specific-stdlib-improvements/6661/1 "2024-05-16T07:32:54Z")

</div>

Some parts of stdlib could be greatly ehanced by using Scala 3 specific features. One example is `ChainingSyntax`. Just consider:

```auto
  extension [A](self: A):
    inline def tap[U](inline f: A => U): A =
      f(self)
      self
    inline def pipe[B](inline f: A => B): B = f(self)

```

Using `inline` here is not only more efficient, it also makes debugging more reliable (no lambdas), exception callstacks shorter and tidier and it e.g. makes `return` statemens from inside possible, as they are no longer non-local.

I am not sure what are binary compatibility concerns in cases like this and what strategy could be used to implement Scala 3 improvements to some carefully seleected parts of stdlib.

---

_[View the full topic](https://contributors.scala-lang.org/t/scala-3-specific-stdlib-improvements/6661)._
