I have some nested Discriminated Unions
type Job = Sniff | Guard
type Dog = Chihuahua | GermanShepherd of Job
Here's a function that takes a Dog and returns a string.
let dogPrinter d =
match d with
| Chihuahua -> ""
| GermanShepherd g ->
match g with
| Sniff -> ""
| Guard -> ""
I can convert the first match to the function syntax:
let dogPrinter = function
| Chihuahua -> ""
| GermanShepherd g ->
match g with
| Sniff -> ""
| Guard -> ""
How can I convert the second match to function?