O'Reilly logo

Real-World Functional Programming with Examples in F# and C# by Jon Skeet, Tomas Petricek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Creating composable functional libraries

This chapter covers

  • Designing functional combinator libraries
  • Working with time-varying values
  • Composing time-varying values with drawings
  • Developing library for modeling financial contracts

A design principle that arises in many aspects of functional programming is compositionality. This means building complex structures from a few primitives using composition operations. We’re describing compositionality in a general sense because it can appear in countless forms. Let’s look at two examples you’re already familiar with.

We’ll begin with the F# type system: there are a few primitive types, such as integer and Boolean, as well as ways of combining them, such as using the * type constructor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required