fused-effects v1.1 Release Notes
-
➕ Adds a church-encoded
State
carrier inControl.Carrier.State.Church
. (#363)➕ Adds a church-encoded
Error
carrier inControl.Carrier.Error.Church
. (#203)➕ Adds a church-encoded
Empty
carrier inControl.Carrier.Empty.Church
. (#203)➕ Adds a church-encoded
Writer
carrier inControl.Carrier.Writer.Church
. (#369)➕ Adds a church-encoded
Fresh
carrier inControl.Carrier.Fresh.Church
. (#373)Defines
Algebra
instances forControl.Monad.Trans.Maybe.MaybeT
,Control.Monad.Trans.RWS.CPS
, andControl.Monad.Trans.Writer.CPS
. (#366)➕ Adds
evalEmpty
andexecEmpty
handlers for theEmpty
carriers as conveniences for usingempty
to signal early returns. (#371)
Backwards-incompatible changes
🔄 Changes
alg
’s signature, giving it an initial state, and a distributive law which must be applied to each computation in the signature. This change allowsAlgebra
instances to be derived usingGeneralizedNewtypeDeriving
andDerivingVia
, while also obviating the need forhmap
,handleCoercible
, or thethread
method ofEffect
. This furthermore increases the expressiveness of effects, allowing effects with higher-order positions yielding concrete types, e.g.m ()
, to be run anywhere in the stack, not just above anyEffect
-requiring algebras. (#359, #361)🔄 Changes the signatures of
runInterpret
andrunInterpretState
analogously; also reorders the parameters torunInterpretState
to take the signature before the state parameter. (#359)✂ Removes
Algebra
’s superclass constraint requiring aHFunctor
instance for the signature. (#359)✂ Removes
handleCoercible
. Algebras which formerly used it when handling the tail of the signature may now composecoerce
onto the homomorphism passed toalg
. (#359)✂ Removes
HFunctor
. Effects are no longer required to haveHFunctor
instances, and so the class is redundant. (#359)Removes
Effect
. The new signature foralg
(see above) obviates the need for threading handlers through effects, replacing that by threading them through algebras instead. (#361)Redefines
thread
as a wrapper aroundalg
, composing context functors and distributive laws together. (Note that its type has also changed to take the context last and to decompose the handler for the two carriers.) (#361)📇 Renames
Control.Effect.Interpret.Handler
toInterpreter
. (#361)Reorders the parameters to the higher-order function passed to
Control.Effect.Lift.liftWith
for consistency withalg
and to reflect its purpose of lifting Kleisli arrows in some underlying monad into the context modulo the context’s state. (#361)Redefines all effects as GADTs. Since we no longer require
Functor
,HFunctor
, orEffect
instances, we no longer need to use continuations to allow distinct result types per constructor.Algebra
instances for these effects can be ported forwards by removing the continuations. User-defined effects are not impacted, but we recommend migrating to GADT definitions of them for convenience and ease of comprehension going forwards. (#365)✂ Removes
Control.Carrier.State.Lazy.runStateC
, which was supposed to have been removed in 1.0.