© Kit Eason 2018
Kit EasonStylish F#https://doi.org/10.1007/978-1-4842-4000-7_2

2. Designing Functions Using Types

Kit Eason1 
(1)
Farnham, Surrey, UK
 

When you remove layers, simplicity and speed happen.

—Ginni Rometty, CEO, IBM

Object Oriented (OO) programming is currently the dominant design approach in almost all software development. In OO, the natural unit of work is, unsurprisingly, the “object” or “class,” and design effort is focused on defining classes that have the right shapes, behaviors, and relationships for the tasks at hand. In F#, by contrast, the natural units of work are types, which describe the shape of data; and functions, units of code that take some (typed) input and produce some (typed) output in a predictable fashion. It ...

Get Stylish F#: Crafting Elegant Functional Code for .NET and .NET Core now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.