# Scala Standard Library

**URL:** https://contributors.scala-lang.org/c/stdlib/8.md

[Latest](https://contributors.scala-lang.org/latest.md) · [Categories](https://contributors.scala-lang.org/categories.md)

---

## [About the Scala Standard Library category](https://contributors.scala-lang.org/t/about-the-scala-standard-library-category/24)

<div class="topic-metadata">

**Author:** [@jvican](https://contributors.scala-lang.org/u/jvican)\
**Replies:** 0

</div>

Discussion around the Scala standard library.

---

## [SLC: Improve pattern matching on Array / IArray](https://contributors.scala-lang.org/t/slc-improve-pattern-matching-on-array-iarray/7574)

<div class="topic-metadata">

**Author:** [@scalafan](https://contributors.scala-lang.org/u/scalafan)\
**Replies:** 13\
**Last updated:** [November 19, 2026, 2:52pm UTC](https://contributors.scala-lang.org/t/slc-improve-pattern-matching-on-array-iarray/7574 "2026-11-19T14:52:45Z")

</div>

I have recently migrated the codebase from Vector to IArray, because it is the perfect collection for so many use-cases. I have encountered many quirks and have reported the bugs to you. But there is one major one remain…

---

## [SLC: remove Stream from default imports](https://contributors.scala-lang.org/t/slc-remove-stream-from-default-imports/7577)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 3\
**Last updated:** [November 14, 2026, 6:08pm UTC](https://contributors.scala-lang.org/t/slc-remove-stream-from-default-imports/7577 "2026-11-14T18:08:18Z")

</div>

Stream is deprecated, users should use LazyList instead (or “LazyListIterable :grimacing:” to be capture safe) No need to delete the class, but it should require an explicit import IMO.

---

## [Standard Library: Now open for improvements and suggestions!](https://contributors.scala-lang.org/t/standard-library-now-open-for-improvements-and-suggestions/7337)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 171\
**Last updated:** [November 10, 2026, 9:11pm UTC](https://contributors.scala-lang.org/t/standard-library-now-open-for-improvements-and-suggestions/7337 "2026-11-10T21:11:00Z")

</div>

This thread is part of the projects covered by Sovereign Tech Fund’s investment in Scala. For the full context, please read the announcement blog post. On this forum, each project supported through this investment has…

---

## [SLC: more \`CanEqual\` instances in the standard library](https://contributors.scala-lang.org/t/slc-more-canequal-instances-in-the-standard-library/7565)

<div class="topic-metadata">

**Author:** [@mberndt](https://contributors.scala-lang.org/u/mberndt)\
**Replies:** 6\
**Last updated:** [November 2, 2026, 12:57pm UTC](https://contributors.scala-lang.org/t/slc-more-canequal-instances-in-the-standard-library/7565 "2026-11-02T12:57:12Z")

</div>

Hi, I’d like to further push adoption of the strict-equality feature by making it easier to use. One problem is that many Java standard library types currently don’t have CanEqual instances, and I’d like to fix that by …

---

## [SLC: Replace \*Ops conversions by direct extension methods](https://contributors.scala-lang.org/t/slc-replace-ops-conversions-by-direct-extension-methods/7544)

<div class="topic-metadata">

**Author:** [@halotukozak](https://contributors.scala-lang.org/u/halotukozak)\
**Replies:** 8\
**Last updated:** [October 29, 2026, 5:09pm UTC](https://contributors.scala-lang.org/t/slc-replace-ops-conversions-by-direct-extension-methods/7544 "2026-10-29T17:09:51Z")

</div>

PR Replace \*Ops conversions by direct extension methods by halotukozak · Pull Request #26637 · scala/scala3 · GitHub I propose to deprecate the implicit conversions, which was introduced to enable a’la extension method …

---

## [SLC: public constructor for Using.Manager](https://contributors.scala-lang.org/t/slc-public-constructor-for-using-manager/7548)

<div class="topic-metadata">

**Author:** [@mberndt](https://contributors.scala-lang.org/u/mberndt)\
**Replies:** 8\
**Last updated:** [October 29, 2026, 1:06pm UTC](https://contributors.scala-lang.org/t/slc-public-constructor-for-using-manager/7548 "2026-10-29T13:06:54Z")

</div>

Hi, Using.Manager is a useful utility for resource management. Unfortunately, the only way to get hold of a Using.Manager is by calling Using.Manager.apply and passing a function to it that accepts a Using.Manager insta…

---

## [SLC: Easy conversion from normal function to a Contextual one \`FunctionN#applyToContext\`](https://contributors.scala-lang.org/t/slc-easy-conversion-from-normal-function-to-a-contextual-one-functionn-applytocontext/7556)

<div class="topic-metadata">

**Author:** [@sideeffffect](https://contributors.scala-lang.org/u/sideeffffect)\
**Replies:** 10\
**Last updated:** [October 27, 2026, 5:19pm UTC](https://contributors.scala-lang.org/t/slc-easy-conversion-from-normal-function-to-a-contextual-one-functionn-applytocontext/7556 "2026-10-27T17:19:39Z")

</div>

Following up on Standard Library: Now open for improvements and suggestions!, I’d like to propose a small addition to all FunctionN traits: trait Function2\[-T1, -T2, +R\]: def apply(v1: T1, v2: T2): R def applyToCont…

---

## [SLC: Add string singleton comparison operators to scala.compiletime.ops.string](https://contributors.scala-lang.org/t/slc-add-string-singleton-comparison-operators-to-scala-compiletime-ops-string/7396)

<div class="topic-metadata">

**Author:** [@wtetzner](https://contributors.scala-lang.org/u/wtetzner)\
**Replies:** 1\
**Last updated:** [February 25, 2026, 10:02am UTC](https://contributors.scala-lang.org/t/slc-add-string-singleton-comparison-operators-to-scala-compiletime-ops-string/7396 "2026-02-25T10:02:21Z")

</div>

Pull Request: Add string singleton comparison operators to scala.compiletime.ops.string. by wtetzner · Pull Request #24748 · scala/scala3 · GitHub The numeric singleton types already have comparison operators, but for s…

---

## [SLC: Make \`Vector\` the default implementation of \`Seq\` instead of \`List\`](https://contributors.scala-lang.org/t/slc-make-vector-the-default-implementation-of-seq-instead-of-list/7482)

<div class="topic-metadata">

**Author:** [@lihaoyi](https://contributors.scala-lang.org/u/lihaoyi)\
**Replies:** 46\
**Last updated:** [September 10, 2026, 10:19pm UTC](https://contributors.scala-lang.org/t/slc-make-vector-the-default-implementation-of-seq-instead-of-list/7482 "2026-09-10T22:19:33Z")

</div>

Vector is in general a much more forgiving data structure than List: while it does not have quite as fast head append/removal performance, it has generally decent O(log n) performance across a wide range of operations, a…

---

## [SLC: \`Conversion\[A, Option\[A\]\]\`](https://contributors.scala-lang.org/t/slc-conversion-a-option-a/7514)

<div class="topic-metadata">

**Author:** [@mberndt](https://contributors.scala-lang.org/u/mberndt)\
**Replies:** 40\
**Last updated:** [August 26, 2026, 1:59pm UTC](https://contributors.scala-lang.org/t/slc-conversion-a-option-a/7514 "2026-08-26T13:59:50Z")

</div>

Hi, we currently have two ways to represent optional values in Scala: Option\[A\] and A | Null. I think it’s safe to say that the former is generally preferable: it can be nested and it has a useful API with methods like g…

---

## [SLC: Extend \`typeChecks\`/\`typeCheckErrors\` to run compiler-plugin phases](https://contributors.scala-lang.org/t/slc-extend-typechecks-typecheckerrors-to-run-compiler-plugin-phases/7501)

<div class="topic-metadata">

**Author:** [@soronpo](https://contributors.scala-lang.org/u/soronpo)\
**Replies:** 9\
**Last updated:** [August 2, 2026, 11:05pm UTC](https://contributors.scala-lang.org/t/slc-extend-typechecks-typecheckerrors-to-run-compiler-plugin-phases/7501 "2026-08-02T23:05:34Z")

</div>

Edit: Proposal pulled. Read my later reply below. I’ve been needing this since forever, since I have compiler plugins that perform various changes and checks that I cannot properly verify them with typeCheckErrors. Ther…

---

## [SLC: Tuple apply/unapply](https://contributors.scala-lang.org/t/slc-tuple-apply-unapply/7510)

<div class="topic-metadata">

**Author:** [@rssh](https://contributors.scala-lang.org/u/rssh)\
**Replies:** 7\
**Last updated:** [August 2, 2026, 9:05pm UTC](https://contributors.scala-lang.org/t/slc-tuple-apply-unapply/7510 "2026-08-02T21:05:06Z")

</div>

Proposal – add to the Tuple companion object apply and unapply for any number of arguments. (Before, it was only for zero and one arguments. PR: Add uniform Tuple.apply and Tuple.unapply by rssh · Pull Request #24874 ·…

---

## [SLC: Merge mutable.ArrayDeque into mutable.Buffer on the JVM](https://contributors.scala-lang.org/t/slc-merge-mutable-arraydeque-into-mutable-buffer-on-the-jvm/7469)

<div class="topic-metadata">

**Author:** [@lihaoyi](https://contributors.scala-lang.org/u/lihaoyi)\
**Replies:** 21\
**Last updated:** [July 29, 2026, 2:33pm UTC](https://contributors.scala-lang.org/t/slc-merge-mutable-arraydeque-into-mutable-buffer-on-the-jvm/7469 "2026-07-29T14:33:57Z")

</div>

ArrayDeque introduced in Scala 2.13 is basically a superset of Buffer’s functionality, and there is no reason that anyone should use Buffer anymore. ArrayDeque supports all the same APIs efficiently, and more due to al…

---

## [SLC: Add Mirror-based derivation for ToExpr and FromExpr](https://contributors.scala-lang.org/t/slc-add-mirror-based-derivation-for-toexpr-and-fromexpr/7502)

<div class="topic-metadata">

**Author:** [@halotukozak](https://contributors.scala-lang.org/u/halotukozak)\
**Replies:** 4\
**Last updated:** [July 15, 2026, 8:30am UTC](https://contributors.scala-lang.org/t/slc-add-mirror-based-derivation-for-toexpr-and-fromexpr/7502 "2026-07-15T08:30:40Z")

</div>

Deriving ToExpr and FromExpr via Mirror 1. Motivation Every other instance in ToExpr/FromExpr is either a primitive or hand-written for a specific stdlib shape (Option, List, Either, the TupleN family). A user’s own case…

---

## [SLC: add into modifier to the Factory and BuildFrom traits](https://contributors.scala-lang.org/t/slc-add-into-modifier-to-the-factory-and-buildfrom-traits/7476)

<div class="topic-metadata">

**Author:** [@halotukozak](https://contributors.scala-lang.org/u/halotukozak)\
**Replies:** 2\
**Last updated:** [June 12, 2026, 11:20am UTC](https://contributors.scala-lang.org/t/slc-add-into-modifier-to-the-factory-and-buildfrom-traits/7476 "2026-06-12T11:20:03Z")

</div>

Motivation IterableOnceOps#to is defined as: def to\[C1\](factory: Factory\[A, C1\]): C1 xs.to(List), xs.to(Vector) etc. work today because the companion objects provide implicit conversions such as: // scala.collection.…

---

## [Bad IArray opaque type interop](https://contributors.scala-lang.org/t/bad-iarray-opaque-type-interop/7485)

<div class="topic-metadata">

**Author:** [@scalafan](https://contributors.scala-lang.org/u/scalafan)\
**Replies:** 9\
**Last updated:** [June 29, 2026, 9:18am UTC](https://contributors.scala-lang.org/t/bad-iarray-opaque-type-interop/7485 "2026-06-29T09:18:56Z")

</div>

This code fails to compile: object Holder { opaque type Id \<: Int = Int def apply(a: Int): Id = a } val arr: IArray\[Holder.Id\] = IArray.tabulate(10)(Holder.apply) val x: Holder.Id = arr(1) // this line does not com…

---

## [SLC: Add more methods to BigInt and BigDecimal](https://contributors.scala-lang.org/t/slc-add-more-methods-to-bigint-and-bigdecimal/7471)

<div class="topic-metadata">

**Author:** [@hepin1989](https://contributors.scala-lang.org/u/hepin1989)\
**Replies:** 2\
**Last updated:** [June 24, 2026, 3:02pm UTC](https://contributors.scala-lang.org/t/slc-add-more-methods-to-bigint-and-bigdecimal/7471 "2026-06-24T15:02:20Z")

</div>

There is no rootn method in the current scala3/library/src/scala/math/BigDecimal.scala at main · scala/scala3 · GitHub

---

## [SLC: IsSeq for IArray](https://contributors.scala-lang.org/t/slc-isseq-for-iarray/7468)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 2\
**Last updated:** [June 11, 2026, 12:54pm UTC](https://contributors.scala-lang.org/t/slc-isseq-for-iarray/7468 "2026-06-11T12:54:44Z")

</div>

As described in scala collections docs, IsSeq, IsIterable etc allow truly generic collection-style algorithms: I would propose to provide an instance for IArray (to accompany the Array implementation), this one will be…

---

## [SLC: Add sizeCompare overloaded methods to SizeCompareOps](https://contributors.scala-lang.org/t/slc-add-sizecompare-overloaded-methods-to-sizecompareops/7410)

<div class="topic-metadata">

**Author:** [@marconilanna](https://contributors.scala-lang.org/u/marconilanna)\
**Replies:** 1\
**Last updated:** [June 10, 2026, 2:18pm UTC](https://contributors.scala-lang.org/t/slc-add-sizecompare-overloaded-methods-to-sizecompareops/7410 "2026-06-10T14:18:44Z")

</div>

sizeCompare has an overloaded version that SizeCompareOps does not support. This PR adds the missing overloaded methods: Add sizeCompare overloaded methods to SizeCompareOps by marconilanna · Pull Request #25524 · scala…

---

## [SLC: make .to(IArray) work for collections](https://contributors.scala-lang.org/t/slc-make-to-iarray-work-for-collections/7466)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 3\
**Last updated:** [June 9, 2026, 8:20pm UTC](https://contributors.scala-lang.org/t/slc-make-to-iarray-work-for-collections/7466 "2026-06-09T20:20:58Z")

</div>

If you want to convert data to an IArray, code like the following is currently not possible: def example = collection.view.map(\_ \* 2).to(IArray) currently, you can only use the direct factory methods: IArray.from(col…

---

## [SLC: BuildFrom for IArray](https://contributors.scala-lang.org/t/slc-buildfrom-for-iarray/7467)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 0\
**Last updated:** [June 5, 2026, 2:48pm UTC](https://contributors.scala-lang.org/t/slc-buildfrom-for-iarray/7467 "2026-06-05T14:48:49Z")

</div>

Enable functions that depend on BuildFrom to work with IArray, including shuffle, lazyZip, Future.sequence implementation here: Add an implementation of BuildFrom for IArray by bishabosha · Pull Request #24674 · scala/s…

---

## [Autobench the stdlib with LLM](https://contributors.scala-lang.org/t/autobench-the-stdlib-with-llm/7463)

<div class="topic-metadata">

**Author:** [@hepin1989](https://contributors.scala-lang.org/u/hepin1989)\
**Replies:** 2\
**Last updated:** [May 31, 2026, 11:29am UTC](https://contributors.scala-lang.org/t/autobench-the-stdlib-with-llm/7463 "2026-05-31T11:29:34Z")

</div>

In our work, we frequently utilize LLMs to automate benchmarking and generate “stacked commits.” Each commit in the stack delivers a positive performance improvement, and the series is ultimately submitted either as …

---

## [SLC: add CanEqual for named tuples](https://contributors.scala-lang.org/t/slc-add-canequal-for-named-tuples/7462)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 0\
**Last updated:** [May 29, 2026, 3:48pm UTC](https://contributors.scala-lang.org/t/slc-add-canequal-for-named-tuples/7462 "2026-05-29T15:48:17Z")

</div>

the CanEqual typeclass is used to prevent nonsensical comparisons. It already has an instance defined for Tuple, but not for Named Tuples. e.g. scala\> (1,2,3) == (1,2) -- \[E172\] Type Error: ---------------------------…

---

## [SLC: Add groupBy(mapFactory)(f) overload to IterableOps and ArrayOps](https://contributors.scala-lang.org/t/slc-add-groupby-mapfactory-f-overload-to-iterableops-and-arrayops/7454)

<div class="topic-metadata">

**Author:** [@hepin1989](https://contributors.scala-lang.org/u/hepin1989)\
**Replies:** 2\
**Last updated:** [May 20, 2026, 4:42am UTC](https://contributors.scala-lang.org/t/slc-add-groupby-mapfactory-f-overload-to-iterableops-and-arrayops/7454 "2026-05-20T04:42:35Z")

</div>

def groupBy\[K, CC\[\_, \_\]\](mapFactory: MapFactory\[CC\])(f: A =\> K): CC\[K, C\] def groupBy\[K, CC\[\_, \_\]\](mapFactory: MapFactory\[CC\])(f: A =\> K): CC\[K, Array\[A\]\] def groupBy\[K, CC\[\_, \_\]\](mapFactory: MapFactory\[CC\])(f: A =\> K): …

---

## [SLC: Add Function.identity method](https://contributors.scala-lang.org/t/slc-add-function-identity-method/7452)

<div class="topic-metadata">

**Author:** [@hepin1989](https://contributors.scala-lang.org/u/hepin1989)\
**Replies:** 1\
**Last updated:** [May 18, 2026, 9:01am UTC](https://contributors.scala-lang.org/t/slc-add-function-identity-method/7452 "2026-05-18T09:01:04Z")

</div>

Adding this will make it perform great and avoid the eta allocation.

---

## [SLC: Add andThen to Function2..Function22 and FunctionXXL](https://contributors.scala-lang.org/t/slc-add-andthen-to-function2-function22-and-functionxxl/7453)

<div class="topic-metadata">

**Author:** [@hepin1989](https://contributors.scala-lang.org/u/hepin1989)\
**Replies:** 0\
**Last updated:** [May 18, 2026, 7:40am UTC](https://contributors.scala-lang.org/t/slc-add-andthen-to-function2-function22-and-functionxxl/7453 "2026-05-18T07:40:24Z")

</div>

the andThen and compose mehtod is quite helpful.

---

## [SLC: conversions for boundary/break](https://contributors.scala-lang.org/t/slc-conversions-for-boundary-break/7362)

<div class="topic-metadata">

**Author:** [@bishabosha](https://contributors.scala-lang.org/u/bishabosha)\
**Replies:** 3\
**Last updated:** [January 30, 2026, 10:13am UTC](https://contributors.scala-lang.org/t/slc-conversions-for-boundary-break/7362 "2026-01-30T10:13:28Z")

</div>

I’m thinking it can be useful to be able to adapt Label style apis to other error handling techniques, e.g. inline def asEither\[T, E\](inline op: Label\[E\] ?=\> T): Either\[E, T\] = boundary\[Either\[E, T\]\]: lblOk ?=\> va…

---

## [SLC: Optional traits to simplify creation of extractor objects](https://contributors.scala-lang.org/t/slc-optional-traits-to-simplify-creation-of-extractor-objects/7343)

<div class="topic-metadata">

**Author:** [@Sporarum](https://contributors.scala-lang.org/u/Sporarum)\
**Replies:** 4\
**Last updated:** [January 17, 2026, 11:53am UTC](https://contributors.scala-lang.org/t/slc-optional-traits-to-simplify-creation-of-extractor-objects/7343 "2026-01-17T11:53:37Z")

</div>

This is an SLC Sketch implementation: trait Extractor\[-In, +Out\]: def unapply(scrutinee: In): Option\[Out\] trait ExtractorSeq\[-In, +Out\]: def unapplySeq(scrutinee: In): Option\[Seq\[Out\]\] The idea is to allow simple…

---

## [IterableOnce vs Iterator binary compatibility](https://contributors.scala-lang.org/t/iterableonce-vs-iterator-binary-compatibility/7297)

<div class="topic-metadata">

**Author:** [@noresttherein](https://contributors.scala-lang.org/u/noresttherein)\
**Replies:** 4\
**Last updated:** [December 8, 2025, 8:10am UTC](https://contributors.scala-lang.org/t/iterableonce-vs-iterator-binary-compatibility/7297 "2025-12-08T08:10:56Z")

</div>

Hi. IterableOnce was kept purposely minimal so that external libraries may easily be interoperable with the standard collection library, but do not depend on its APIs. For some time, I assumed that it also meant that it…

[Next page](https://contributors.scala-lang.org/c/stdlib/8.md?page=1)
