How to enable F# in Linux and Mac OS X
This article mainly introduces how to enable flip in Linux and Mac OS X, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.
The first step is to install the .NET Core tools. This step is the same for C # and F #, and this tool is dedicated to .NET rather than other specific languages.
A basic F# project needs to be created using the following CLI directives:
Dotnet new-lang f #
The resulting project file is an Json file that follows the latest project file format introduced in NuGet 3. The project.json file of a newly created F# project contains the basic dependencies for compiling and running a program:
{"version": "1.0.0 true *", "compilationOptions": {"emitEntryPoint": true}, "compilerName": "fsc", "compileFiles": ["Program.fs"], "dependencies": {"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221", "NETStandard.Library": "1.0.0-rc2-23811"} "frameworks": {"dnxcore50": {}
Dependency sets are not included when the project is created. The only step you need to do before executing programs is to restore them:
Dotnet restoredotnet run
The steps described above are the most basic steps required to compile and run an F# program on the .NET Core. Cross-platform IDEs Visual Studio Code and Atom provide support for F# through the open source extension Ionide. In addition, some common IDE features, such as autocompletion and Ionide, include:
F# interactive (REPL) platform
Package management through Paket
Use FAKE for target creation
Using F# Yeoman Generator to build a project
It is worth noting that while running the F# project, .Net CLI and .net Core are in operation, as is the work of porting libraries to .net Core.
Thank you for reading this article carefully. I hope the article "how to enable F# in Linux and Mac OS X" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!