The focus of the talk is to emphasize the importance of algebraic thinking when designing pure functional domain models. The talk begins with the definition of an algebra as consisting of a carrier type, a set of operations/functions and a set of laws on those operations. Using examples from the standard library, the talk shows how thinking of abstractions in terms of its algebra is more intuitive than discussing its operational semantics. The talk also discusses the virtues of parametricity and compositionality in designing proper algebras. Algebras are compositional and help build larger algebras out of smaller ones. We start with base level types available in standard libraries and compose larger programs out of them. We take a real life use case for a domain model and illustrate how we can define the entire model using the power of algebraic composition of the various types. We talk about how to model side-effects as pure abstractions using algebraic effects. At no point we will talk about implementations. At the end of the talk we will have a working model built completely out of the underlying algebra of the domain language.
Algebraic Thinking for evolution of pure functional domain models
Programmer, father, husband, avid reader, author, occasional speaker at technology conferences and Seinfeld fanboy. Senior member of ACM and loves spending time with his beautiful family. Passionate about technology and open source, loves functional programming, and has been trying to learn math and machine learning. Authored 2 books - (a) DSLs In Action published by Manning in December 2010 and (b) Functional & Reactive Domain Modeling (upcoming fall 2015 from Manning). Tweets at @debasishg, blogs at Ruminations of a Programmer.