cats v0.7.0 Release Notes
-
2016 August 21
๐ 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~>
. - 0๏ธโฃ 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:
- #1145: Major rearrangements and additions
- #1136: New chart for symbols
- #1052: New "Why?" section
- ๐ #1095, #1226, and #1227: New FAQ section
- #1163: New import guide section
- #1217, #1223, and #1239: New related projects
- #1057 and #1157: Copy-paste-friendly code blocks
- #1104 and #1115: Kitchen-sink imports in example code
- #1050: Switch to rouge for syntax highlighting in the GitHub Pages site
- #1119: Fix for
contramap
signature - ๐ #1141 and #1162: Fixes for cats-kernel documentation
- #1149: Spelling consistency for "type class"
- ๐ #1183: More documentation about use of Machinist, Simulacrum, and kind-projector
- ๐ #1056: Clarification about forgetful functors and the free monad
- #1131 and #1241: Simplified project structure listings
- ๐ #1185, #1186, and #1189: Miscellaneous improvements for
Traverse
documentation
๐ And the build:
- #1159: Binary compatibility checking for cats-kernel via MiMa
- โ #1256: More reliable Scala.js testing in Travis CI
- ๐ #1123: cats-kernel is now included in the API documentation
- ๐ #1051: Empty Scaladocs for 2.10 to avoid issues macros cause for API documentation generation on 2.10
- ๐ #1154: Better POM hygiene: no Scoverage dependency
- #1153 and #1218: More consistent use of Simulacrum for syntax
- ๐ #1093: Scalastyle is now aware of shared and Scala.js-specific source files
- ๐ #1142: Additional formatting rules for Scalastyle
- ๐ #1099: Type lambda style is now enforced by Scalastyle
- โก๏ธ #1258: Version updates for SBT and SBT plugins
We also welcome Kailuo Wang, Peter Neyens, and Oscar Boykin as new Cats maintainers!
- ๐ All references to