-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Labels
type: bugSomething that should function correctly isn't.Something that should function correctly isn't.
Description
I found this while working on a test for cancelling forkAll
.
delay :: forall eff. Int -> Aff eff Unit
delay n = callCC \cont ->
later' n (cont unit)
fork :: forall eff. Aff (console :: CONSOLE | eff) Unit
fork = do
a <- forkAff (later' 10000 (Console.log "oops"))
cancel a (error "bye")
Console.log "Canceled a"
b <- forkAff (do delay 10000
Console.log "oops")
cancel b (error "bye")
Console.log "Canceled b"
I would assume that the two formulations would be identical, but the callCC
version does not cancel correctly. The first variation (using later'
directly) gets cancelled correctly and prints "Canceled a". While the callCC
variation waits 10 seconds, then get's cancelled, but does not print anything.
Metadata
Metadata
Assignees
Labels
type: bugSomething that should function correctly isn't.Something that should function correctly isn't.