Managing Asynchronous Side Effects in PureScript with Aff
Learn how to safely manage asynchronous side effects in PureScript using the Aff monad, with concrete examples, verification steps, and recovery strategies.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to safely manage asynchronous side effects in PureScript using the Aff monad, with concrete examples, verification steps, and recovery strategies.
A decision guide for PureScript developers: use Effect for immediate synchronous side‑effects and Aff for cancellable asynchronous work. Includes constraints, a comparison table, trade‑offs, and a runnable code example with build steps.
A decision guide for choosing PureScript's Aff monad versus Effect monad for asynchronous programming, with a comparison table, trade‑off explanation, and concrete code examples.
The goal is to wire PureScript’s Aff cancellation model with the browser’s AbortController so that an Aff that performs an asynchronous fetch can be aborted cleanly by a JavaScript signal, and vice‑versa. This requires that cancellation of a parent Aff propagates to all nested child Aff computations, that timers used for timeouts are cleaned up promptly, and
Goal We want to ensure that a rollback routine executed via Aff.bracket or Aff.try runs even if the Aff is cancelled before completion, such as during a schema migration that aborts due to a conflict. Current Observation When an Aff is cancelled using Async.cancelUnless , the release action supplied to bracket may not execute, leaving the database in an inco
When using PureScript's Aff monad, a timeout implemented with Aff.timeout cancels the underlying fiber and runs its finalizers before returning a Left (Error \"Timeout\") result. The goal is to understand whether this cancellation behaves as an immediate asynchronous interrupt that can skip synchronous, effect‑free sections, or as a synchronous operation tha