Functional Programming for the Masses
Anil Madhavapeddy, Yaron Minsky

#OCaml
#Programming
#GADT
This fast-moving tutorial introduces you to OCaml, an industrial-strength programming language designed for expressiveness, safety, and speed. Through the book's many examples, you'll quickly learn how OCaml stands out as a tool for writing fast, succinct, and readable systems code using functional programming. Real World OCaml takes you through the concepts of the language at a brisk pace, and then helps you explore the tools and techniques that make OCaml an effective and practical tool. You'll also delve deep into the details of the compiler toolchain and OCaml's simple and efficient runtime system. This second edition brings the book up to date with almost a decade of improvements in the OCaml language and ecosystem, with new chapters covering testing, GADTs, and platform tooling. This title is also available as open access on Cambridge Core, thanks to the support of Tarides. Their generous contribution will bring more people to OCaml.
Table of Contents
Part I Language Concepts
A Guided Tour
Variables and Functions
Lists and Patterns
Files, Modules, and Programs
Records
Variants
Error Handling
Imperative Programming
GADTs
Functors
First-Class Modules
Objects
Part II Tools and Techniques
Maps and Hash Tables
Command-Line Parsing
Concurrent Programming with Async
Testing
Handling JSON Data
Parsing with OCamllex and Menhir
Data Serialization with S-Expressions
The OCaml Platform
Part Ill The Compiler and Runtime System
Foreign Function Interface
Memory Representation of Values
Understanding the Garbage Collector
The Compiler Frontend: Parsing and Type Checking
The Compiler Backend: Bytecode and Native code
Anil Madhavapeddy is Associate Professor in the Department of Computer Science and Technology at the University of Cambridge. He has used OCaml professionally for over two decades in numerous ventures, such as XenSource/Citrix and Unikernel Systems/Docker, and co-founded the MirageOS unikernel project. He is a member of the OCaml development team.
Yaron Minsky is Co-head of Technology at Jane Street, a major quantitative trading firm, where he introduced OCaml, and helped it become the firm's primary development platform. He is also the host of Jane Street's tech podcast, Signals & Threads, and has worked on everything from developer tools to trading strategies.









