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

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:

 

Learn to build Production-Ready Serverless applications

Want to learn how to build Serverless applications and follow best practices? Subscribe to my newsletter and join over 3,000 AWS & Serverless enthusiasts who have signed up already.
As a BONUS, you will receive early access and discount for my new AppSync course.

Leave a Comment

Your email address will not be published.