Lafros MaCS Programmable Devices: case study in type-safe API design using Scala (link) Rob Dickens
Lafros MaCS is an experimental Scala API for building distributed monitoring and control systems, and features reusable software modules known as Programmable Devices (PDs). Each such module provides a type-safe API for doing such things as registering a device-interface instance or writing a program to control the device. After introducing PDs, an explanation of how this type-safety is achieved, starting from the simplest of examples, then describing how various language features which Scala has to offer can play a part, will be followed by one of how the present framework was arrived at, to conclude.