Header Image

Jon Pretty

CEO @ Propensive

Jon has been involved in the Scala community for over a decade, having launched the first commercial and open-source Scala software back in 2005. Since then, he has successfully deployed Scala projects into small, medium and large businesses, and UK government, but is best known these days for his work on Rapture, the Scala World conference, and as chair of the Scala Center Advisory Board.

The Totalitarian Ideology of State Governance

We consider case classes and sealed traits to be Scala’s answers to product and coproduct types. But they’re not the only possible answer, and they come with their own choices: product types are ordered and indexed by labels, and coproducts are unordered and predefined.

Totalitarian is an experimental library which offers alternative type-level representations of products and coproducts in alternative forms: unordered products and coproducts, whose elements are indexed by a type, and which may be composed into ad-hoc combinations, without defining new classes.

These features open up a variety of new programming techniques in Scala, many of which facilitate and encourage the use of total functions. By eliminating partiality from our code with Totalitarian’s product and coproduct types, we can take advantage of Scala’s type system to help us write safer, more reliable code.

This talk will cover the basics of Totalitarian, how to use it, how it works, and where the experimental library may be going next.