How to use namespace or type alias/abbreviation?

北慕城南 提交于 2019-12-08 14:35:53

问题


What's the equivalent F# declaration to this C# declaration:

using NR = ICSharpCode.NRefactory;


回答1:


abbreviations in F# can be applied to modules:

module ES = Microsoft.FSharp.Quotations.ExprShape

and types

type Thread = System.Threading.Thread

unfortunatly just namespaces cannot be abbreviated




回答2:


Equivalent F# declaration would be:

type NR = ICSharpCode.NRefactory

In F# it's called a type abreviation: http://msdn.microsoft.com/en-us/library/dd233246.aspx

But ICSharpCode.NRefactory has to be here a type, as desco said just namespaces cannot be abbreviated.



来源:https://stackoverflow.com/questions/3918744/how-to-use-namespace-or-type-alias-abbreviation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!