Accessing a specific member in a F# tuple

You want to prevent your wife from aging by making her age immutable? 🙂

For a tuple that contains only two members, you can fst and snd to extract the members of the pair.

let wifeName = fst myWife;
let wifeAge = snd myWife;

For longer tuples, you’ll have to unpack the tuple into other variables. For instance,

let _, age = myWife;;
let name, age = myWife;;

Leave a Comment