1
如何在F#中的參數中傳遞類型fun<'a>
?在參數中傳遞一個類型樂趣<'a>?
Example -> type myClass(a : int, myDelegate : fun<'a>)
let theFunc = myDelegate
如何在F#中的參數中傳遞類型fun<'a>
?在參數中傳遞一個類型樂趣<'a>?
Example -> type myClass(a : int, myDelegate : fun<'a>)
let theFunc = myDelegate
我想你想
type mytype<'a> (a:int,myDelegate:'a->unit) =
let theFunc = myDelegate
另外,如果fun
是在其他地方,你將需要使用反引號標記爲fun
定義了一些類型在F#
type mytype<'a> (a:int,myDelegate:``fun``<'a>) =
let theFunc = myDelegate
精彩的保留字。 .. 非常感謝 !! – user2106839 2013-02-25 10:45:53
@ user2106839 - 如果這是正確的,請點擊綠色勾號將其標記爲已接受。 – 2013-02-25 20:07:11