Stefan Savev
Stefan Savev

Reputation: 1359

How to use namespace or type alias/abbreviation?

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

using NR = ICSharpCode.NRefactory;

Upvotes: 28

Views: 5715

Answers (2)

elmattic
elmattic

Reputation: 12174

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.

Upvotes: 7

desco
desco

Reputation: 16782

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

Upvotes: 49

Related Questions