This repository contains the presentation materials and sample code for the Functional Programming Patterns presentation. Here's the abstract:
Have you ever peeked over the fence into functional programming land and gazed into a seemingly alien landscape of weird symbols and crazily named concepts? Has your curiosity about functional programming been stymied by complicated words and abstractions? If so, this talk is for you.
We’re going to take a practical, example-based journey through complex-sounding but deceptively simple functional patterns such as functors, applicatives and the big bad monad. We’ll see how these patterns work, what they’re for and how they are used to make clean, composable code. We’ll also identify the places where functional patterns are quietly being used in our mainstream day to day languages. By the end of the talk, you will be better equipped to take further steps down the functional programming path of enlightenment.
There are two versions of the slides, one done for NDC Sydney 2017, which was a one hour talk, and a cut down 45 minute version for DDD Melbourne 2017.
Video: NDC Sydney 2017
To get the args-example
sample code up and running, you will need:
- Haskell Stack - to compile the code
- Atom (optional) - to browse the Haskell code
- IDE-Haskell (optional) - Atom plugin to support Haskell (make sure to read the Requirements section of their readme). To install GHC-Mod with Stack, use
stack build ghc-mod
inside theargs-example
directory.
To build the example, run stack install
. args-example-exe
will then be on your path to execute.
To get the fparsec-example
sample code up and running, you will need:
- Visual Studio 2015 (with Visual F# Tools)
You can then build and run the project as normal.
Scott Wlashin's FSharp for Fun and Profit website contains many useful articles. Two specifically to look at are:
The Haskell Programming from First Principles book is highly recommended as a comprehensive introduction to functional programming in Haskell, and has very complete chapters that walk you through functors, applicatives and monads.