Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use namespace or type alias/abbreviation?

Tags:

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

using NR = ICSharpCode.NRefactory;

like image 275
Stefan Savev Avatar asked Oct 12 '10 20:10

Stefan Savev


People also ask

What is a namespace alias?

Namespace aliases allow the programmer to define an alternate name for a namespace. They are commonly used as a convenient shortcut for long or deeply-nested namespaces.

How will you alias a namespace write an example?

Namespace Alias Qualifier(::) makes the use of alias name in place of longer namespace and it provides a way to avoid ambiguous definitions of the classes. It is always positioned between two identifiers. The qualifier looks like two colons(::) with an alias name and the class name. It can be global.

What is type alias in c#?

Type aliasing is a little known feature for C# and it comes in handy when you would like to alias a specific method or class from a namespace for the sake of clarity. At the heart of these features is the using keyword.

Can we create alias of a namespace in C#?

You can also create an alias for a namespace or a type with a using alias directive.


1 Answers

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

like image 121
desco Avatar answered Oct 11 '22 19:10

desco