fused-effects v0.3.0.0 Release Notes

Release Date: 2019-03-28 // about 5 years ago
  • Backwards-incompatible changes

    • βž• Adds Monad as a superclass of Carrier, obviating the need for a lot of constraints, and Monad instances for all carrier types. This is a backwards-incompatible change, as any carriers users have defined now require Monad instances. Note that in many cases carriers can be composed out of existing carriers and monad transformers, and thus these instances can often be derived using -XGeneralizedNewtypeDeriving. We also recommend compiling with -Wredundant-constraints as many of these can now be removed.
    • Replaces AltC with a new carrier, NonDetC, based on Ralf Hinze’s work in Deriving Backtracking Monad Transformers. This is a backwards-incompatible change. AltC was equivalent to the ListT monad transformer, and had the same well-known limitation to commutative monads. Therefore, the elimination of Eff required a more durable approach.
    • βœ‚ Removes Branch. This is a backwards-incompatible change, but was necessitated by the difficulty of implementing correct Applicative & Monad instances for carriers which used it. Carriers which were employing Branch internally should be reimplemented using NonDetC or a similar approach; see CutC and CullC for examples.
    • πŸ“‡ Renames Control.Effect.Void, Void, and VoidC to Control.Effect.Pure, Pure, and PureC respectively. This is a backwards-incompatible change for code mentioning VoidC; it should be updated to reference PureC instead.

    πŸ—„ Deprecations

    • πŸ‘€ Eff and interpret, in favour of computing directly in the carriers. This enables the compiler to perform significant optimizations; see the benchmarks for details. Handlers can simply remove the Eff wrapping the carrier type & any use of interpret. As above, we also recommend compiling with -Wredundant-constraints as many of these can now be removed.
    • ret, in favor of pure or return.
    • handleEither, handleReader, handleState, handleSum, and handleTraversable in favour of composing carrier types directly. Carriers can be composed from other carriers and eff defined with handleCoercible; and other definitions can use handlePure & handle directly.

    πŸš€ All deprecated APIs will be removed in the next release.

    Other changes

    • βž• Adds a lazy State carrier in Control.Effect.State.Lazy
    • Rewrites CutC using an approach related to NonDetC, with the addition of a continuation to distinguish empty from cutfail.
    • Rewrites CullC using ListC and ReaderC.
    • 🚚 Moves OnceC from Control.Effect.NonDet to Control.Effect.Cull to avoid cyclic dependencies.
    • βž• Adds a runCutAll handler for Cut effects, returning a collection of all results.