Partial Application
Warning, novice functional thinker here. If you know your stuff, what follows may cause distress.
I was messing with F# last night and I got a gentle reminder that I’m still a long way from thinking functionally, it still takes a lot of effort.
I started with this
let evens r = List.filter (fun x -> x % 2 = 0) r
> evens [0..10];;
val it : int list = [0; 2; 4; 6; 8; 10]
Simple enough. Even numbers are multiples of 2. Rekindling childhood memories of typing code from books by Tim Hartnell into a ZX81, I did what I would have done then. I tried to make the code do something slightly more complicated. What about a function that can find multiples of any number, not just 2.