Installing F# is straight forward as it is included in Dotnet CLI.
Dotnet CLI is also used for building, dependency management, and for testing. It can be downloaded with Brew/Casks.
Assuming brew is installed:
brew update
brew tap caskroom/cask
brew cask install dotnet-sdkIf you prefer not to use homebrew casks, dotnet-sdk can be downloaded and installed from Microsoft:
https://www.microsoft.com/net/learn/get-started/macos
In terms of IDEs, Visual Studio Mac, Visual Studio Code, and JetBrains Rider are all good.
I prefer Visual Studio Code with the Ionide packages installed, as the type annotations and introspection are top notch.
Visual Studio Code can be installed with brew casks.
brew cask install visual-studio-codeIonid-fsharp can be installed from the Visual Studio Code command palette.
Launch Command Pallete ⌘ + p
ext install Ionide-fsharpTo play the TicTacToe, from the home directory run:
./play.shNUnit is used for testing. From the root directory of the project run:
./test.shThere are five dependencies, all used for test driven development, four for NUnit, and one test watcher.
As with Scala and Ocaml, F# can be written with classes or without, and can have mutation.
I have chosen to only use mutation in testing for mocks. Types and Functions are favored over classes, with name spacing provided by modules.
Where ever possible pattern matching and pipes are favored over if/else blocks, and partial application is kept to a minimum to help convey intent.