Menu

Validated Configurations with Ciris

The need for configuration arises in almost every application, as we want to be able to run in different environments – for example, local, testing, and production environments. Configurations are also used as a way to keep secrets, like passwords and keys, out of source code and version control. By...

Compile time dimensional analysis with Libra

Dimensional analysis When we code, we code in numbers - doubles, floats and ints. Those numbers always represent real world quantities. For example, the number of people in a room can be represented as an integer, as can the number of chairs. Adding people and chairs together gives a nonsensical...

An IO monad for cats

Haskell is a pure language. Every Haskell expression is referentially transparent, meaning that you can substitute that expression with its evaluated result without changing the program. Or, put into code: -- this program f expr expr -- apply function f to arguments expr, expr -- is equivalent to this one,...

Equivalence versus Equality

This is a guest post by Tomas Mikula. It was initially published as a document in the hasheq. It has been slightly edited and is being republished here with the permission of the original author. This article describes what we mean when we say that the data structures in this...

Four ways to escape a cake

The mixin style of importing in which classes and traits are defined within traits, as seen in scala.reflect.Universe, ScalaTest, and other Scala styles, seems to be infectious. By that, I mean once you define something in a trait to be mixed in, to produce another reusable module that calls that...

There are more types than classes

As programmers, we are very incautious with our use of the word “type”. The concept of “type” is sufficiently abstract and specific that we are tempted to understand it by analogy, so much that we begin to confuse analogy with sameness. The colloquial “runtime type”, a fair approximation of “class”,...

Endorsing the new Scala Code of Conduct

A couple of days ago, the new Scala Code of Conduct was published. It applies to all official Scala channels, including mailing lists, Gitter channels and GitHub repositories. We would like to take this opportunity to endorse this new Code of Conduct. From our perspective, it does a good job...

API Design for Heaps (aka Priority Queues)

This is a guest post by Chris Okasaki. It was initially published as the design document behind scads. It is being republished here with the permission of the original author. A heap (or priority queue) is a collection of elements ordered by some Ordering, optimized for retrieving the first element...

EDSLs as functions

This is the second of a series of articles on “Monadic EDSLs in Scala.” Perhaps the most direct way to start writing an EDSL is to start writing functions. Let’s say we want a language for talking about sets of integers. trait SetLang { def add(i: Int, set: Set[Int]): Set[Int]...

Typelevel representative at the Scala Center Advisory Board

It is our pleasure to announce that the Scala Center Advisory Board has invited us to nominate a member of the Typelevel community to serve as a community representative, alongside Bill Venners. To figure out whether or not we should accept this offer and who we pick we have held...