Skip to content

F# implementations of the code in the book The Little MLer

Notifications You must be signed in to change notification settings

bmitc/the-little-fsharper

Repository files navigation

The Little F#er (The Little FSharper)

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.

Introduction

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.

  1. 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.
  2. 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.
  3. 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.
  4. F# has a wider variety of high quality development environments.
  5. 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#.
  6. 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.

Goals

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!

Installation process to run the notebooks

  1. 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).

  2. Install Visual Studio Code (VS Code)

  3. 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.

About

F# implementations of the code in the book The Little MLer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published