Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
423 B

3 years ago
3 years ago
3 years ago
  1. package wow.doge.mygame.utils
  2. import monix.bio.IO
  3. import monix.bio.Task
  4. import monix.eval.Coeval
  5. object IOUtils {
  6. def toTask[T](bio: IO[Throwable, T]) =
  7. monix.eval.Task.deferAction(implicit s => bio.to[monix.eval.Task])
  8. def toIO[T](task: monix.eval.Task[T]) =
  9. IO.deferAction(implicit s => IO.from(task))
  10. def fromCoevalEither[L, R](coeval: Coeval[Either[L, R]]) =
  11. coeval.to[Task].hideErrors.rethrow
  12. }