Notes: OCaml from the Very Beginning by John Whitington
Posted on October 2, 2018
by jcb
Contents
- Chapter 01: Starting Off
- Chapter 02: Names and Functions
- Chapter 03: Case by Case
- Chapter 04: Making Lists
- Chapter 05: Sorting Things
- Chapter 06: Functions upon Functions upon Functions
- Chapter 07: When Things Go Wrong
- Chapter 08: Looking Things Up
- Chapter 09: More with Functions
- Chapter 10: New Kinds of Data
- Chapter 11: Growing Trees
- Chapter 12: In and Out
- Chapter 13: Putting Things in Boxes
- Chapter 14: The Other Numbers
- Chapter 15: The OCaml Standard Library
- Chapter 16: Building Bigger Programs
Preliminaries: Getting Ready
Since I’m running NixOS:
$ nix-env -iA nixos.ocaml
$ ocaml
This book seems mostly designed to be done from the REPL for the first parts. The default OCaml REPL is a little bare-bones (doesn’t even have arrow keys), so in Chapter 05: Sorting Things I wrote a default.nix
to bring in utop
, which is a nice wrapper that makes the REPL much more usable.