1+ // <Snippet1>
2+ open System
3+ open System.Globalization
4+
5+ let showTypeInfo ( t : Type ) =
6+ printfn $" Name: {t.Name}"
7+ printfn $" Full Name: {t.FullName}"
8+ printfn $" ToString: {t}"
9+ printfn $" Assembly Qualified Name: {t.AssemblyQualifiedName}\n "
10+
11+ typeof< String>
12+ |> showTypeInfo
13+
14+ ( typeof< ResizeArray<_>>) .GetGenericTypeDefinition()
15+ |> showTypeInfo
16+
17+ let list = ResizeArray< String>()
18+ list.GetType()
19+ |> showTypeInfo
20+
21+ let v : obj = 12
22+ v.GetType()
23+ |> showTypeInfo
24+
25+ typeof< IFormatProvider>
26+ |> showTypeInfo
27+
28+ let ifmt = NumberFormatInfo.CurrentInfo
29+ ifmt.GetType()
30+ |> showTypeInfo
31+
32+ let o = Some 3
33+ o.GetType()
34+ |> showTypeInfo
35+
36+ // The example displays output like the following:
37+ // Name: String
38+ // Full Name: System.String
39+ // ToString: System.String
40+ // Assembly Qualified Name: System.String, mscorlib, Version=4.0.0.0, Culture=neutr
41+ // al, PublicKeyToken=b77a5c561934e089
42+ //
43+ // Name: List`1
44+ // Full Name: System.Collections.Generic.List`1
45+ // ToString: System.Collections.Generic.List`1[T]
46+ // Assembly Qualified Name: System.Collections.Generic.List`1, mscorlib, Version=4.
47+ // 0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
48+ //
49+ // Name: List`1
50+ // Full Name: System.Collections.Generic.List`1[[System.String, mscorlib, Version=4
51+ // .0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
52+ // ToString: System.Collections.Generic.List`1[System.String]
53+ // Assembly Qualified Name: System.Collections.Generic.List`1[[System.String, mscor
54+ // lib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorl
55+ // ib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
56+ //
57+ // Name: Int32
58+ // Full Name: System.Int32
59+ // ToString: System.Int32
60+ // Assembly Qualified Name: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutra
61+ // l, PublicKeyToken=b77a5c561934e089
62+ //
63+ // Name: IFormatProvider
64+ // Full Name: System.IFormatProvider
65+ // ToString: System.IFormatProvider
66+ // Assembly Qualified Name: System.IFormatProvider, mscorlib, Version=4.0.0.0, Cult
67+ // ure=neutral, PublicKeyToken=b77a5c561934e089
68+ //
69+ // Name: NumberFormatInfo
70+ // Full Name: System.Globalization.NumberFormatInfo
71+ // ToString: System.Globalization.NumberFormatInfo
72+ // Assembly Qualified Name: System.Globalization.NumberFormatInfo, mscorlib, Versio
73+ // n=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
74+ //
75+ // Name: FSharpOption`1
76+ // Full Name: Microsoft.FSharp.Core.FSharpOption`1[[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
77+ // ToString: Microsoft.FSharp.Core.FSharpOption`1[System.Int32]
78+ // Assembly Qualified Name: Microsoft.FSharp.Core.FSharpOption`1[[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
79+ // </Snippet1>
0 commit comments