fused-effects v1.1 Release Notes
-
➕ Adds a church-encoded
Statecarrier inControl.Carrier.State.Church. (#363)➕ Adds a church-encoded
Errorcarrier inControl.Carrier.Error.Church. (#203)➕ Adds a church-encoded
Emptycarrier inControl.Carrier.Empty.Church. (#203)➕ Adds a church-encoded
Writercarrier inControl.Carrier.Writer.Church. (#369)➕ Adds a church-encoded
Freshcarrier inControl.Carrier.Fresh.Church. (#373)Defines
Algebrainstances forControl.Monad.Trans.Maybe.MaybeT,Control.Monad.Trans.RWS.CPS, andControl.Monad.Trans.Writer.CPS. (#366)➕ Adds
evalEmptyandexecEmptyhandlers for theEmptycarriers as conveniences for usingemptyto 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 allowsAlgebrainstances to be derived usingGeneralizedNewtypeDerivingandDerivingVia, while also obviating the need forhmap,handleCoercible, or thethreadmethod 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
runInterpretandrunInterpretStateanalogously; also reorders the parameters torunInterpretStateto take the signature before the state parameter. (#359)✂ Removes
Algebra’s superclass constraint requiring aHFunctorinstance for the signature. (#359)✂ Removes
handleCoercible. Algebras which formerly used it when handling the tail of the signature may now composecoerceonto the homomorphism passed toalg. (#359)✂ Removes
HFunctor. Effects are no longer required to haveHFunctorinstances, 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
threadas 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.HandlertoInterpreter. (#361)Reorders the parameters to the higher-order function passed to
Control.Effect.Lift.liftWithfor consistency withalgand 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, orEffectinstances, we no longer need to use continuations to allow distinct result types per constructor.Algebrainstances 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.