© 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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.