Getting the most out of ScalaCheck

We’ve been using ScalaCheck property checks at Sharethrough for about a year. For those not familiar, property checks test a condition multiple times, using freshly-generated data on each iteration. While a unit test exercises a very specific scenario, a property check’s ability to generate data broadens...

Software Engineer

The Free Monad and its Cost

This is the follow up post in to my explanation of Monads for Scala developers. Read part one here.

Code examples can be found here:

I had heard a lot of things about the Free Monad and never really understood what it was, so did the research that led...

Engineering Team Lead, Optimization

Scala Days Recap

I have been writing Scala for a little over three years now and kept coming across this concept called the “Free Monad.” After a while, I decided to do the research to understand what a Free Monad is. This led me down the rabbit hole of functional programming in Scala, which some outspoken people...

Engineering Team Lead, Optimization

Monads are confusing. Let us help

Scala developers love to discuss Monads, their metaphors, and their many use cases. We joke that Monads are “just Monoids in the category of Endofunctors,” but what does that really mean?

Parts of functional programming (FP) may be built on the mathematical principles from category theory, but you...

Engineering Team Lead, Optimization

Capturing common config with an SBT parent plugin

After creating a few Scala projects, we noticed that we repeated a good chunk of SBT configuration across projects. This caused issues, the kind that occur any time there’s repeated code. In some cases, developers were resolving version and dependency incompatibilities over and over. In others, improvements...

Software Engineer

Suppressing SLF4J logs During Tests in SBT

It’s a best practice to bypass logging during unit tests. Since the tests will be run by a computer, the output is wasted I/O, and if you needed log output to understand why a test failed, that should be a sign that a new test needs to be written. Logging tests can even make debugging harder by hiding...

Software Engineer