typelevel / typelevel/cats

Difference in the Applicative inferred for Seq[Seq[?]]#sequence between Scala 2 and 3

Open
#4,545 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

Minimized:

import cats.syntax.all._

Seq(Seq()).sequence

Infers Seq[Seq[ in Scala 2, but Int => Seq[ in Scala 3.

Original use case, encountered in #scala-users:

import cats.syntax.all._

for {
  x <- Seq(0, 1, 2).permutations
  y <- Seq(Seq(-1, 1), Seq(-1, 1), Seq(-1, 1)).sequence
} yield (x, y)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the minimized Seq(Seq()).sequence example with cats.syntax.all._ under Scala 2 and Scala 3, then compare the inferred types. Trace the sequence syntax and Applicative/type inference behavior involved in the difference. Done means the discrepancy and the original permutations example have an agreed, verified outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.