@@ -9,15 +9,19 @@ open System
99
1010[<MeasureAnnotatedAbbreviation>] type bool <[< Measure >] 'm > = bool
1111[<MeasureAnnotatedAbbreviation>] type byte <[< Measure >] 'm > = byte
12+ [<MeasureAnnotatedAbbreviation>] type uint16 <[< Measure >] 'm > = uint16
1213[<MeasureAnnotatedAbbreviation>] type uint64 <[< Measure >] 'm > = uint64
1314[<MeasureAnnotatedAbbreviation>] type Guid <[< Measure >] 'm > = Guid
15+ [<MeasureAnnotatedAbbreviation>] type char <[< Measure >] 'm > = char
1416[<MeasureAnnotatedAbbreviation>] type string <[< Measure >] 'm > = string
1517[<MeasureAnnotatedAbbreviation>] type TimeSpan <[< Measure >] 'm > = TimeSpan
1618[<MeasureAnnotatedAbbreviation>] type DateTime <[< Measure >] 'm > = DateTime
1719[<MeasureAnnotatedAbbreviation>] type DateTimeOffset <[< Measure >] 'm > = DateTimeOffset
1820#if NET6_ 0_ OR_ GREATER
1921[<MeasureAnnotatedAbbreviation>] type DateOnly <[< Measure >] 'm > = DateOnly
2022[<MeasureAnnotatedAbbreviation>] type TimeOnly <[< Measure >] 'm > = TimeOnly
23+ #else
24+ [<MeasureAnnotatedAbbreviation>] type uint32 <[< Measure >] 'm > = uint32
2125#endif
2226
2327module private Unsafe =
@@ -32,59 +36,77 @@ type UMX =
3236
3337 static member inline tag <[< Measure >] 'm > ( x : bool ) : bool < 'm > = Unsafe.cast x
3438 static member inline tag <[< Measure >] 'm > ( x : byte ) : byte < 'm > = Unsafe.cast x
39+ static member inline tag <[< Measure >] 'm > ( x : sbyte ) : sbyte < 'm > = Unsafe.cast x
3540 static member inline tag <[< Measure >] 'm > ( x : int ) : int < 'm > = Unsafe.cast x
3641 static member inline tag <[< Measure >] 'm > ( x : int16 ) : int16 < 'm > = Unsafe.cast x
3742 static member inline tag <[< Measure >] 'm > ( x : int64 ) : int64 < 'm > = Unsafe.cast x
43+ static member inline tag <[< Measure >] 'm > ( x : uint16 ) : uint16 < 'm > = Unsafe.cast x
3844 static member inline tag <[< Measure >] 'm > ( x : uint64 ) : uint64 < 'm > = Unsafe.cast x
3945 static member inline tag <[< Measure >] 'm > ( x : float32 ) : float32 < 'm > = Unsafe.cast x
4046 static member inline tag <[< Measure >] 'm > ( x : float ) : float < 'm > = Unsafe.cast x
4147 static member inline tag <[< Measure >] 'm > ( x : decimal ) : decimal < 'm > = Unsafe.cast x
4248 static member inline tag <[< Measure >] 'm > ( x : Guid ) : Guid < 'm > = Unsafe.cast x
49+ static member inline tag <[< Measure >] 'm > ( x : char ) : char < 'm > = Unsafe.cast x
4350 static member inline tag <[< Measure >] 'm > ( x : string ) : string < 'm > = Unsafe.cast x
4451 static member inline tag <[< Measure >] 'm > ( x : TimeSpan ) : TimeSpan < 'm > = Unsafe.cast x
4552 static member inline tag <[< Measure >] 'm > ( x : DateTime ) : DateTime < 'm > = Unsafe.cast x
4653 static member inline tag <[< Measure >] 'm > ( x : DateTimeOffset ) : DateTimeOffset < 'm > = Unsafe.cast x
4754#if NET6_ 0_ OR_ GREATER
4855 static member inline tag <[< Measure >] 'm > ( x : DateOnly ) : DateOnly < 'm > = Unsafe.cast x
4956 static member inline tag <[< Measure >] 'm > ( x : TimeOnly ) : TimeOnly < 'm > = Unsafe.cast x
57+ static member inline tag <[< Measure >] 'm > ( x : uint ) : uint < 'm > = Unsafe.cast x
58+ #else
59+ static member inline tag <[< Measure >] 'm > ( x : uint32 ) : uint32 < 'm > = Unsafe.cast x
5060#endif
5161
5262 static member inline untag <[< Measure >] 'm > ( x : bool < 'm >) : bool = Unsafe.cast x
5363 static member inline untag <[< Measure >] 'm > ( x : byte < 'm >) : byte = Unsafe.cast x
64+ static member inline untag <[< Measure >] 'm > ( x : sbyte < 'm >) : sbyte = Unsafe.cast x
5465 static member inline untag <[< Measure >] 'm > ( x : int < 'm >) : int = Unsafe.cast x
5566 static member inline untag <[< Measure >] 'm > ( x : int16 < 'm >) : int16 = Unsafe.cast x
5667 static member inline untag <[< Measure >] 'm > ( x : int64 < 'm >) : int64 = Unsafe.cast x
68+ static member inline untag <[< Measure >] 'm > ( x : uint16 < 'm >) : uint16 = Unsafe.cast x
5769 static member inline untag <[< Measure >] 'm > ( x : uint64 < 'm >) : uint64 = Unsafe.cast x
5870 static member inline untag <[< Measure >] 'm > ( x : float32 < 'm >) : float32 = Unsafe.cast x
5971 static member inline untag <[< Measure >] 'm > ( x : float < 'm >) : float = Unsafe.cast x
6072 static member inline untag <[< Measure >] 'm > ( x : decimal < 'm >) : decimal = Unsafe.cast x
6173 static member inline untag <[< Measure >] 'm > ( x : Guid < 'm >) : Guid = Unsafe.cast x
74+ static member inline untag <[< Measure >] 'm > ( x : char < 'm >) : char = Unsafe.cast x
6275 static member inline untag <[< Measure >] 'm > ( x : string < 'm >) : string = Unsafe.cast x
6376 static member inline untag <[< Measure >] 'm > ( x : TimeSpan < 'm >) : TimeSpan = Unsafe.cast x
6477 static member inline untag <[< Measure >] 'm > ( x : DateTime < 'm >) : DateTime = Unsafe.cast x
6578 static member inline untag <[< Measure >] 'm > ( x : DateTimeOffset < 'm >) : DateTimeOffset = Unsafe.cast x
6679#if NET6_ 0_ OR_ GREATER
6780 static member inline untag <[< Measure >] 'm > ( x : DateOnly < 'm >) : DateOnly = Unsafe.cast x
6881 static member inline untag <[< Measure >] 'm > ( x : TimeOnly < 'm >) : TimeOnly = Unsafe.cast x
82+ static member inline untag <[< Measure >] 'm > ( x : uint < 'm >) : uint = Unsafe.cast x
83+ #else
84+ static member inline untag <[< Measure >] 'm > ( x : uint32 < 'm >) : uint32 = Unsafe.cast x
6985#endif
7086
7187 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : bool < 'm1 >) : bool < 'm2 > = Unsafe.cast x
7288 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : byte < 'm1 >) : byte < 'm2 > = Unsafe.cast x
89+ static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : sbyte < 'm1 >) : sbyte < 'm2 > = Unsafe.cast x
7390 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : int < 'm1 >) : int < 'm2 > = Unsafe.cast x
7491 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : int16 < 'm1 >) : int16 < 'm2 > = Unsafe.cast x
7592 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : int64 < 'm1 >) : int64 < 'm2 > = Unsafe.cast x
93+ static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : uint16 < 'm1 >) : uint16 < 'm2 > = Unsafe.cast x
7694 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : uint64 < 'm1 >) : uint64 < 'm2 > = Unsafe.cast x
7795 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : float < 'm1 >) : float < 'm2 > = Unsafe.cast x
7896 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : float32 < 'm1 >) : float32 < 'm2 > = Unsafe.cast x
7997 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : decimal < 'm1 >) : decimal < 'm2 > = Unsafe.cast x
8098 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : Guid < 'm1 >) : Guid < 'm2 > = Unsafe.cast x
99+ static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : char < 'm1 >) : char < 'm2 > = Unsafe.cast x
81100 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : string < 'm1 >) : string < 'm2 > = Unsafe.cast x
82101 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : TimeSpan < 'm1 >) : TimeSpan < 'm2 > = Unsafe.cast x
83102 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : DateTime < 'm1 >) : DateTime < 'm2 > = Unsafe.cast x
84103 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : DateTimeOffset < 'm1 >) : DateTimeOffset < 'm2 > = Unsafe.cast x
85104#if NET6_ 0_ OR_ GREATER
86105 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : DateOnly < 'm1 >) : DateOnly < 'm2 > = Unsafe.cast x
87106 static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : TimeOnly < 'm1 >) : TimeOnly < 'm2 > = Unsafe.cast x
107+ static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : uint < 'm1 >) : uint < 'm2 > = Unsafe.cast x
108+ #else
109+ static member inline cast <[< Measure >] 'm1 , [< Measure >] 'm2 > ( x : uint32 < 'm1 >) : uint32 < 'm2 > = Unsafe.cast x
88110#endif
89111
90112
0 commit comments