[英]F# interface specifying a generic return type
如何在 F# 中完成以下 C#
public interface IExample
{
int GetInteger();
T GetAnything<T>();
}
F# 翻譯將是這樣的
type IExample =
interface
abstract member GetInt: unit -> int
abstract member GetAnything: unit -> 'T
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.