Releases: typelevel/cats
1.0.0-RC2
Version 1.0.0-RC2
2017 Nov 25
Breaking changes and migration
- #2039 Remove
Applicative#traverse
andApplicative#sequence
by @kubukoz - #2033 standardise on
liftF
and addliftK
to transformers by @SystemFw - #2083 Change forEffect/followedBy to productL/productR by @Jacoby6000
- #2088 Add
InvariantSemigroupal
andability
to turnMonoidal
s toMonoid
s by @LukaJCB
New features / enhancements (API, instances, data types, etc.):
- #1949 Add ::: to NonEmptyList by @jcranky
- #2020 Add
foldl
andfoldr
aliases toFoldable
by @felixmulder - #2024 Optimize foldMap implementations with combineAll by @carymrobbins
- #1938 Add more Parallel instances by @LukaJCB
- #2030 added
collectFirst
andcollectFirstSome
toFoldable
by @kailuowang - #1977 Add Ior Monad Transformer by @frroliveira
- #2038 Add &> and <& as syntax for Parallel by @LukaJCB
- #1981 Add UnorderedFoldable and UnorderedTraverse by @LukaJCB
- #2047 CommutativeMonoid instance for SortedMap by @alonsodomin
- #2043 Removed deprecation of >> and changed its param to be a by-name by @mpilquist
- #2034 Add ContravariantMonoidal by @stephen-lazaro
- #2057 Add
Ior.fromEither
by @markus1189 - #2056 Functor.fmap by @fosskers
- #2059 Add Parallel instance for Ior by @andyscott
- #2061 Add
MonadError.rethrow
by @SystemFw - #2072 added a default id for Arrow by @kailuowang
- #2063 Added
merge
(product) toArrow
for arrows composition by @marcobattaglia - #2060 Add parallel instance for IorT by @andyscott
- #2046 Add distributive typeclass and some instances by @coltfred
- #2099 CommutativeMonad and CommutativeFlatMap instances for Tuple2 by @ceedubs
- #2096 Add Arrow Choice by @stephen-lazaro
- #2098 Add a CommutativeMonoid for Map by @ceedubs
- #2101 Add Semigroup.instance method by @jozic
- #2103 CommutativeMonad for Eval by @ceedubs
- #2104 Add Commutative{Monad, FlatMap} instances for IdT by @ceedubs
- #2105 Some Kleisli instance cleanup by @ceedubs
- #2110 add
Comparison
tocats
package by @kailuowang - #2112 CoflatMap Instance for Applicative by @ChristopherDavenport
- #2116 conversion
PartialOrder
toPartialOrdering
andHash
toHashing
by @kailuowang - #2100 Add
comparison
method inOrder
companion object by @ceedubs
Bug fixes:
- #2011 Rename ContravariantCartesian.scala to ContravariantSemigroupal.scala by @iravid
- #2016 Removed redundant Eq instance by @denisrosset
- #2029 make sure that EitherT MonadError syntax works the old way by @kailuowang
Documentation Improvements/Additions:
- #2007 move alleycats in readme by @kailuowang
- #2008 Upgrade Scalafix instructions by @gabro
- #2009 Correct it's -> its documentation errors by @kellen
- #2017 Fix alleycats module name by @benhutchison
- #2023 Fixes in Arrow docs by @Jasper-M
- #2026 Correctly close a tut:silent block in faq by @vendethiel
- #2027 Rename Validation to Validated in Validated docs by @Ttcao
- #2036 Clean up applicative syntax doc by @bkirwi
- #2035 Do not redirect to cats-mtl for MonadCombine by @vendethiel
- #2048 Add direct link to the scaladoc by @fagossa
- #2050 Link Directly to Cats Package in ScalaDoc by @stephen-lazaro
- #2031 Add parallel docs by @LukaJCB
- #2045 Fix scalafix testing instructions by @kubukoz
- #2068 Update symbols table by @stephen-lazaro
- #2070 Add some doctest examples for Alternative methods by @ceedubs
- #2065 added entry for sbt-catalysts by @kailuowang
- #2071 Add doc example for imap by @ceedubs
- #2073 Add doctests for
Ior.fromOptions
by @markus1189 - #2077 Add some doctest examples for SemigroupK/MonoidK by @ceedubs
- #2079 Add doctest examples for Applicative by @ceedubs
- #2095 Update guidelines.md by @kailuowang
- #2108 Update version of deprecation to 1.0.0-RC2 by @rossabaker
Build improvements/dependency updates
- #2028 Lawtesting: Update scalacheck-shapeless and cats by @vendethiel
- #2065 improve build by not displaying each success test by @kailuowang
- #2106 Update to latest patch versions of scala by @ceedubs
- #2114 sbt-coursier 1.0.0 by @sullis
Testing improvements
- #2037 Tests: MonadCombine->Alternative, add missing ones by @vendethiel
- #2052 Add labels to prop produced from IsEq by @nigredo-tori
- #2053 Fix #2051, Remove superfluous implicit by @rsoeldner
- #2081 Reduce redundancy in Semigroup and Eq test names by @ceedubs
- #2097 added distributeIdentityLaw by @kailuowang
1.0.0-RC1
Version 1.0.0-RC1
2017 Oct 21
This is the only planned release candidate release prior to 1.0.0, which if everything goes according to plan, shall come in 2-3 weeks.
Breaking changes and migration
- #1964 Require an
Order
instance forNonEmptyList
's groupBy function by @igstan - #1961 rename
Cartesian
toSemigroupal
by @kailuowang - #1955 Deprecate
FlatMap
's>>
and<<
by @LukaJCB - #1947 Rename
EitherT.liftT
toEitherT.liftF
by @aeons - #1934 Restruct
functor
by @kailuowang - #1803 Convert
ReaderWriterStateT
toIndexedReaderWriterStateT
by @iravid - #1775 Convert
StateT
toIndexedStateT
by @iravid - #1098 Add a different
MonoidK
andSemigroupK
instance forKleisli
by @peterneyens - #1922 Make kernel laws consistent with core laws by @LukaJCB
- #1838 Sync
NonEmptyList
andNonEmptyVector
methods by @durban - #1914 Add
Invariant
instances for kernel type classes by @LukaJCB - #1980 Make
iterateRight
inFoldable
sound by @LukaJCB - #1972 Add
SortedMap
andSortedSet
instances/MoveSet
andMap
instances to Alleycats by @LukaJCB/@kailuowang - #1997 Minimizing typeclass surface in cats-kernel by @denisrosset
- #1987 Add
mapK
totransformers
by @andyscott / @LukaJCB
To migrate from 1.0.0-MF.
- The rename of
Cartesian
toSemigroupal
andEitherT.liftT
toEitherT.liftF
can be done automatically through scalafix we provide. See instructions here. - For
FlatMap
's>>
and<<
, useApply
's*>
and<*
instead. Profunctor
andStrong
were moved to thecats.arrow
package,Bifunctor
,Invariant
andContravariant
were moved to thecats
root package.SemigroupK[λ[α => Kleisli[F, α, α]]]
andMonoidK[λ[α => Kleisli[F, α, α]]]
are no longer implicitly available, UseKleisli.endoSemigroupK
andKleisli.endoMonoidK
to get them explicitly.- law testing for type classes in
cats.kernel
was made consistent with the law testing incats.core
. Check here for a guide on how to test cats type class instances. NonEmptyList.concat
that takesNonEmptlyList
was deprecated, useNonEmptyList.concatNel
instead.Monoid
no longer has aInvariantMonoidal
instance, we discovered that it's not lawful. It has have anInvariant
and aSemigroupal
(new name forCartesian
) instance.Foldable.iterateRight
now takes anIterable
instead ofIterator
, see #1973 for rationale.Foldable
forSet
andTraversable
forMap
were moved to Alleycats, see #1831 for rationale.cats.data.Kleisli#transform
andcats.free.Coyoneda#transform
were deprecated and replaced bymapK
New features / enhancements (API, instances, data types, etc.):
- #1958 Add
FlatMap#flatTap
, a more principled version of the kestrel combinator. by @hrhino - #1950 more instances for
Hash
(#1712):Queue
/Duration
by @ctongfei - #1942 add
traverseN
to cartesian syntax by @julien-truffaut - #1939 Add
guard
toAlternative
by @SystemFw - #1933 Add syntax for
ApplicativeError
.fromEither by @tpolecat - #1921 Optimize
FreeApplicative.product
by @peterneyens - #1910 Add
NonEmptyList.ofInitLast
by @eddsteel - #1888 Enhances stack safety for
Eval
. by @non - #1885 Add
zipWith
toNonEmptyList
andNonEmptyVector
by @LukaJCB - #1882 convert trait into abstract class for better bin compact by @kailuowang
- #1878 Add some instances we were missing. by @non
- #1858 Add
NonEmptyList#partitionE
by @LukaJCB - #1847 Add right and left functor to
BiFunctor
by @LukaJCB - #1840 Add
Foldable
andTraversable
instances forFree
by @aaronlevin - #1819 Added more implementations of
map2Eval
in progress by @johnynek - #1811 Move tuple
Cartesian
syntax implicit parameter by @DavidGregory084 - #1809 Add iterateWhileM and iterateUntilM by @drbild
- #1790 Implement EitherT#leftFlatMap and EitherT#leftSemiflatMap by @vendethiel
- #1784 Add
existsM
andforallM
to Foldable by @refried - #1712 Hash typeclass by @ctongfei
- #1976 Reduced usage of
fold
inValidated
for better performance by @kailuowang - #1967 Add a few type classes to generated tuple instances by @edmundnoble/@kailuowang
- #1984 Welcome, Alleycats by @kailuowang
- #1927 Add
CommutativeApply
andCommutativeApplicative
by @LukaJCB - #1837 Add
Parallel
type class by @LukaJCB - #1998 Add
Validated.cond
andValidated.condNel
by @andyscott
Bug fixes:
- #1917 Don't use package object convention for object source path by @travisbrown
- #1804 workaround for a possible scala bug in show for value class by @kailuowang
Documentation Improvements/Additions:
- #1970 Add docs for
StateT
andIndexedStateT
by @iravid - #1956 Mention the right issue number of doom. by @hrhino
- #1952 Added examples of
Arrow
composition by @raymondtay - #1946 Give higher priority to partial-unification fix by @LukaJCB
- #1944 Fix typo. by @jooohn
- #1924 Add docs for Arrow by @zliu41
- #1923 Update footer by @kailuowang
- #1920 Document naming implicits according to @non s comment in #1061 by @tbje
- #1916 Fix tiny extra vowel typo by @andyscott
- #1915 Consolidate readme.md and index.md by @kailuowang
- #1913 updated footer by @kailuowang
- #1905 s/rewrites/rules and update scalafix version in the README by @gabro
- #1903
Validated
beginners doc by @AlejandroME - #1901 added FAQ item diff between cats and scalaz by @kailuowang
- #1900 add newts to related projects by @kailuowang
- #1899 Fix symbol signature for right and left apply in faq.md by @suhasgaddam
- #1897 add bin compat goal by @kailuowang
- #1895 trying to fix contributing page by @kailuowang
- #1894 Fix typo in background image of homepage. by @Ttcao
- #1890 Doc: Correct the URL of cats-mtl to the typelevel repository by @richardimaoka
- #1884 Rename typeclass => type class in Readme.md by @LukaJCB
- #1880 Add law testing guide by @LukaJCB
- #1875 Fix typo in
SemigroupK
scaladoc by @LukaJCB - #1874 Fix typo in
WriterT
tests by @LukaJCB - #1873 Add pureconfig and finch to ecosystem project list by @kailuowang
- #1872 Fix couple of typos in CHANGES.md by @LukaJCB
- #1871 Fix typo in
Traverse#traverseWithIndexM
by @LukaJCB - #1857 Fix typo (Foldabale => Foldable) by @LukaJCB
- #1856 Remove mtl classes from menu by @LukaJCB
- #1854 Add E...
Cats 1.0.0-MF
Version 1.0.0-MF
2017 Aug 3
MF
stands for milestone final. This is the last non-RC release before 1.0.0.
The main purpose/focus of this release is to offer a relatively stable API to
work with prior to 1.0.0. It can be deemed as a proposal for the final API
we are going to maintain binary compatibiliy after 1.0.
We will give community some time to validate it before we release 1.0.0-RC1.
To migrate from 0.9.0
We apologize for the number of breaking changes in this release. We are trying to include
as many breaking changes as possible in this release before we lock down the API.
cats
no longer publishes the all-inclusive bundle package"org.typelevel" % "cats"
, usecats-core
,cats-free
, orcats-law
accordingly instead. If you needcats.free
, use"org.typelevel" % "cats-free"
, if you needcats-laws
use
"org.typelevel" % "cats-laws"
, if neither, use"org.typelevel" % "cats-core"
.cats.free.Inject
is moved fromcats-free
tocats-core
and renamed tocats.InjectK
;
cats.data.Prod
is renamed tocats.data.Tuple2K
;cats.data.Coproduct
is renamed to
cats.data.EitherK
- All
Unapply
enabled methods, e.g.sequenceU
,traverseU
, etc. are removed.Unapply
enabled syntax ops are also removed. Please use the partial unification SI-2712 fix
instead. The easiest way might be this sbt-plugin. FunctorFilter
,MonadCombine
,MonadFilter
,MonadReader
,MonadState
,MonadTrans
,MonadWriter
andTraverseFilter
are no longer incats
, the functionalities they provided are inhereted by the new cats-mtl project. Please check here for migration guide.CartesianBuilder
(i.e.|@|
) syntax is deprecated, use the apply syntax on tuples instead. E.g.(x |@| y |@| z).map(...)
should be replaced by(x, y, z).mapN(...)
. If you are getting "mapN
not found" error message, it could be due to SI-2712, see the 3rd migration item above.- Apply syntax on tuple (e.g.
(x, y, z).map3(...)
) was moved fromcats.syntax.tuple._
tocats.syntax.apply._
and renamed tomapN
,contramapN
andimapN
respectively. - The creation methods (
left
,right
,apply
,pure
, etc.) inEitherT
were improved to take less
type arguments. - Several
cats-core
type class instances forcats.kernel
were moved from their companion objects to separate traits
and thus require imports fromcats.instances.xxx._
(or the recommendedimport cats.implicits._
) now. See #1659 for more details. Free.suspend
is renamed toFree.defer
for consistency.traverse1_
,intercalate1
andsequence1_
inReducible
were renamed tononEmptyTraverse_
,nonEmptyIntercalate
andnonEmptySequence_
respectively.foldLeftM
is removed fromFree
, usefoldM
onFoldable
instead, see #1117 for detail.iteratorFoldM
was removed fromFoldable
due to #1716Split
is removed, and the methodsplit
is moved toArrow
. Note that only underCommutativeArrow
does it guarantee the non-interference between the effects. see #1567
If you feel adventurous you can try the experimental Scalafix rewrites.
See all the available rewrites and the instructions here.
Breaking Changes:
- #1614: added
leftT
and improved existing lift API forEitherT
. by @kailuowang - #1596: Rename
Inject
toInjectK
. by @andyscott - #1589: Rename
Prod
,Coproduct
toTuple2K
andEitherK
. by @kailuowang - #1583: Enable SI-2712 fix in cats / Remove unapply machinery. by @kailuowang
- #1679: remove
Unapply
class. by @kailuowang - #1557: Improvements to
Inject
. @sellout - #1659: move instances into separate trait. by @yilinwei
- #1709: Rename
suspend
todefer
. by @peterneyens - #1611: Renamed
traverse1_
,intercalate1
andsequence1_
inReducible
. by @LukaJCB - #1117:
foldLeftM
withoutFree
. by @TomasMikula - #1487:
Apply
syntax for tuples. by @DavidGregory084 - #1745: Deprecate
CartesianBuilder
. by @kailuowang - #1758: stop publishing cats all bundle , start to publish cats-testkit. by @kailuowang
- #1766: Replace
Split
withCommutativeArrow
, introducesCommutativeMonad
. by @diesalbla - #1751: Removed
FunctorFilter
,MonadCombine
,MonadFilter
,MonadReader
,MonadState
,MonadTrans
,MonadWriter
,TraverseFilter
. by @edmundnoble
New Features (API, instances, data types, etc):
- #1707: Add NEL/NEV one. by @peterneyens
- #1680:
by @wedensMonadTrans
instance for RWST and makeMonadTrans
serializable. - #1658: Add
Validated.validNel
. by @edmundnoble - #1651:
Add state method toby @oskoiMonadState
. - #1628: add init and size methods to
NonEmptyList
. by @jtjeferreira - #1612: Add ensureWith to
Validated
andEither
(#1550). by @LukaJCB - #1598: Implement a
ReaderWriterStateT
data type . by @iravid - #1706: Clean up
ReaderWriterStateT
. by @peterneyens - #1594: Add
NonEmptyList#fromFoldable
. by @markus1189 - #1611: Added
NonEmptyTraverse
. by @LukaJCB - #1592: added instances of
BitSet
toallInstances
. by @kailuowang - #1586: Add
Applicative.unit
. by @alexandru - #1584: Move arbitrary instance of
StateT
to laws. by @kailuowang - #1580: add
groupBy
toNonEmptyList
andgroupByNel
toList
syntax @julien-truffaut - #1578: add
last
,sortBy
andsorted
toNonEmptyList
. by @julien-truffaut - #1571: added
whileM
,untilM
,iterateWhile
, etc toMonad
. by @tpolecat & @kailuowang - #1548:
MonadError
instance forIor
. by @leandrob13 - #1543:
MonadError
instance forKleisli
. by @durban - #1540:
Ior
syntax. by @leandrob13 - #1537: Add
FlatMap.forEffect
. by @cranst0n - #1531: Add piecemeal import for
MonadError
. by @peterneyens - #1526:
Inject
for free programs. by @tpolecat - #1464: Adding
get
forFoldable
. by @yilinwei - #1602: Stack-safe
Coyoneda
. by @edmundnoble - #1725: Add
InjectK
laws. by @andyscott - #1728: Adds an
As
class which represents subtyping relationships (Liskov
). by @stew - #1178: Add
Is
constructor for Leibniz equality. by @tel - #1611: Add
NonEmptyTraverse
typeclass. by @LukaJCB - #1736: Added
StackSafeMonad
mixin. by @djspiewak - #1600:
Inject
forEither
. by @andyscott - #1746: Add
EitherNel
type alias forEither[NonEmptyList[E], A]
. by @andyscott - #1670: Add
Order
->Ordering
implicit conversion to implicits, instances. by @edmundnoble - #1649: Make
Show
inherit from a contravariant base trait forshow
string interpolator to be covariant. by @edmundnoble - #1761: Add index related helpers to
Traverse
. by @andyscott - #1769: Add
Kleisli
tap
,tapWith
. by @tpolecat - #1739: Add
onError
andadaptError
toApplicativeError
/MonadError
. by @SystemFw - #1644: Add
MonadError
instance forEitherT
that recovers fromF[_]
errors. by @leandrob13 - #1748: Stack-safe
FreeAppplicative
. by @edmundnoble - #1516: Implement
NonEmptyList#Collect
. by @xavier-fernandez
Code improvements:
- #1660: Override
fromTry
andfromEither
forTry
and `...
Cats 0.9.0
The biggest user-facing change in this release is to the behavior of the flatMap
(and related methods) provided by EitherOps
for the standard library's Either
for Scala 2.10 and 2.11. These methods now match the behavior of the flatMap
on Either
in Scala 2.12 in that they don't require the left-hand side types to match.
For example, the following would previously compile on 2.12, but not 2.10 or 2.11:
import cats.syntax.either._
sealed abstract class AppError
case object Error1 extends AppError
case object Error2 extends AppError
val either1: Either[Error1.type, String] = Right("hi")
val either2: Either[Error2.type, String] = Right("bye")
val result: Either[AppError, String] = for {
v1 <- either1
v2 <- either2
} yield v1 + v2
This code now works equivalently on all supported Scala versions.
Changes:
- #1424:
NonEmptyList
andNonEmptyVector
are now covariant - #1506:
flatMap
provided byEither
syntax matches 2.12'sEither#flatMap
- #1466: Improved stack safety for
StateT
- #1510:
catchNonFatal
forFuture
is now asynchronous
Bug fixes:
New type class instances:
Other additions:
- #1446:
Cofree
comonad - #1520 and #1522:
intercalate
forFoldable
(andintercalate1
forReducible
) - #1454:
asLeft
andasRight
syntax methods for creatingEither
values - #1468:
tupleLeft
andtupleRight
forFunctor
- #1500:
putLeft
,putRight
,mergeLeft
, andmergeRight
methods forIor
- #1495:
show
string interpolator - #1448:
Validated#findValid
(likeorElse
but error accumulating) - #1455:
reverse
forNonEmptyList
- #1517:
zipWithIndex
forNonEmptyList
- #1512 and #1514:
filterNot
forNonEmptyList
andNonEmptyVector
- #1480:
FunctionK#and
- #1481:
EitherT.cond
Miscellaneous improvements (syntax, documentation, tests):
- #1513: Improved documentation for
Functor
,Applicative
, andTraverse
- #1440: Improved type class documentation
- #1442: Improved documentation for
Semigroup
andMonoid
- #1479: Some instance traits are now package-private
- #1445: Workaround for Tut issue
- #1477: Use new kind-projector syntax for polymorphic lambdas
- #1483: Binary compatibility checking is now part of the build for cats-kernel
- #1469: More consistent instance names
- #1496: Simpler creation of some
SemigroupK
andMonoidK
instances - #1490: Avoid some duplication in build via sbt-travisci
- #1497: Site list clean-up
And version updates:
As always thanks to everyone who filed issues, participated in the Cats Gitter channel, submitted code, or helped review pull requests.
Cats 0.8.1
Version 0.8.1 is a release to support Scala 2.12.0 with no changes to published code (only tests and documentation).
Build:
- #1457: Update to Scala 2.12.0
Miscellaneous improvements (syntax, documentation, tests):
Cats 0.8.0
Version 0.8.0 is the eighth Cats release, and the first release with support for Scala 2.12 (specifically the 2.12.0-RC2 release candidate).
Apart from the introduction of Scala 2.12 support, the biggest change in this release is the removal of Xor
and XorT
. See the FAQ for information about the motivations for this change and recommendations for migration.
Removals and deprecations:
- #1310:
Xor
andXorT
are gone - #1370:
RecursiveTailRecM
andFree#foldMapUnsafe
are gone and stack safety is checked in the laws forMonad
- #1411:
FreeT#interpret
is deprecated in favor of the (equivalent)compile
Additions:
- #1382, #1415: Support for Scala 2.12.0-RC2
- #1414:
Foldable#iteratorFoldM
and lazyfoldM
implementations for many standard library instances - #1356:
append
andprepend
(and operator aliases) forNonEmptyVector
- #1327:
EitherT.fromOption
- #1388:
StateT.set
andStateT.setF
- #1392:
StateT.get
- #1325:
WriterT.lift
- #1391:
MonadReader#reader
- #1352: Macro-powered
FunctionK.lift
- #1398:
<<<
and>>>
aliases forCompose
'scompose
andandThen
- #1408:
toNestedValidated
andtoNestedValidatedNel
forEitherT
- #1399:
Order.fromComparable
- #1394:
Traverse#flatSequence
- #1417:
MonadTests#stackUnsafeMonad
laws for instances wheretailRecM
is known to be unsafe - #1411:
compile
andfoldMap
for theFree
andFreeT
companion objects
New instances:
- #1319:
Order
andGroup
forBigDecimal
- #1354:
Semigroup
forIor
- #1395:
Order
forSymbol
- #1324:
PartialOrder
and other instances forBitSet
- #1324:
Eq
andPartialOrder
forEither
- #1324:
PartialOrder
,Monoid
, and other instances forFunction0
- #1324:
Monoid
and other instances forFunction1
- #1402:
Monad
,MonadCombine
,Traverse
,Order
, etc. forProd
- #1413:
MonadError
forStateT
- #1399: Instances for
java.util.UUID
Renaming and rearrangements:
- #1385: The
cats.js.std
package is nowcats.js.instances
- #1324: Many instances moved from cats-core to cats-kernel
- #1394:
Traverse#traverseM
is nowflatTraverse
Miscellaneous improvements (syntax, documentation, tests):
- #1347: Consistency laws for
combineAll
andcombineAllOption
- #1324: Performance improvements for
Either
instances - #1386:
FunctionK
tests and examples now use kind-projector 0.9's polymorphic lambdas - #1410: Replace
Coproduct#run
withCoproduct#fold
- #1331: Less expensive
tailRecM
-flatMap
consistency checking - #1330: More consistent parameter-less method definitions and usage, other syntactic improvements
- #1340: New Scaladex badge
- #1416: New diagram of type classes
- #1352: API docs for
FunctionK
- #1369, #1418: New project site based on sbt-microsites
- #1259: 0.6-to-0.7 migration guide
- #1304, #1317, #1323, #1350, #1366, #1376, #1380, #1390, #1403, #1407, #1421: Other miscellaneous documentation improvements
Build:
Cats 0.7.2
Version 0.7.2 is a patch release that was released to fix a major bug (#1346) that appeared in 0.7.0. It also contains several other improvements.
It should be safe to upgrade from 0.7.0 to 0.7.2 — there are no major API changes between these releases.
Changes
Fixes:
- #1347: fixes broken
Monoid[Map[K, V]].combineAll
implementation. - #1304: fix
CoflatMap
documentation. - #1322: fix SBT commands (
release
,validate
, etc.). - #1311: rename some implicit instances for consistency.
Additions:
Note that 0.7.2 was preceeded by a botched 0.7.1. release. Please avoid using this version of Cats — it has major incompatibilities with 0.7.0 and is not documented here.
Cats 0.7.0
Version 0.7.0 is the seventh Cats release, and includes several major rearrangements and changes to names.
Migration notes
If you're updating from Cats 0.6.0, it's likely that you'll need to make extensive (but mostly mechanical) changes. The following list includes some of the changes that are likely to be necessary for most projects; see the complete list of changes below for more detail.
- All references to
cats.std
will need to be changed tocats.instances
(#1140). If you're usingcats.std.all
or the othercats.std
objects with wildcard imports, this is likely to be the only change you need to make. If you are importing or referring to instance definitions by name, you'll need to be aware that the naming convention has changed (see #1066, #1068, #1110, and #1122). NonEmptyList
andNonEmptyVector
are no longer type aliases forOneAnd
, so any code usingOneAnd
to construct or pattern match on these types will need to be changed to useNonEmptyList
orNonEmptyVector
directly. There are also some API changes; for example,unwrap
calls will need to be replaced bytoList
ortoVector
, andNonEmptyList(1, 2, 3)
is nowNonEmptyList.of(1, 2, 3)
.pureEval
has been removed fromApplicative
(#1234), and has not been replaced, so if you are relying on it for laziness or effect capturing (which wasn't enforced or guaranteed), you'll need to find another approach.- All references to
NaturalTransformation
will need to be replaced by eitherFunctionK
or~>
. - The
FlatMap
type class now has atailRecM
method that is designed to support stack-safe recursive monadic binding. If your monad'sflatMap
is stack safe, you can implement a stack-safetailRecM
by callingMonad#defaultTailRecM
. The stack safety oftailRecM
is not enforced, but if your implementation is stack safe, you should also provide an instance of theRecursiveTailRecM
marker type class. - If you are interpreting a free algebra into a context
F
withfoldMap
, you'll now needF
to have an instance of theRecursiveTailRecM
marker type class (in addition to theMonad
instance).
If you run into any issues while updating, please get in touch on Gitter.
Changes
This release includes a fix for a bug in 0.6.0 (also fixed in 0.6.1):
- #1062:
Order
instances for tuples are now lexicographic (instead of only comparing first elements)
And other bug fixes:
- #1096:
inj
andprj
onInject
now work consistently with respect tonull
And some additions:
- #1289 and #1306:
EitherT
and improvedEither
syntax - #1280:
FlatMap
now has atailRecM
method - #1280:
RecursiveTailRecM
marker type class indicating thattailRecM
is stack safe - #1266:
FreeT
monad transformer - #1225:
FunctorFilter
andTraverseFilter
- #1121:
valueOr
andmerge
forValidated
- #1188:
toValidatedNel
forXorT
- #1127:
toTry
forXor
- #1269:
catchNonFatal
forApplicativeError
- #1130:
isEmpty
syntax method forMonoid
- #1167:
minimum
,maximum
, and related helper methods forFoldable
andReducible
- #1243:
distinct
onNonEmptyList
andNonEmptyVector
- #1134:
cats.syntax.list
for à la carte list syntax imports - #1191:
cats.syntax.monoid
for à la carteMonoid
syntax imports - #588 and #1063:
IdT
, the identity monad transformer - #1021 and #1221:
Nested
(represents nested composition of type constructors) - #1172:
toNested
forOptionT
andXorT
- #1102 and #1170:
Comparison
(represents the result of anOrder
comparison) - #1090:
Kleisli.lift
- #1169:
lift
,inspect
, and related methods forStateT
- #1114:
size
forFoldable
- #1193:
reduceLeftM
forReducible
- #1097: Functor variance helpers (
widen
forFunctor
andnarrow
forContravariant
) - #1207:
tell
forWriter
andWriterT
,value
forWriter
- #1155: Convenience methods for constructing
XorT
values - #1085:
runTailRec
andfoldLeftM
forFree
- #1299:
ContravariantCartesian
type class
And some name changes:
- #1140:
cats.std
is nowcats.instances
- #1066, #1068, #1110, and #1122: More unique type class instance names
- #1072:
NaturalTransformation
is nowFunctionK
- #1085:
mapSuspension
onFree
is nowcompile
- #1111:
Free.Gosub
is nowFree.FlatMapped
- #1133:
Composite*
traits for binary type classes are renamed toComposed*
for consistency (and are now private)
And other API changes:
- #1231:
NonEmptyList
is now a case class instead of a type alias for aOneAnd
- #1137:
NonEmptyVector
is now a value class instead of a type alias for aOneAnd
- #1267: Overloaded variadic
apply
onNonEmptyList
andNonEmptyVector
is nowof
- #1234:
Applicative#pureEval
has been removed - #1202:
MonadFilter
no longer has afilterM
method (see #1225) - #1075:
foldMap
onFree
now requires aMonadRec
instance (instead of simplyMonad
) - #1085:
Free.suspend
no longer requires anApplicative
instance - #1084: Safer
toString
forFree
andFreeApplicative
- #1100: Simplified constraints for methods on
Xor
and related types - #1171: Prioritization traits are now private
And many new instances:
- #1059 and #1147:
Monoid
,MonadError
, and other instances forscala.util.Try
- #1299:
Monad
forTuple2
- #1211:
Contravariant
forEq
- #1220:
Traverse
andComonad
forTuple2
- #1103:
Order
,MonadError
, and other instances forOptionT
- #1106:
Semigroup
andMonoid
forXorT
- #1138:
SemigroupK
andMonadCombine
forStateT
- #1128
Semigroup
andMonoid
forApplicative
- #1049:
CoflatMap
forWriterT
- #1076 and #1261:
MonadRec
instances forEval
,StateT
, andFuture
- #1105:
Unapply
instances forNested
shapes
And miscellaneous improvements to style and performance:
And improvements to the documentation:
Cats 0.6.1
Version 0.6.1 is a patch release compatible with 0.6.0.
It contains one bug fix:
- #1062: Fixed a bug in the Order and PartialOrder instances for Tuple2+ where only the first element was used in comparisons
It also contains a change to the build:
- #1173: Add binary compatibility check to all published modules
Cats 0.6.0
Version 0.6.0 is the sixth release.
Highlights of this release:
- #990: Separate free package into its own module
- #1001: Introduce cats-kernel and remove algebra dependency
This release also includes some API changes:
- #1046: summon
ApplicativeErrorSyntax
forF[_]
instead ofF[_, _]
- #1034: Don't combine lefts on
Xor
andXorT
combine
- #1018: Remove blocking (JVM-only) Future instances
- #877: Remove required laziness in Prod, fixes #615
And additions:
- #1032: Added
Coproduct
fold
- #1028: Added
withFilter
forOptionT
- #1014: Added
Monoid
instance forWriterT
- #1029: Added an
ApplicativeError
instance forKleisli
and aMonadError[Option, Unit]
tostd.option
- #1023: Add
XorT#fromEither
- #984: Add
Validated.ensure
- #1020: Add
Traverse.traverseM
And some code improvements:
- #1015: Add
Apply.map2Eval
and allow traverse laziness - #1024: Override reverse on reversed
PartialOrder
to return original instance - #880: Optimize
Eq[Vector[A]]
instance - #1019: Use
Future#successful
inpureEval
when possible
And bug fixes:
- #1011: Add missing type parameters.
And some other improvements to the organization documentation, tutorials, laws and tests, including:
- #1045: Add a link to the
OptionT
documentation from the monad docs. - #1043: Add notes about kind-projector usage in docs
- #1042: Cats 0.5.0 no longer pre-release
- #1036: Add FPiS to the "Resources for Learners" section
- #1035: Run kernel-law tests for JS as part of build
- #991: Replace
~>
withNaturalTransformation
- #1027: Remove unnecessary
nelSemigroup
fromtraverse
doc - #1022: Add law-checking for
asMeetPartialOrder
andasJoinPartialOrder
- #990: Separate free package into its own module