Yes, F# has its own reflection layer than sits on top .NETs reflect to provide the missing pieces where F# has extra concepts that .NET does not (i.e. union types, tuples etc.). Here's a quick sample to get you going:

1
2
3
4
5
6
7
8
9
10
11
12
13
#light
open Microsoft.FSharp.Reflection

let myList = [1; 2; 3;]

let t = Type.GetInfo (myList.GetType())

let main() =
    match t with
    | SumType items -> List.iter (fun (name, _) -> printfn "%s" name) items
    | _ -> failwith "not supported"
    
main()
By on 3/3/2008 12:56 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper