typelevel-scalafix icon indicating copy to clipboard operation
typelevel-scalafix copied to clipboard

Lint/fix for when `traverse` can be `traverse_` ?

Open armanbilge opened this issue 3 years ago • 1 comments

Inspired by https://github.com/typelevel/otel4s/pull/14#discussion_r898650055. This seems hard and I'm not sure if it's actually possible without making some (arguably reasonable) assumptions like nobody wants a List[Unit] :)

armanbilge avatar Jun 16 '22 06:06 armanbilge

Maybe a low-effort version would be to detect:

  • _ <- foo.traverse(f)
  • foo.traverse(f).void
  • foo.traverse(f).as(b)
  • foo.traverse.map(_ => anything)

Daenyth avatar Jul 24 '23 18:07 Daenyth