Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Pattern match optimization. #43

Open
sir-wabbit opened this issue Aug 13, 2018 · 0 comments
Open

Pattern match optimization. #43

sir-wabbit opened this issue Aug 13, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers optimization Code optimization opportunity.

Comments

@sir-wabbit
Copy link
Contributor

In scalaz/scalaz#1958 @fommil uses this optimization:

fa match {
  case Right(b) => f(b)
  case Left(a) => Left(a)
}
fa match {
  case Right(b) => f(b)
  case a => a.asInstanceOf[Either[L, B]]
}

perhaps we could detect this particular case and optimize it automatically.

@sir-wabbit sir-wabbit added enhancement New feature or request good first issue Good for newcomers optimization Code optimization opportunity. labels Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers optimization Code optimization opportunity.
Projects
None yet
Development

No branches or pull requests

1 participant