Observations on what's around me and projects I'm working on.


Posts tagged with scala

Slick query enrichment

Query enrichment (or query extensions) in Slick can provide a concise way to express domain-specific logic. This gives extra flexibility beyond Slick’s combinators, such as map and filter. This post builds up an example micro DSL, showing the benefits in clarity and reduced repetition. Three Valued Flags The example...
Read more…

Introducing Essential Slick

Essential Slick is a new book we’ve been working on, which is now available for early access. That means, we’ll be making updates before we announce a final version, although all the chapters are available. This post tells you a bit more about the book and its origin. Originally posted at Judging by the projects we’re...
Read more…

Practices for distributed Scala

Jutta Eckstein’s recent presentation on distributed teams rang true for me. We’ve leaned much about distributed teams, about what works, and what causes issues. In this post I’ll note the challenges for new Scala teams, and ways to tackle them. Here are four problems new Scala teams have to deal with: getting to grips...
Read more…

Highlights of the Lift Web Framework 2.6 release

Lift 2.6 is out. The announcement links to the tickets for the details. I count the changes from 2.5 to 2.6 as 321 commits from 25 people. Here’s my personal selection of some of those changes. Menu.param Enhancements You can now customize Menu.param for situations where a request almost, but doesn’t quite, match. For...
Read more…

Papertrail Logging with Lift and AWS Beanstalk

Papertrail is a web-based log management tool. It aggregates log messages from your applications, allowing you to view and search them from a web console. It’s web-based tail -f and grep in one. Setting up Papertrail with the Lift Web Framework on Beanstalk isn’t hard, but there are a couple of steps that I didn’t think...
Read more…

Code Review at Scala eXchange

I normally give talks about something technical: “Look! A thing we did!”. But this talk, from Scala eXchange, was different. It’s really about Scala team experiences we’ve had over the last couple of years. The sort of experiences are when get asked to review Scala projects and report back on how they look....
Read more…

Scala enumerations

This article applies to Scala 2 — Scala 3 has way better enumerations. Should you use Scala’s built in scala.Enumeration class, or roll your own sealed class objects? The answer depends on which you value more: having a single lightweight class, or better type safety. If you want to skip the detail, just know to use...
Read more…

Java 8 crib sheet for Scala developers

You’ve heard that Java 8 now has the main prerequisite for functional programming: functions. But you’re too busy writing Scala code to dig into the details, so we’ve put together a crib sheet on what’s in Java 8 from a Scala developer perspective. Lambda expressions The syntax for lambda expressions uses a thin arrow:...
Read more…

Fun with CRDTs

At the end of last year I had some fun implementing a CRDT. These are data structures designed to combine together when you have no control over order of changes, timing of changes, or the number of participants in the data structure. The example I looked at was a sequential datatype, namely the WOOT CRDT for...
Read more…

The appeal of the Lift Web Framework for Scala

Most of my writing effort has gone into The Lift Cookbook, and one thing I missed was why you might be interested in Lift. That’s now fixed, via a three-part series of short posts over at programming.oreilly.com: The Appeal of the Lift Web Framework: Transforms and REST. A Birds-eye View with Lift: Organize and control...
Read more…

Using Catalog Resolvers with scala.XML

If you need to resolve DTDs locally with the scala.xml parser, you should provide a resolveEntity to the XMLLoader adapter: import org.xml.sax.InputSource import xml.parsing.{NoBindingFactoryAdapter, FactoryAdapter} import xml.factory.XMLLoader import xml.Elem object ResolvingXML extends XMLLoader[Elem] { override def...
Read more…

Distributed Comet with Lift and Amazon SNS

We’ve published a Lift module to allow you to talk to Amazon SNS. SNS is Amazon’s pub/sub system, and the module lets you register a function to receive messages from an SNS topic, and send messages to SNS. The module just gives you the plumbing to send and receive messages, the config is in the project’s README. A...
Read more…

Updated Google Analytics Lift module for EU cookie law

Since I last wrote about this, the UK guidance for compliance (PDF) has been updated to note that “implied consent is a valid form of consent” for setting cookies. You may have noticed, as a consequence, web sites changing how they inform users about cookie policy. Dave Evans from the Information Commissioner’s Office,...
Read more…

Lift Cookbook: an introduction

I’m a fan of the format used by the O’Reilly Cookbook series: a problem statement, short solution, and then a discussion. Could this be a useful way to capture nuggets of knowledge about the Lift web framework? The only way to find out is to try to write a few recipes, so I did that last month and the result is up at...
Read more…

External Lift modules

An external module is one way to share lumps of code with the Lift community.  The word “external” indicates that these are distinct from the modules in the core Lift repository maintained by Lift comitters.  But the pattern to create a module is the same, as Peter outlined on the Lift Wiki and in one or two posts on...
Read more…