Update: the experiment described in this post is now available in the Cats 2.2.0 pre-releases,
starting with 2.2.0-M1, which was
published in March 2020.
This post is an attempt to provide some additional context and justification for
an experiment that I've been working on as a proposal for a
future version of Cats (probably 3.0). The argument is that by
moving Cats's type class instances for standard library types into implicit scope, we can provide a
better user experience along a couple of dimensions (fewer imports to think about, faster compile
times), while also making the library better aligned with future changes in the language and compiler.
Continue reading
Scala provides a handful of language features that are designed to make it easy
for users to define and work with
algebraic data types (ADTs).
You write some case classes that extend a sealed trait, you write some functions
that pattern match on those case classes,
and you're done: you have a nice linked list or rose tree or whatever.
Sometimes you can't use case classes to implement your variants, though,
or you don't want to put your case classes in your public API, and in these
situations pattern matching is typically much less useful. This blog post is about
the visitor pattern, which
is an alternative to pattern matching that provides many of its benefits, and about
the use of visitors we're planning for Circe 1.0.
Continue reading
I've written a couple of blog
posts
about how the Parallel
type class has changed in
Cats 2.0,
but those posts don't really say much about why someone using Cats should care about Parallel
in the first
place. The name suggests that it has something to do with running computations at the same time, and
while that's one of things you can do with it (via the instance for IO
in
cats-effect, for example), it has a much, much wider
range of applications. This post will focus on a real-world use case for Parallel
that at a glance
might not seem to have much in common with running things in parallel: accumulating errors while validating form inputs.
Continue reading
Typelevel has just published Cats 2.0.0,
and while the core modules are guaranteed to be binary compatible with 1.x, there are some changes
that break source compatibility. Most of these changes are
unlikely to affect users, but a few will, and the goal of this post is to point out which those are and what you can do
about them.
Note that while some of the stuff below is pretty intense, it's unlikely to apply to you. In fact if
you're not using Parallel
, there's like a 99% chance you can close this tab right now and go
change your Cats version and everything will be fine. There are also always people in the Cats
Gitter channel who are happy to help. In any case please don't be intimidated
and put off updating to 2.0.0—the community is healthier if adopters invest in staying up to date.
Continue reading
(Apologies for the title—after a lot of time on Twitter this week I've been feeling nostalgic for things like Tumblr c. 2010.)
This post is an attempt to answer a question Baccata64 asked on Reddit yesterday afternoon:
how does the Parallel change not break bincompat ? Is it that type parameters and type members are encoded the same way at the bytecode level ?
The context is that Cats 2.0.0-RC2 includes a recent change where the Parallel
and NonEmptyParallel
type classes
were changed from having two type parameters each:
trait NonEmptyParallel[M[_], F[_]] {
// ...
}
…to one, with the parallel context (the F
parameter) changed to a type member:
trait NonEmptyParallel[M[_]] {
type F[_]
// ...
}
This post will give some background about the context and motivation for this change, and then will try to answer Baccata64's question.
Continue reading
Update (25 July 2020): John De Goes has hired a lawyer to send me a
cease and desist letter demanding
that I delete this post. See my responses here and
here for more details.
This post is a collection of links about John De Goes that show some clear patterns of behavior:
- De Goes defending white supremacists and misogynists.
- De Goes attacking critics and accusing them (especially women) of lying.
- De Goes engaging in targeted harassment, either directly (@druconfessions) or indirectly (e.g. via ClarkHat, a LambdaConf sponsor).
Continue reading