Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有一种与C#和#x27相当的语言;s在F#中使用T=X.Y.Z导入指令?_F# - Fatal编程技术网

是否有一种与C#和#x27相当的语言;s在F#中使用T=X.Y.Z导入指令?

是否有一种与C#和#x27相当的语言;s在F#中使用T=X.Y.Z导入指令?,f#,F#,在C#中,我可以通过编写 using Foo = Full.Name.Space.Of.My.TypeWithAVeryLongName; 从那时起,在代码文件中,我可以通过Foo而不是TypeWithAVeryLongName引用我的类型,并且无需导入.my的Full.Name.Space.of 如何更改F#中的open…指令以实现类似的功能?您可以声明: 只是一些额外的信息,如果你只是想为你的类型缩写泰勒伍德的答案是一个 如果要缩写(或更改)模块名称,可以使用: module Short=

在C#中,我可以通过编写

using Foo = Full.Name.Space.Of.My.TypeWithAVeryLongName;
从那时起,在代码文件中,我可以通过
Foo
而不是
TypeWithAVeryLongName
引用我的类型,并且无需导入.my的
Full.Name.Space.of

如何更改F#中的
open…
指令以实现类似的功能?

您可以声明:


只是一些额外的信息,如果你只是想为你的类型缩写泰勒伍德的答案是一个

如果要缩写(或更改)模块名称,可以使用:

module Short=MyVeryLong.Helpers.Container

其中命名空间定义为

模块MyVeryLong.Helpers.Container
位于另一个位置/file/dll。您可以将您的类型称为
Short.MyType

但这只适用于嵌套在命名空间中的模块。据我所知,您不能缩写纯粹的名称空间名称

type Foo = Full.Name.Space.Of.My.TypeWithAVeryLongName