Learn ML with Real Code Examples
Updated Nov 20, 2025
Learning Path
Learn basic functional programming concepts
Understand type inference and polymorphism
Practice recursive algorithms and pattern matching
Explore modules, signatures, and functors
Develop small compiler or symbolic computation projects
Skill Improvement Plan
Week 1: Basic expressions, let-bindings, and recursion
Week 2: Pattern matching and lists
Week 3: Algebraic data types and higher-order functions
Week 4: Modules, functors, and larger projects
Interview Questions
What is type inference in ML?
Explain pattern matching in function definitions
How do ML modules and functors work?
What are algebraic data types?
When would you choose ML over another language?
Cheat Sheet
val x = 5
fun factorial n = if n=0 then 1 else n * factorial(n-1)
datatype tree = Leaf | Node of int * tree * tree
fun sumTree Leaf = 0 | sumTree (Node(v,l,r)) = v + sumTree l + sumTree r
structure Stack = struct val s = ref [] end
Books
Programming in Standard ML by Robert Harper
ML for the Working Programmer by Lawrence C. Paulson
Introduction to Functional Programming using ML by Richard Bird
Tutorials
Programming in Standard ML
OCaml for Beginners
Functional Programming with ML
Official Docs
SML/NJ User’s Guide
OCaml Manual
MLton Compiler Documentation
The Definition of Standard ML
Academic papers by Robin Milner
Community Links
SML/NJ mailing lists
OCaml Discourse forums
GitHub repositories for ML projects
Academic workshops on functional programming
Functional programming conferences
Community Support
SML/NJ mailing lists and forums
OCaml and F# communities
Theoretical CS and functional programming conferences
Academic papers and textbooks
GitHub repositories for ML projects