I think you need to provide a longer example showing how you want to use this list. Otherwise, it is difficult to give a good answer, because it depends on the use.
If you just want to create a list of numbers representing different things, then you can use the discriminated union to distinguish between them:
type Numeric = | Length of float<mm> | Time of float<ms> | Unitless of float let myList = [ Time 0.07<ms>; Unitless 0.9; Length 7.2<mm>;]
Then you can create a list containing different numbers (with different physical values). When repeating through a list, you will need to use pattern matching to retrieve the value.
Alternatively, you can simply discard all units when creating the list, but then you lose the guarantees provided by the units (this means that when you get some value from the list, you will not know what the unit is, and you may interpret it incorrectly):
let myList = [ float 0.07<ms>; 0.9; float 7.2<mm>;]
You can also use the F # library, which allows you to track devices at runtime .
source share