You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your smart and interesting implementation, which uses context abstraction, Project Loom's coroutines and no CPS transformation.
However, there is a point which concerns me.
Some type of monads, such as list monad, does not work well, since a coroutine can simulate only an "affine" delimited continuation, which can be used at most once.
An example using Scalaz follows:
vallist:List[Int] = reify [List] in {
vall=List(1, 2, 3).flatMap(x =>List(x +5)).reflect
valk=List(2, 3, 4).reflect
l * k
}
println(list)
[error] (run-main-0) java.lang.IllegalStateException: Continuation terminated
[error] java.lang.IllegalStateException: Continuation terminated
[error] at java.base/java.lang.Continuation.run(Continuation.java:286)
[error] at monadic.Coroutine.resume(Coroutine.scala:19)
[error] at monadic.Monadic.step$1(Monadic.scala:49)
[error] at monadic.Monadic.run$2$$anonfun$1(Monadic.scala:61)
[error] at monadic.ScalazMonadic.sequence$$anonfun$2$$anonfun$1(examples.scala:14)
...
Would you write this limitation in README?
Thank you.
The text was updated successfully, but these errors were encountered:
Thank you for your smart and interesting implementation, which uses context abstraction, Project Loom's coroutines and no CPS transformation.
However, there is a point which concerns me.
Some type of monads, such as list monad, does not work well, since a coroutine can simulate only an "affine" delimited continuation, which can be used at most once.
An example using Scalaz follows:
Would you write this limitation in README?
Thank you.
The text was updated successfully, but these errors were encountered: