Runar Bjarnason has been exploring how writing in a functional style increases modularity and compositionality of software for many years. He is co-author of functional programming in scala, a book that teaches these principles in scala. It is a very challenging yet very rewarding book, sometimes referred to as simple ‘the red book’.
In this interview Runar explains how writing in a functional style involves limiting side effects, avoiding exceptions and using higher order abstractions. Writing in this style places constraints on what a module in a software system may do, but by constraining modules in this way, the software modules themselves become endlessly composable.