是否有用于.NET的功能编程库?

时间:2020-03-05 18:59:00  来源:igfitidea点击:

例如,在Java中有功能Java和高阶Java。两者本质上都提供了一个用于处理高阶咖喱函数的小型API,并且可能还提供了一些新的数据类型(元组,不可变列表)。

解决方案

回答

我想你要F#

另外,Chave的最新版本在基本语言中包含了许多功能概念。

回答

F#,Microsoft提供了CTP版本。

回答

可能有这样的C#库,但是我们可能应该考虑只使用Fhttp://research.microsoft.com/fsharp/fsharp.aspx和http://msdn.microsoft.com/zh-cn/fsharp/default。 aspx。

微软计划在Visual Studio中制作Fa一流的语言,因此使用其中一个CTP来构建初始内容的风险应该很小。

回答

如果我们正在寻找可以扩展Cthen no的功能,那么可以使用F哪一种基于.NET的功能语言。在"关于F#"页面上:

F# is a typed functional programming language for the .NET Framework. It combines the succinctness, expressivity, and compositionality of typed functional programming with the runtime support, libraries, interoperability, tools and object model of .NET. F# stems from the ML family of languages and has a core language compatible with that of OCaml, though also draws from C# and Haskell. F# was designed from the ground up to be a first-class citizen on .NET, giving smooth interoperability with other .NET languages. For example, C# and F# can call each other directly. This means that F# has immediate access to all the .NET Framework APIs, including, for example, Windows Presentation Foundation and DirectX. Similarly, libraries developed in F# may be used from other .NET languages. 
  
  Since F# and OCaml share a similar core language, some OCaml libraries and applications can cross-compile either directly or with minor conditionally-compiled changes. This provides a path to cross-compile and/or port existing OCaml code to .NET, and also allows programmers to transfer skills between these languages. A major focus of the project has been to extend the reach of OCaml-like languages into arenas where they have not traditionally been used. Throughout the project the designers of F# are grateful for the support and encouragement of Xavier Leroy and others in the OCaml community.

回答

你看过F#吗?

还将在这里发布整洁的博客文章,讨论如何使用c3.0中内置的新的generic / lambda表达式。

如果仅使用System.Linq将其添加到源文件的顶部,则会添加很多不错的新功能来处理集合,例如折叠/过滤等。

回答

本身不是一个收缩包装的库,但是微软的Luca Bolognese有一系列博客文章,他在其中构建了一个库,用于使用元组,记录,类型联合等类型进行功能编程:

另外,Linq基本上是一个使用C#进行语法支持的函数式编程库。

回答

请查看http://code.msdn.microsoft.com/FunctionalCSharp中的一些示例。

回答

假设我们出于某种原因不能使用F,而只想在Ccode中使用功能性范例和习惯用法来提高质量和可靠性:

C#的功能样式模式匹配

C#/。Net的Monad库

还有" elevate",其中包含一些功能,例如选项类型(可能)等。