concept measure in category f#

This is an excerpt from Manning's book Get Programming with F#: A guide for .NET developers.
Units of measure in F#
You’ll notice that listing 21.1 has a field called SizeGb of type int. One of the nice features of F# is units of measure. These allow you to quickly create a specific type of integer—similar to generics—to prevent accidentally mixing incompatible integers together (for example, GB and MB, or meters and feet). In our example, you might have used something like Size : int<gb>. We won’t be covering units of measure further, but I recommend looking into them in your own time.
Units of measure (UoM) are an incredibly useful feature of F#. The only reason they weren’t included in the book is that they’re not needed often. UoMs allow you to create a kind of “generic” numerics, so you can have 5<Kilogram> as opposed to 5<Meter>. You can also combine types, so you can model things such as 15<Meter/Second> and so on. It’s extremely useful because the compiler will prevent you from accidentally mixing and matching incompatible types. UoMs are erased away at compile time, so there’s no runtime overhead.

This is an excerpt from Manning's book F# Deep Dives.
The purpose of this example isn’t to show that F# is a perfect language for writing control systems for NASA probes. Units of measure can be used in ordinary business applications. For example, you can use them to distinguish between product prices (by defining dollar, or a currency unit) and ratios that are unit-less.

This is an excerpt from Manning's book Real-World Functional Programming with Examples in F# and C#.
In 1999 NASA’s Climate Orbiter was lost because part of the development team used the metric system and another part used imperial units of measure. A part of the team expected that distances were measured in meters and weight in kilograms, while the other part provided data in inches and pounds. This incident was one of the motivations for a new F# feature called units of measure, which allows us to avoid this kind of issue. We’ll talk about units of measure in chapter 13; here we want to use units of measure to demonstrate how type checking helps when writing F# code. We chose this example because it’s easy to explain, but the compile-time checking is present when writing any F# code.
Working with units of measure in F# is very easy, which is why we’ve introduced them as a brief digression in this chapter. We can declare a measure using the type keyword with a special attribute. Strictly speaking, a measure isn’t a type, but we can use it as part of another type. Let’s start by defining two simple measures to represent hours and kilometers:
[<Measure>] type km [<Measure>] type hAs you can see, we’re using the Measure attribute to specify that the type is a measure. This is a special attribute that the F# compiler understands. Instead of defining units ourselves, we could also use the standard set in the FSharp.PowerPack.dll library, but for now we’ll use our own declarations. Now that we have units km and h, we can create values that represent kilometers or hours. Listing 13.15 shows how to create values with units and how to write a function that calculates with them.
Listing 13.15. Writing calculations using units of measure (F#)
> let length = 9.0<km>;; ❶ val length : float<km> = 9.0 > length * length;; ❷ val it : float<km^2> = 81.0 > let distanceInTwoHours(speed:float<km/h>) = ❸ speed * 2.0<h>;; val distanceInTwoHours : float<km/h> -> float<km> ❹ > distanceInTwoHours(30.0<km/h>);; val it : float<km> = 60.0