Skip to content

Commit

Permalink
Add 'Mode#locally' (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
arainko authored May 27, 2024
2 parents 180198e + a0b58d2 commit b889101
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ducktape/src/main/scala/io/github/arainko/ducktape/Mode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ sealed trait Mode[F[+x]] {
}

object Mode {
extension [F[+x], M <: Mode[F]](self: M) {
inline def locally[A](inline f: M ?=> A): A = f(using self)
}

trait Accumulating[F[+x]] extends Mode[F] {
def product[A, B](fa: F[A], fb: F[B]): F[(A, B)]
}
Expand Down

0 comments on commit b889101

Please sign in to comment.