F# 入门

要求

默认情况下,F# 包含在 Visual Studio for Mac 中。

在 Windows 上,必须按照 FSharp.org 站点上的说明安装独立的 F# 编译器工具。

创建 F# 项目

创建新的 F# 应用程序是在用于 C# 的同一“新建项目”窗口中完成的

在 Visual Studio for Mac 中,选择“文件”>“新建解决方案”。 在“新建项目”对话框中,选择项目模板。 使用模板右侧的下拉列表选择要使用的语言:

Use the drop-down to the right of the template to choose the language you wish to use

选择项目类型,然后单击“下一步”以命名并创建项目

现在可以开始创建一些出色的 F# 应用程序了!

了解如何使用 F#

也可以在 Visual Studio for Mac 的“新建解决方案”对话框中创建 F# 教程。 导航到“其他”>“.NET”>“F# 教程”,如下图所示

Navigate to Other / .NET / F# Tutorial

这将打开一个新的交互式解决方案。 通过探索可以很好地掌握语言基础知识。

Exploring this is a great way to get to grips with the basics of the language

查看示例列表,了解 F# 的实际应用。

参考

网上有大量信息可帮助快速掌握 F# 语言,覆盖所有熟练程度。 下面列出了一些建议: