-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1262 from Roman-Statsura/streams-scala3
Add support Scala 3 for modules streams and fs2CE3Interop
- Loading branch information
Showing
32 changed files
with
105 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
modules/interop/fs2/ce3/src/main/scala-2/tofu/fs2Syntax/pre.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
modules/interop/fs2/ce3/src/main/scala/tofu/fs2Syntax/pre.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package tofu.fs2Syntax | ||
|
||
import cats.tagless.ApplyK | ||
import cats.data.Tuple2K | ||
import fs2.Stream | ||
import tofu.higherKind.Pre.T | ||
import tofu.syntax.funk.funK | ||
|
||
object pre { | ||
implicit final class TofuPreStreamSyntax[F[_], U[f[_]]](private val self: U[T[F, _]]) extends AnyVal { | ||
def attachStream(alg: U[Stream[F, _]])(implicit U: ApplyK[U]): U[Stream[F, _]] = | ||
U.map2K(self, alg)( | ||
funK[Tuple2K[T[F, _], Stream[F, _], _], Stream[F, _]](t2k => Stream.exec(t2k.first.value) ++ t2k.second) | ||
) | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
modules/interop/fs2/ce3/src/test/scala-2/tofu/fs2Instances/Fs2InstancesSuite.scala
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
modules/interop/fs2/ce3/src/test/scala/tofu/fs2Instances/Fs2InstancesSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package tofu.fs2Instances | ||
|
||
import cats.tagless.FunctorK | ||
import fs2._ | ||
import tofu._ | ||
import tofu.higherKind.Embed | ||
|
||
import scala.annotation.nowarn | ||
|
||
object Fs2InstancesSuite { | ||
|
||
def summonFs2HKInstances[A](): Unit = { | ||
@nowarn val x = implicitly[FunctorK[({ type L[x[_]] = Stream[x, A] })#L]] | ||
@nowarn val y = implicitly[Embed[({ type L[x[_]] = Stream[x, A] })#L]] | ||
() | ||
} | ||
|
||
def summonFs2ContextInstances[R, F[_]: ({ type L[x[_]] = WithContext[x, R] })#L](): Unit = { | ||
implicitly[WithContext[Stream[F, *], R]] | ||
() | ||
} | ||
|
||
def summonFs2LocalInstances[R, F[_]: ({ type L[x[_]] = WithLocal[x, R] })#L](): Unit = { | ||
implicitly[WithLocal[Stream[F, *], R]] | ||
() | ||
} | ||
|
||
def summonFs2ProvideInstances[R, G[_], F[_]: ({ type L[x[_]] = WithProvide[x, G, R] })#L](): Unit = { | ||
implicitly[WithProvide[Stream[F, _], Stream[G, _], R]] | ||
() | ||
} | ||
|
||
def summonFs2RunInstances[R, G[_], F[_]: ({ type L[x[_]] = WithRun[x, G, R] })#L](): Unit = { | ||
implicitly[WithRun[Stream[F, _], Stream[G, _], R]] | ||
() | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
modules/streams/src/main/scala-3/tofu/streams/internal/internal.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tofu.streams | ||
|
||
package object internal { | ||
private[tofu] type Factory[-A, +C] = scala.collection.Factory[A, C] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters