The OCaml system
release 4.10
Documentation and user’s manual
Xavier Leroy,
Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon
February 21, 2020
Copyright © 2020 Institut National de Recherche en Informatique et en Automatique
release 4.10
Documentation and user’s manual
Xavier Leroy,
Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon
February 21, 2020
Copyright © 2020 Institut National de Recherche en Informatique et en Automatique
This manual is also available in PDF. plain text, as a bundle of HTML files, and as a bundle of Emacs Info files.
Contents
-
Part I An introduction to OCaml
- Chapter 1 The core language
- Chapter 2 The module system
- Chapter 3 Objects in OCaml
- 1 Classes and objects
- 2 Immediate objects
- 3 Reference to self
- 4 Initializers
- 5 Virtual methods
- 6 Private methods
- 7 Class interfaces
- 8 Inheritance
- 9 Multiple inheritance
- 10 Parameterized classes
- 11 Polymorphic methods
- 12 Using coercions
- 13 Functional objects
- 14 Cloning objects
- 15 Recursive classes
- 16 Binary methods
- 17 Friends
- Chapter 4 Labels and variants
- Chapter 5 Polymorphism and its limitations
- Chapter 6 Advanced examples with classes and modules
- Part II The OCaml language
- Chapter 7 The OCaml language
- Chapter 8 Language extensions
- 1 Recursive definitions of values
- 2 Recursive modules
- 3 Private types
- 4 Locally abstract types
- 5 First-class modules
- 6 Recovering the type of a module
- 7 Substituting inside a signature
- 8 Type-level module aliases
- 9 Overriding in open statements
- 10 Generalized algebraic datatypes
- 11 Syntax for Bigarray access
- 12 Attributes
- 13 Extension nodes
- 14 Extensible variant types
- 15 Generative functors
- 16 Extension-only syntax
- 17 Inline records
- 18 Documentation comments
- 19 Extended indexing operators
- 20 Empty variant types
- 21 Alerts
- 22 Generalized open statements
- 23 Binding operators
- Part III The OCaml tools
- Chapter 9 Batch compilation (ocamlc)
- Chapter 10 The toplevel system or REPL (ocaml)
- Chapter 11 The runtime system (ocamlrun)
- Chapter 12 Native-code compilation (ocamlopt)
- Chapter 13 Lexer and parser generators (ocamllex, ocamlyacc)
- Chapter 14 Dependency generator (ocamldep)
- Chapter 15 The browser/editor (ocamlbrowser)
- Chapter 16 The documentation generator (ocamldoc)
- Chapter 17 The debugger (ocamldebug)
- 1 Compiling for debugging
- 2 Invocation
- 3 Commands
- 4 Executing a program
- 5 Breakpoints
- 6 The call stack
- 7 Examining variable values
- 8 Controlling the debugger
- 8.1 Setting the program name and arguments
- 8.2 How programs are loaded
- 8.3 Search path for files
- 8.4 Working directory
- 8.5 Turning reverse execution on and off
- 8.6 Behavior of the debugger with respect to fork
- 8.7 Stopping execution when new code is loaded
- 8.8 Communication between the debugger and the program
- 8.9 Fine-tuning the debugger
- 8.10 User-defined printers
- 9 Miscellaneous commands
- 10 Running the debugger under Emacs
- Chapter 18 Profiling (ocamlprof)
- Chapter 19 The ocamlbuild compilation manager
- Chapter 20 Interfacing C with OCaml
- 1 Overview and compilation information
- 2 The value type
- 3 Representation of OCaml data types
- 4 Operations on values
- 5 Living in harmony with the garbage collector
- 6 A complete example
- 7 Advanced topic: callbacks from C to OCaml
- 8 Advanced example with callbacks
- 9 Advanced topic: custom blocks
- 10 Advanced topic: Bigarrays and the OCaml-C interface
- 11 Advanced topic: cheaper C call
- 12 Advanced topic: multithreading
- 13 Advanced topic: interfacing with Windows Unicode APIs
- 14 Building mixed C/OCaml libraries: ocamlmklib
- 15 Cautionary words: the internal runtime API
- Chapter 21 Optimisation with Flambda
- 1 Overview
- 2 Command-line flags
- 3 Inlining
- 4 Specialisation
- 5 Default settings of parameters
- 6 Manual control of inlining and specialisation
- 7 Simplification
- 8 Other code motion transformations
- 9 Unboxing transformations
- 10 Removal of unused code and values
- 11 Other code transformations
- 12 Treatment of effects
- 13 Compilation of statically-allocated modules
- 14 Inhibition of optimisation
- 15 Use of unsafe operations
- 16 Glossary
- Chapter 22 Memory profiling with Spacetime
- Chapter 23 Fuzzing with afl-fuzz
- Part IV The OCaml library
- Chapter 24 The core library
- Chapter 25 The standard library
- Chapter 26 The compiler front-end
- Chapter 27 The unix library: Unix system calls
- Chapter 28 The num library: arbitrary-precision rational arithmetic
- Chapter 29 The str library: regular expressions and string processing
- Chapter 30 The threads library
- Chapter 31 The graphics library
- Chapter 32 The dynlink library: dynamic loading and linking of object files
- Chapter 33 The bigarray library
- Part V Appendix
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.