开发者

The different ways to specify a generic type

According to the section here on generic types: http://msdn.microsoft.com/en-us/library/dd233230.aspx then these forms are equivalent:

type 'a MyType = ....

type MyType<'a> = ...

but the 2nd form allows you to specify a list of type parameters, eg:

type MyType开发者_StackOverflow社区<'a,'b> = ...

Is this right?


That's right. There is a way to supply multiple parameters in the first style too:

('a,'b) MyType

but this is for compatibility and is not recommended.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜