F# – specifying a discriminated union clause generic unit of measure

Presently sponsored by Serverless Guru: Your guide to cloud excellence, helping you every step of your serverless journey, including team training, pattern development, mass service migrations, architecting, and developing new solutions. Speak to a Guru today.

You can specify a function which can take in a numeric value with a generic unit of measure easily enough:

image

Similarly, you can also specify a discriminated union whose clauses can be of a numeric value with a generic unit of measure, like this:

Leave a Comment

Your email address will not be published. Required fields are marked *