λ v4.0.0 Release Notes

Release Date: 2019-05-21 // 4 months ago
  • 🔄 Changed

    • Breaking Change: IO is now sealed and moved to its own package. Most previous constructions using the static factory methods should continue to work (by simply targeting Supplier now instead of an anonymous IO), but some might need to be reworked, and subtyping is obviously no longer supported.
    • Breaking Change: Breaking all dependency on java.util.function types across the board. All Fn* types target methods now support throwing Throwable; apply is now defaulted and will simply bypass javac to throw checked exceptions as if they were unchecked. All Checked variants have been eliminated as a consequence, as they are no longer necessary. Also, straggler functions like Partial2/3 that only existed to aid in partial application of non-curried functions are now superfluous, and have also been eliminated.
    • Breaking Change: FoldRight now requires Lazy as part of its interface to support short-circuiting operations
    • Breaking Change: Eliminated all raw types and java11 warnings. This required using capture in unification parameters for Functor and friends, so nearly every functor's type-signature changed.
    • Breaking Change: Strong is now called Cartesian to better reflect the type of strength
    • Breaking Change: new Optic type hierarchy more faithfully encodes profunctor constraints on optics, new Optic type is now the supertype of Lens and Iso, and lens package has been moved to optics
    • Breaking Change: Try and Either no longer preserve Throwable type since it was inherently not type-safe anyway; Try is therefore no longer a Bifunctor, and orThrow can be used to declare checked exceptions that could be caught by corresponding catch blocks
    • IO is now stack-safe, regardless of whether the composition nests linearly or recursively

    ➕ Added

    • 👍 Lazy, a monad supporting stack-safe lazy evaluation
    • LazyRec, a function for writing stack-safe recursive algorithms embedded in Lazy
    • Applicative#lazyZip, for zipping two applicatives in a way that might not require evaluation of one applicative
    • MonadT, a general interface representing monad transformers
    • MaybeT, a monad transformer for Maybe
    • EitherT, a monad transformer for Either
    • IdentityT, a monad transformer for Identity
    • LazyT, a monad transformer for Lazy
    • Endo, a monoid formed by Fn1 under composition
    • State, the state Monad
    • 👍 Downcast, a function supporting unchecked down-casting
    • Cocartesian, profunctorial strength in cocartesian coproduct terms
    • Prism, an Optic that is nearly an Iso but can fail in one direction
    • 👍 Market, Tagged, profunctors supporting optics
    • Re for viewing an Optic in one direction reliably
    • Pre for viewing at most one value from an Optic in one direction
    • SideEffect, for representing side-effects runnable by IO
    • IO#safe, mapping an IO<A> to an IO<Either<Throwable, A>> that will never throw
    • IO#ensuring, like finally semantics for IOs
    • IO#throwing, for producing an IO<A> that will throw a given Throwable when executed
    • Bracket, for bracketing an IO operation with a mapping operation and a cleanup operation