Skip to content

Commit

Permalink
Merge pull request #49 from lenguyenthanh/add-transform-to-samruntime
Browse files Browse the repository at this point in the history
Add transform for SameRunTime trait
  • Loading branch information
ornicar authored Aug 4, 2024
2 parents 4737be4 + 2324e14 commit 4075fe6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/scala/newtypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ object newtypes:
trait SameRuntime[A, T]:
def apply(a: A): T

extension (a: A) def transform: T = apply(a)

object SameRuntime:
def apply[A, T](f: A => T): SameRuntime[A, T] = new:
def apply(a: A): T = f(a)
Expand Down

0 comments on commit 4075fe6

Please sign in to comment.