Lesson 13. Achieving code reuse in F#

We’re going to change tack a little in this lesson, and look at using functions (and type inference) in F# to create lightweight code reuse, and to pass functionality (rather than data) through a system. If you’ve used the LINQ framework at all, much of this lesson will be familiar to you. We’ll cover

  • How we tend to achieve reuse in the OO world
  • A quick review of the core parts of LINQ
  • Implementing higher-order functions in F#
  • Dependencies as functions

We always look to reuse code in our applications, because copy-and-paste is evil—right? Unfortunately, you know as well as I do that reuse at a low cost is sometimes really hard to achieve! There are many types of code reuse that we strive to achieve; ...

Get Get Programming with F#: A guide for .NET developers now with O’Reilly online learning.

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