All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
IterateT#unfoldnow only computes a singlePurefor the given inputReaderT#fmapandStateT#fmapavoid unnecessary calls topureMaybeTimplementsMonadErrorTuple2-8#init, for populating aTupleNwith all but the last element
$, function application represented as a higher-orderFn2Fn1#withSelf, a static method for constructing a self-referencingFn1HNil/SingletonHList/TupleX#snoc, a method to add a new last element (append to a tuple)
IterateT#trampolineMnow yields and stages all recursive result values, rather than prematurely terminating on the first termination resultIterateT#flatMapis now stack-safe regardless of how many consecutive emptyIterateTs are returned and regardless of whether the monad is strict or lazy or internally trampolined
5.2.0 - 2020-02-12
HList#consstatic factory method auto-promotes to specializedHListif there is oneEitherTgains aMonadErrorinstance
MergeHMaps, aMonoidthat mergesHMaps by merging the values via key-specifiedSemigroupsId#idoverload that accepts an argument and returns itMaybeT#or, choose the firstMaybeTthat represents an effect aroundjusta valueMaybeT#filter, filter aMaybeinside an effectStateMatcher, StateTMatcher, WriterTMatcherReaderT#and, category composition betweenReaderTinstances:(a -> m b) -> (b -> m c) -> (a -> m c)IterateT,ListTdone rightComparison, a type-safe sum ofLT,EQ, andGTorderingsCompare, a function taking aComparatorand returning aComparisonMin/Max/...Withvariants for inequality testing with aComparator
5.1.0 - 2019-10-13
- All monad transformers that can support composable parallelism do support it
Writer, the writer monadEndoK, a monoid formed under endomorphism for any monadAutoBracket, a specialized form ofBracketforAutoCloseablethat closes the resource during cleanup
SafeT#zipis now stack-safe regardless of the underlying monad'szipimplementation
Force, in favor if traversing into anIOand explicitly running it
5.0.0 - 2019-09-23
- Breaking Change:
MonadTis now witnessed by a parameter for better subtyping, and no longer requires a commonruninterface; eachrunmethod is nowrunXXXT(), whereXXXis the name of the transformer in question - Breaking Change:
Applicative#zipand derivatives evaluate from left to right now across the board. - Breaking Change:
testsupport.EquatableMreplaced withEquivalence Alternow merely requires anFn1instead of an explicitEffectIOnow internally trampolines all forms of composition, includinglazyZip; sequencing very large iterables ofIOwill work, if you have the heap, and retain parallelization inflection points
MonadRec, monads that support a stack-safetrampolineMmethod with defaults for all exported monadsMonadError, monads that can be thrown to and caught from, with defaults forIO,Either,Maybe, andTryMonadBase, an interface representing lifting infrastructure forMonadsMonadReaderandMonadWriter, general interfaces for reading from an environment and accumulating resultsSafeT, a stack-safe monad transformer for anyMonadRecReaderT, the transformer for the reader monadWriterT, a monad transformer for an accumulation and a valueStateT, theStatemonad transformerLift, an existentially-quantified lifting function for someMonadBasetypeIO#interruptible, for wrapping anIOin a thread interruption checkIO#monitorSync, for wrapping anIOin asynchronizedblock on a given lock objectIO#pin, for pinning anIOto anExecutorwithout yet executing itIO#fuse, for fusing the fork opportunities of a givenIOinto a single linearizedIOIO#memoize, for memoizing anIOby caching its first successful resultUntil, for repeatedly executing anIOuntil its result matches a predicateOptic#andThen,Optic#compose, and other defaults addedPrism#andThen,Prism#composebegets anotherPrismPrism#fromPartialpublic interfacesTuple2-8#fromIterable, for populating aTupleNwith the firstNelements of anIterableFn2#curry, for converting anFn1<Tuple2<A,B>,C>to anFn2<A,B,C>EquivalenceTrait, a traitorTraitto make it easier to test properties of type-classes with a separate equivalence relation
Peek,Peek2,Maybe#peek, andEither#peekin favor of explicitly matching intoIOand running itIO#exceptionallyin favor ofIO#catchError(fromMonadError)
4.0.0 - 2019-05-20
- Breaking Change:
IOis now sealed and moved to its own package. Most previous constructions using the static factory methods should continue to work (by simply targetingSuppliernow instead of an anonymousIO), but some might need to be reworked, and subtyping is obviously no longer supported. - Breaking Change: Breaking all dependency on
java.util.functiontypes across the board. AllFn*types target methods now support throwingThrowable;applyis now defaulted and will simply bypass javac to throw checked exceptions as if they were unchecked. AllCheckedvariants have been eliminated as a consequence, as they are no longer necessary. Also, straggler functions likePartial2/3that only existed to aid in partial application of non-curried functions are now superfluous, and have also been eliminated. - Breaking Change:
FoldRightnow requiresLazyas 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:
Strongis now calledCartesianto better reflect the type of strength - Breaking Change: new Optic type hierarchy more faithfully encodes profunctor constraints on optics, new
Optictype is now the supertype ofLensandIso, andlenspackage has been moved tooptics - Breaking Change:
TryandEitherno longer preserveThrowabletype since it was inherently not type-safe anyway; Try is therefore no longer aBifunctor, andorThrowcan be used to declare checked exceptions that could be caught by corresponding catch blocks IOis now stack-safe, regardless of whether the composition nests linearly or recursively
Lazy, a monad supporting stack-safe lazy evaluationLazyRec, a function for writing stack-safe recursive algorithms embedded inLazyApplicative#lazyZip, for zipping two applicatives in a way that might not require evaluation of one applicativeMonadT, a general interface representing monad transformersMaybeT, a monad transformer forMaybeEitherT, a monad transformer forEitherIdentityT, a monad transformer forIdentityLazyT, a monad transformer forLazyEndo, a monoid formed byFn1under compositionState, the stateMonadDowncast, a function supporting unchecked down-castingCocartesian, profunctorial strength in cocartesian coproduct termsPrism, anOpticthat is nearly anIsobut can fail in one directionMarket,Tagged, profunctors supporting opticsRefor viewing anOpticin one direction reliablyPrefor viewing at most one value from anOpticin one directionSideEffect, for representing side-effects runnable byIOIO#safe, mapping anIO<A>to anIO<Either<Throwable, A>>that will never throwIO#ensuring, likefinallysemantics forIOsIO#throwing, for producing anIO<A>that will throw a givenThrowablewhen executedBracket, for bracketing anIOoperation with a mapping operation and a cleanup operation
3.3.0 - 2019-02-18
MergeMaps, aMonoidonMapformed byMap#mergeCheckedEffectis now aCheckedFn1CheckedSupplieris now aCheckedFn1CheckedFn1now overrides all possible methods with covariant return typeMapLens#asCopyhas overload taking copy functionMapLens#valueAthas overload taking copy functionSortWithfor sorting anIterablegiven aComparatorover its elementsIO#externallyManaged, for supplying anIOwith externally-managed futures- test jar is now published
Monad#joinstatic alias forflatMap(id())Effect#effectstatic factory method takingFn1IO#unsafePerformAsyncIOoverloads for runningIOs asynchronouslyIOs automatically encode parallelism in compositionIO#exceptionallyfor recovering from failure duringIOoperationOptic, a generic supertype for all profunctor optics
- issue where certain ways to compose
Effects unintentionally nullified the effect
AddAllsemigroup, deprecated in previous release- Dyadic
Either#flatMap(), deprecated in previous release
3.2.0 - 2018-12-08
- Breaking Change:
DifferenceandIntersectionno longer instances ofSemigroupand moved tofunctions.builtin.fn2package - Breaking Change:
Absentmoved tosemigroup.builtinpackage - Breaking Change:
Effect#accept()is now the required method to implement in the functional interface - Breaking Change:
Fn0#apply()is now the required method to implement in the functional interface - Breaking Change:
GTBy,GT,LTBy,LT,GTEBy,GTE,LTEBy, andLTEtake the right-hand side first for more intuitive partial application - Breaking Change:
Effectnow returns anIO RightAnyoverload returnsMonoid- monoids now all fold with respect to
foldMap - monoid folding now implicitly starts with the identity, regardless of iterable population
Concatmonoid can now fold infinite iterables- all
Function<? super XXX, Boolean>are nowFunction<? super XXX, ? extends Boolean>for better compatibility Either#divergereturns aChoice3Maybeis now aCoProduct2ofUnitandAFn0now additionally implementsCallableCheckedRunnableis anIO<Unit>
Predicate#predicatestatic factory methodProduct2-8left/right rotation methodsTuple2-8specializations of left/right product rotationCheckedEffect, anEffectvariant that can throw checked exceptionsCheckedFn1#checked, convenience static factory method to aid inferenceLiftA3-8, higher-arity analogs toLiftA2Alter, for applying anEffectto an input and returning it, presumably alteredClamp, for clamping a value between two boundsBetween, for determining if a value is in a closed intervalStrong, profunctor strengthIOmonadRunAllsemigroup and monoid instance forIO<A>
AddAllsemigroup, in favor of the monoid that no longer mutates any argument- Dyadic
Either#flatMap(), in favor ofEither#match
3.1.0 - 2018-07-16
Fn3-8static factory overloads to aid in coercing lambdas- Adding composition guarantees to
LensLike CmpEqBy,CmpEq,GTBy,GT,LTBy,LT,GTEBy,GTE,LTEBy, andLTEinequality checksMinBy,MaxBy,Min, andMaxsemigroupsProduct2-8interfaces, representing general product typesUnion, a monoid that behaves like a lazy set union onIterablesDifference, a semigroup that behaves like a partially lazy set difference onIterablesLambdaMap, extension point forj.u.Map, similar toLambdaIterableSequence#sequenceoverloads forj.u.Mapthat traverse via intermediateLambdaMapinstancesIntersection, a semigroup that behaves like a lazy set intersection onIterablesFn0, a function fromUnitto some valueFn1#thunk, producing anFn0Absent, a monoid overMaybethat is absence biasedRateLimit, a function that iterates elements from anIterableaccording to some rate limitTry#withResources,Try's expression analog to Java 7's try-with-resources statementOccurrences, for counting the occurrences of the members of anIterableEffect, anFn0returningUNITNoop, a no-opEffectFn1#widen, add an ignored argument to the beginning of any function to raise its arity by one
Tuple2-8now implementProduct2-8Intonow acceptsMap.EntryInto3-8now accept a product of the same cardinality, instead of requiring a tupleCoProduct2-8#projectnow return generalized productsChoice2-8#projectreturn tuplesliftA2receives more parameters to aid inferenceCompose#getComposenow supports inference
MapLens#mappingValues, deprecated in a prior releaseCollectionLens#asSet, deprecated in a prior releaseCollectionLens#asStream, deprecated in a prior release
3.0.3 - 2018-05-27
Lens#toIso, for converting a lens to an isoHMap#hMapoverloads up to 8 bindings deepSchema, schemas for extracting multiple values fromHMaps by aggregatingTypeSafeKeys
- Deforested iterables execute in intended nesting order, where essential
3.0.2 - 2018-05-21
IterableLens#mapping, anIsothat maps values
TypeSafeKey.Simplenow has a default#applyimplementation
- mapped
TypeSafeKeyinstances can be used for initial put in anHMap, and the base key can be used to retrieve them - Merged pull request fixing issue storing values at mapped
TypeSafeKeyinsingletonHMap
3.0.1 - 2018-05-13
ToMapaccepts anIterablecovariant inMap.EntryRecursiveResult#invertis also aRecursiveResultFirst/And/Ormonoids all utilize short-circuitingMonoid#foldLeft/foldRightdelegate toMonoid#reduceLeft/reduceRight, respectively
Upcastfor safely casting up a type hierarchySetLens, lenses operating onSetsToArray, for convertingIterable<A>toA[]
3.0.0 - 2018-05-04
- Breaking Change:
Sequencenow has two more type parameters to aid in inference - Breaking Change:
Traversable#traversenow has three more type parameters to aid in inference - Breaking Change:
Monad#zipnow forcesm a -> bbeforem ain defaultApplicative#zipimplementation; this is only breaking for types that are sensitive to computation order (the resulting values are the same) - Breaking Change:
TypeSafeKeyis now dually parametric (single parameter analog is preserved inTypeSafeKey.Simple) Bifunctoris now aBoundedBifunctorwhere both parameter upper bounds areObjectPeek2now accepts the more generalBoundedBifunctorIdentity,Compose, andConstfunctors all have bettertoStringimplementationsInto3-8now supports functions with parameter varianceHListLens#tailis now covariant inTailparameter- More functions now automatically deforest nested calls (
concatcons,cycle,distinct,drop,dropwhile,filter,map,reverse,snoc,take,takewhile,tail) FlattencallsIterator#hasNextless aggressively, allowing for better lazinessLenssubtypesLensLikeView/Set/Overnow only requireLensLikeHMap#keysnow returns aSetHMap#valuesnow returns aCollectionUnfoldris now lazier, deferring all computations untilhasNext/nextcallsPresentis now a singleton
BoundedBifunctor, aBifunctorsuper type that offers upper bounds for both parametersTry, aMonadrepresenting an expression-like analog oftry/catch/finallyCheckedRunnable, theRunnablecounterpart toCheckedSupplierthat can throw checked exceptionsUnit, the lambda analog toVoid, except actually inhabited by a singleton instanceKleisli, the abstract representation of aKleisliarrow (Monad#flatMap) as anFn1These, aCoProduct3ofA,B, orTuple2<A,B>Span, for splitting anIterableinto contiguous elements matching a predicateMagnetizeByandMagnetize, for grouping elements by pairwise predicate testsBoth, for dually applying two functions and producing aTuple2of their resultsLens#both, for dually focusing with two lenses at onceIfThenElse, an expression form forifstatementsCheckedRunnableandCheckedSupplierconversion and convenience methodsLensLike, common capabilities that make a type usable as if it were aLensIso, isomorphisms between two types (invertible functions that are also lenses)Exchange, aProfunctorthat can extract the morphisms from anIsoHMapLens, lenses focusing onHMapMapLens#mappingValues(Iso), a lawful lens that maps the values of aj.u.MapUnder, the inverse ofOverforIsoTypeSafeKeyis anIsoand supports mappingTypeSafeKey.Simple, the single parameter version ofTypeSafeKeyEither#tryingoverloads that acceptCheckedRunnable
MapLens#mappingValues(Function)is now deprecated in favor of the overload that takes anIso
2.1.1 - 2018-01-16
- Breaking Change: Moved
TrampolineandRecursiveResultto better package
2.1.0 - 2018-01-14
- Breaking Change:
CollectionLens#asSetis now lawful and preserves new incoming values in the update set - Breaking Change:
IterableLens#headis now aLens.Simple<Iterable<A>, Maybe<A>>and is lawful - Breaking Change:
ListLens#elementAtis now aLens.Simple<List<X>, Maybe<X>>supporting defensive copies - Breaking Change:
MapLens#valueAtis now aLens.Simple<Map<K,V>, Maybe<V>>supporting defensive copies MapLens#keysnow uses defensive copies and does not alter the focused on mapMapLens#valuesnow uses defensive copies and does not alter the focused on mapMapLens#invertednow uses defensive copies and does not alter the focused on mapHListLens#headis now covariant in the tail of bothSandTPredicate#contraMapis now covariant in its return typeBiPredicate#contraMapandBiPredicate#diMapLare now both covariant in their return types
Fn3#fn3andFn4#fn4static factory methodsFn5throughFn8Tuple5#intoTuple6throughTuple8CoProduct6throughCoProduct8andChoice6throughChoice8CoProduct5#divergeandChoice5#divergeInto3throughInto8, for applying aTuple*to anFn*Times, for successively accumulating a result by iterating a function over a value some number of timesSlide, for "sliding" a window of some number of elements across anIterableEither#filteroverload supporting a function fromRtoLin the failing predicate caseCollectionLens#asSet(Function), a proper analog ofCollectionLens#asSet()that uses defensive copiesCollectionLens#asStream(Function), a proper analog ofCollectionLens#asStream()that uses defensive copies- Explicitly calling attention to all unlawful lenses in their documentation
PeekandPeek2, for "peeking" at the value contained inside any givenFunctororBifunctorwith given side-effectsTrampolineandRecursiveResultfor modeling primitive tail-recursive functions that can be trampolined
Either#toOptional, deprecated in previous releaseEither#fromOptional, deprecated in previous releasesequenceoverloads supportingOptional, deprecated in previous releaseOptionalLens, deprecated in previous releaseTraversableIterable, deprecated in previous releaseTraversables, deprecated in previous release
CollectionLens#asSet()in favor ofCollectionLens#asSet(Function)CollectionLens#asStream()in favor ofCollectionLens#asStream(Function)
2.0.0 - 2017-11-13
- Breaking Change:
java.util.Optionalreplaced withMaybeacross the board Profunctor#diMap/L/Rparameters allow varianceEither#toOptionalno longer allowsnullvalues in the right side, and is now in sync with CoProduct#projectBUnfoldrallows variance on input
CoProductN#embedno longer eagerly invokes functionsPrependAllnow only createsO(1)Iterables instead ofO(3n + 1)
Monadarrives. The followingApplicatives are now alsoMonad:LensConstTuple*Choice*IdentityEitherFn*LambdaIterableMaybeSingletonHList
Force, for forcing iteration of anIterableto perform any side-effectsSnoc, for lazily appending an element to the end of anIterableCoalesce, for folding anIterable<Either<L, R>>into anEither<Iterable<L>, Iterable<R>>And,Or, andXorall gainBiPredicate<Boolean, Boolean>propertiesLambdaIterable, an adapterIterablethat support lambda typesMaybe, lambda's analog ofjava.util.Optionalconforming to all the lambda typesContravariant, an interface representing functors that map contravariantly over their parametersProfunctorextendsContravariantTails, for iterating all the tail element subsequences of anIterableInits, for iterating all the initial element subsequences of anIterableInit, for iterating all but the last element of anIterableCatMaybes, for unwrapping the present values in anIterable<Maybe<A>>to produce anIterable<A>
Fn1#then(Function<? super B, ? extends C>), deprecated in previous releaseFn1#adapt(Function<A, B> function), deprecated in previous releaseFn2#adapt(BiFunction<A, B, C> biFunction), deprecated in previous release
Traversablesand all methods therein, in favor of eitherLambdaIterableorMaybeTraversableOptionalin favor ofMaybeTraversableIterablein favor ofLambdaIterableSequenceoverloads supportingOptionalin favor of convertingOptionaltoMaybeand then sequencingEither#toOptionalandEither#fromOptionalin favor of itsMaybecounterparts
1.6.3 - 2017-09-27
- Loosening variance on
Fn2#fn2andFn1#fn1
ConcatenatingIteratorbug where deeply nestedxsskip elements
Fn1#thenin favor ofFn1#andThen(redundant)Fn1#adaptin favor ofFn1#fn1(rename)Fn2#adaptin favor ofFn2#fn2(rename)
Fn1#andThenoverload to support composition withBifunctionFn1#composeoverload to support composition withBifunctionandFn2LiftA2to lift and apply aBifunctionto twoApplicativesFlattento lazily flatten nestedIterable<Iterable<A>>s toIterable<A>Replicate, short-hand composition oftakeandrepeatDistinctto produce anIterableof distinct values in anotherIterableSortandSortByfor eagerly, monolithically sortingIterables and producingListsIterableLens, general lenses overIterableXor, a monoid representing logical exclusive-or
1.6.2 - 2017-08-20
- Removing need for various suppressed unchecked warnings in
ChoiceNtypes HListabstract super type loses both unnecessary parameters
- ClassCastException
BiPredicate.flip
Uncons, for destructuring anIterableinto its head and tailComposesemigroup and monoid formed overCompletableFutureMonoidandSemigroupboth preserve type specificity throughflipcalls
1.6.1 - 2017-06-17
- Loosening visibility on
Traversablesmethods topublic
1.6.0 - 2017-06-04
Functor,Bifunctor, andProfunctor(as well as all instances) get a unification parameterIdentitysupports value equalityConstsupports value equalitypartitionnow only requires iterables ofCoProudct2CoProductNs receive a unification parameter, which trickles down toEitherandChoicesConcatnow represents a monoid forIterable; previousConcatsemigroup and monoid renamed to more appropriateAddAllLensis now an instance ofProfunctor
Either#invertis pulled up intoCoProduct2and additionally specialized forChoice2CoProductN#embednot, used for negating predicate functionsempty, used to test if an Iterable is emptygroupBy, for folding an Iterable into a Map given a key functionApplicativearrives; all functors gain applicative propertiesTraversablearrives;SingletonHList,Tuple*,Choice*,Either,Identity, andConstgain traversable propertiesTraversableOptionalandTraversableIterablefor adaptingOptionalandIterable, respectively, toTraversablesequencefor wrapping a traversable in an applicative during traversalCompose, an applicative functor that represents type-level functor composition
1.5.6 - 2017-02-11
CoProductN.[a-e]()static factory methods moved to equivalentChoiceNclass. Coproduct interfaces now solely represent methods, no longer have anonymous implementations, and no longer require aFunctorconstraint
ChoiceNtypes, representing concrete coproduct implementations that are alsoFunctorandBiFunctortoMap,last,cons,prependAll,intersperseTuple2/3/4#into, for applying the values in a tuple as positional arguments to a function.FirstandLastmonoids overOptionalAndandOrmonoids overBoolean
1.5.5 - 2016-12-17
- semigroups and monoids moved under
fn2package
CoProductN#project, to project disjoint union types into tuples ofOptionalvaluesCoProductN#converge, to drop the magnitude of a coproduct down by one typetoCollectionandsize
1.5.4 - 2016-11-27
Fn1/2#adaptto switch between lambda andjava.util.functiontypes more easilyeq,head,find, andtailBiPredicateMonoid#foldMapHMap#toMapto go from a heterogeneous map to ajava.util.Map
1.5.3 - 2016-11-06
SemigroupandMonoidEither#invertpartition- Generalized coproducts implemented as
CoProduct2throughCoProduct5 Eitheris now aCoProduct2
1.5.2 - 2016-09-24
Lensstatic factory method renaming
- Heterogeneous list indexes arrive via
Index
1.5.1 - 2016-08-30
- Independent
Lensparameter mapping viamapS,mapT,mapA, andmapB
1.5 - 2016-08-28
- Initial lens support with
LensandSimpleLenstypes andview,set, andoverfunctions ConstandIdentityfunctorsEither#toOptionalHMap#removeandHMap#removeAll
1.4 - 2016-08-08
- All function input values become
java.util.functiontypes, and all function output values remain lambda types, for better compatibility
1.3 - 2016-07-31
Profunctorinheritance hierarchy- Renaming
IdentitytoId Monadic/Dyadic/TriadicFunctionis nowFn1/2/3
HListspecializations support random access lookup
1.2 - 2016-06-27
Tuples moved underHListas specialized subtypes
Either#peekHMap, heterogeneous mapsTuple2is now also aMap.Entry
1.1 - 2016-06-21
- Better interoperability between lambda and
java.util.functiontypes
scanLeftHList, heterogeneous lists- Added up to
Tuple5 Either, specialized coproduct with success/failure semantics
1.0 - 2015-12-29
- Initial implementation of first-class curried functions
all,any,cartesianProduct,cycle,drop,dropWhile,filter,foldLeft,foldRight,inGroupsOf,map,partial2,partial3,reduceLeft,reduceRight,repeat,take,takeWhile,unfoldrMonadic/Dyadic/TriadicFunction,Predicate,Tuple2,Tuple3Functor,BiFunctor,ProFunctor