-
Notifications
You must be signed in to change notification settings - Fork 559
Closed
Description
Cats-effect uses suspend
to describe the action of capturing an effect. I believe that suspend
is generally understood to mean something else: suspending a computation, that is, to return the control immediately.
Here are a few occurrences that I found:
- kotlin coroutines: https://kotlinlang.org/docs/reference/coroutines.html
- haskell coroutines: https://hackage.haskell.org/package/monad-coroutine-0.9.0.4/docs/Control-Monad-Coroutine.html
- Async SIP: http://docs.scala-lang.org/sips/pending/async.html
In addition, there exists a synonymous to suspend, capture
as seen in #78
In my opinion, capture
does a better job at describing what IO
does as suspend
suggests that "unsuspension" (i.e evaluating your effect) isn't repeatable. This is of course highly debatable.
Furthermore, the use of suspend
for side-effects makes it unavailable for other uses, such as a "semantically blocking" operation: typelevel/fs2#1097 (comment)
costa100
Metadata
Metadata
Assignees
Labels
No labels