![]() Because F# uses Type Inference, the type of x doesn't need to be specified. In the previous code sample, a function square has been defined which takes an input named x and multiplies it by itself. Printfn "%d squared is: %d!" 12 (square 12) Make sure that the Program.fs file is open, and then replace its contents with the following: module HelloSquare Let's get started by writing some code first. You should now see an F# project in the Solution Explorer. Notice, the preview pane to the side of the screen that will show the directory structure that will be created based on the options selected.Ĭlick Create. Give your project a name, and choose the options you want for the app. Under console app, change C# to F# if needed. Either template should work for the purpose of this article. In the New Project dialog, there are 2 different templates for Console Application. One of the most basic projects in Visual Studio for Mac is the Console Application. Ensure that you have Visual Studio for Mac installed. F# is supported in the Visual Studio for Mac IDE.
0 Comments
Leave a Reply. |