This repository is a collection of .NET Interactive notebooks that serve as F# implementations and annotations of the various types, functions, and questions and their responses found in the wonderful book The Little MLer by Matthias Felleisen and Daniel P. Friedman.
Just click on and browse the notebooks for the various chapters to get a taste. GitHub renders the F# notebooks in any browser, so you can view the notebooks without installing any code. You can even press .
while viewing this repository, and GitHub will open up a web-based Visual Studio Code instance, so you can view the code that way as well. Try it!
Note: This repository is in progress of converting the old F# script files to notebooks and finishing all the chapters.
The book's code is closest to Standard ML (SML), as explained on page xiii, and there is some guidance on using Objective Caml (OCaml) with the book, as explained on pages xv - xvi. While both SML and OCaml are wonderful languages, these days, F# has some features that makes it a wonderful tool to go through The Little MLer with.
- F# is heavily inspired by SML and OCaml and originally was basically a port of OCaml to .NET. These days, it is its own language though.
- F# is easier to install on any operating system. F# is fully cross-platform and is not Windows only, and it runs equally well on all three OSes of Windows, macOS, and Linux.
- F# is more widely supported. Since F# is a .NET language, it benefits from the huge amount of effort going into .NET, both for the runtime, the framework, and libraries developed in .NET languages.
- F# has a wider variety of high quality development environments.
- Windows: Visual Studio Community
- macOS: Visual Studio for Mac
- Windows, macOS, Linux:
- Notebooks are the best way to provide executable code that follows a book or a topic, and F#'s notebooks are easy to use on any OS. This could be the primary reason for using F#.
- F# is a cleaner language. This may be subjective, but there is some objective truth to it. SML and OCaml have some features that F# does't have, and vice versa, but overall, F# has a cleaner and more consistent and modern syntax.
Hopefully this repository helps in two ways:
-
Allows you to enjoy the ideas found in The Little MLer
-
Gets you familiar with idiomatic F# code and also F# notebooks
And hopefully you'll go on to write and use F# even more!
-
Install .NET 6 or higher. This installs F#, and you can test that after instllation .NET with
dotnet fsi
to enter into F# Interactive (FSI). -
Install the .NET Interactive Notebooks extension for VS Code
That's it! Just three installers that should take just a few minutes, and you can view, edit, and run the notebooks in this repository without issue.