Automatic colouring of effect monads. #43
Replies: 2 comments 5 replies
-
Hi, when I look at the Attempt 0 for "auto-coloring", it seems to me like the best solution to build on top of, the others seem to me like too magical. What is the problem with "Attempt 0" is how heavy-weight the val c = async[PureEffect] {
val logger = ! PEToyLogger.make()
val counter = ! PEIntRef.make(-1)
while {
val v = ! counter.increment()
! logger.log(v.toString)
if (v % 3 == 0) then
! logger.log("Fizz")
if (v % 5 == 0) then
! logger.log("Buzz")
v < 10
} do ()
! logger.all()
} What do you think? Btw, it kinda resembles F#'s computation expressions. We could also use |
Beta Was this translation helpful? Give feedback.
-
Automatic coloring was a maximum that was possible to achieve without the changes in the compiler. |
Beta Was this translation helpful? Give feedback.
-
blogged about the history there https://github.com/rssh/notes/blob/master/2021_06_27_automatic-coloring-for-effects.md
current rules [0.9.0-snaphot]:
Beta Was this translation helpful? Give feedback.
All reactions