Reputation: 21
How can I pass a type fun<'a>
in parameter in F#?
Example -> type myClass(a : int, myDelegate : fun<'a>)
let theFunc = myDelegate
Upvotes: 1
Views: 85
Reputation: 25526
I think you want
type mytype<'a> (a:int,myDelegate:'a->unit) =
let theFunc = myDelegate
Alternatively, if fun
is some type defined elsewhere you will need to use backtick notation as fun
is a reserved word in F#
type mytype<'a> (a:int,myDelegate:``fun``<'a>) =
let theFunc = myDelegate
Upvotes: 4