Feeding a function result into a pattern matching lambda expression in F#
May 28, 2017 4 Comments
Say we have an F# function that returns a tuple of two elements:
let isGreaterThan x y = if x > y then (true, x - y) else (false, 0)
…, i.e. we return true and the difference between the two input integers if the first integer is greater. Otherwise we return a false and a 0. Here’s how we can consume this function: