Menu

It's programs all the way down

This is the first of a series of articles on “Monadic EDSLs in Scala.” Embedded domain specific languages (EDSLs) are a powerful tool for abstracting complexities such as effects and business logic from our programs. Instead of mixing ad-hoc error handling, database access, and web calls through our code, we...

Choosing variance for a phantom type

When you use a type parameter to abstract over actual data in your ADT, there is typically only one variance that makes sense, if you choose to incorporate subtyping into your designs at all. This is the natural, “parametrically sound” variance. sealed abstract class MyModel[P, I, -T, +V] final case...

Higher-kinded types: the difference between giving up, and moving forward

As its opening sentence reminds the reader—a point often missed by many reviewers—the book Functional Programming in Scala is not a book about Scala. This [wise] choice occasionally manifests in peculiar ways. For example, you can go quite far into the book implementing its exercises in languages with simpler type...

Making internal state functional

This is the ninth of a series of articles on “Type Parameters and Type Members”. Scala’s CanBuildFrom API is relatively well-founded and flexible; in combination with GADTs, it can provide that flexibility in a fully type-safe way, if users choose not to circumvent it with typecasting. However, it is designed...

The Typelevel Summit in Boulder is Cancelled

As a result of LambdaConf’s decision to invite Curtis Yarvin as a speaker, the organizers of the Typelevel Summit Boulder have decided that affiliation with LambdaConf is no longer compatible with Typelevel’s goals, and we are cancelling the event, which was scheduled to happen on the Wednesday before the conference....

Information hiding, enforced

Code should be reusable. An expression traversing a data structure shouldn’t be written multiple times, it should be pulled out into a generic traversal function. At a larger scale, a random number generator shouldn’t be written multiple times, but rather pulled out into a module that can be used by...

Of variance and functors

Scala’s type system allows us to annotate type parameters with their variance: covariant, contravariant, invariant. Variance allows us to define the subtyping relationships between type constructors – that is, under which conditions F[A] is a subtype of F[B]. Similarly in functional programming, there are covariant functors, contravariant functors, and invariant...

First batch of talks at the Philadelphia Summit

The work on the programme for the Philadelphia Summit is in full swing! As announced earlier, we’re happy to share with you the first batch of accepted talks. Don’t worry though, there’s still time until the end of the week to submit a proposal. Becoming a cat(s) person Want to...

It’s existential on the inside

This is the eighth of a series of articles on “Type Parameters and Type Members”. You may wish to check out the beginning, which introduces the PList type we refer to throughout this article without further ado. When you start working with type parameters, nothing makes it immediately apparent that...

Keynote at the Philadelphia Summit

While the CfP for the Philadelphia Summit is still open (have you submitted a proposal yet?), we can already announce our keynote speaker: Stephanie Weirich is a Professor at the University of Pennsylvania. Her research centers on programming languages, type theory and machine-assisted reasoning. In particular, she studies generic programming,...