Created
December 17, 2020 09:05
-
-
Save Yotamho/37c54177abab011d13e8f38f39a619aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| object ParallelNested { | |
| // Taking inspiration from `cats.IO`'s `Parallel` instance: | |
| // https://github.com/typelevel/cats-effect/blob/a6ebc9fd7f02dc15a74c0e9a1cfca3c843b63efb/core/shared/src/main/scala/cats/effect/IO.scala#L970-L988 | |
| implicit val nestedParallel = new NonEmptyParallel[Nested[IO, ValidatedNec[Throwable, *], *]] { | |
| override type F = Nested[IO.Par, ValidatedNec[Throwable, *], *] | |
| override def apply: Apply[F] = Apply[F] | |
| override def flatMap: FlatMap[Nested[IO, ValidatedNec[Throwable, *], *]] = FlatMap[Nested[IO, ValidatedNec[Throwable, *], *]] | |
| override def sequential: ~>[F, Nested[IO, ValidatedNec[Throwable, *], *]] = ??? | |
| override def parallel: ~>[Nested[IO, ValidatedNec[Throwable, *], *], F] = ??? | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment