This repository contains course material for the course 'SM2-TES: Functional Programming and Property-Based Testing' held at the University of Southern Denmark, Spring 2021.
A minimal example of QCheck, ocamlfind, and ocamlbuild
Screencast illustrating the regular toplevel
Screencast illustrating ocamlbuild and Makefiles
Both utop
and the ocaml
read-eval-print loop accepts a number of "directives"
documented in the manual, chapter 10.2.
These are strictly speaking not part of the OCaml language - just helpful instructions to the interactive interpreters. As such, I wouldn't put them in source code.
-
#use "filename.ml";;
loads OCaml source code into the read-eval-print loop. It stops on the first error. -
#show identifier;;
prints the type of a variable or module. -
#use "topfind";;
loads a helper program to easily load packages.topfind
is loaded automatically byutop
.After loading
topfind
additional directives are available:-
#require "packagename";;
for loading a package, e.g.,qcheck
. -
#list;;
prints a list of installed packages
-
-
...
Here's some example uses of OCaml:
-
MirageOS is a library for creating unikernel operating systems in OCaml
-
NetHSM from Nitrokey is an open source HSM based on OCaml and MirageOS
-
The Tezos blockchain is implemented in OCaml
-
Facebook uses OCaml in a number of open source projects:
-
Microsoft uses OCaml:
- Infer# is a C# analysis frontend for Facebook's Infer
- The static device driver verifier was written in OCaml
-
ARM has built a Architecture Specification Language interpreter in OCaml
-
Astrée from AbsInt is a static analysis tool written in OCaml. It is used to analyze and prevent errors, e.g., in Airbus software
-
...
The Wikipedia page for OCaml also lists users of OCaml.
ocaml.org maintains a list of companies that use OCaml.