Skip to content

The behavior of stream seems somewhat odd; perhaps it shouldn't be Operation<X> #978

Answered by cowboyd
iplaylf2 asked this question in Q&A
Discussion options

You must be logged in to vote

@iplaylf2 I think I see where you're coming from. There definitely are some differences between the Async/Await primitives and their Effection analogues, and that they can seem confusing and/or unnecessary when you are new to Effection. However, it is precisely in these differences that you will find the key to the guarantees that Effection provides you that Async/Await does not. Specifically:

It is impossible in Effection to create any effect whatsoever that is not bound to a scope.

This may seem restrictive at first, but it is actually a superpower.

Take for example the delay function you defined:

const delay = (x: number) => new Promise(r => setTimeout(r, x));

This eagerly creates the …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@iplaylf2
Comment options

@cowboyd
Comment options

Answer selected by iplaylf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #976 on February 27, 2025 14:15.