mercredi 9 novembre 2016

In F# how do you get the parameters for a function?

Given a list of functions, how do you extract a list containing the type of the first parameter for each function in the list?

The list is defined as:

let methods = [
    fun (param1: MyRecordType) -> ()
]

The list of types could then be defined as:

let magic x = (* x.GetType().PleaseGetTheParameters? *)

let types = List.map magic methods

I would have expected a list called Parameters or something similar on the FSharpFunc however I can't find one.





Aucun commentaire:

Enregistrer un commentaire