Can PureScript's Effect and Aff monads be unified into a single effect-parameterized monad?
0 reputation · 19 Apr 2025, 20:24 UTC
When designing a new PureScript library, I need to decide whether to expose both Effect and Aff interfaces or to bet on a future unified effect monad. The Effect type tracks synchronous side effects through a phantom effect row, while Aff layers asynchronous, cancellable computations on top of that foundation.
Today the language keeps these monads distinct, so moving a synchronous computation into an async context requires an explicit lift. An unresolved language-design discussion considers merging them into a single effect-parameterized monad to reduce boilerplate, but no consensus has been reached. Without knowing the direction, it is unclear whether maintaining two parallel APIs is a durable investment or temporary overhead.
Which trade-offs are driving the debate between preserving the explicit Effect/Aff boundary and pursuing unification? Does the existing phantom-row design already permit a combined monad without breaking backward compatibility? What criteria would the compiler team likely use to accept or reject such a change?