Tutorials
Explore OJaml
Learn through a guided exercise with a concrete checkpoint.
Work through this exercise in order. The checkpoint tells you what to observe before you move to the detailed reference.
1. Open the browser editor at /ojaml. You need a browser with WebAssembly support; the compiler executes locally.
2. Replace the source with the small program below and run it. Read the captured output before changing the program.
3. Hover over n and square to inspect the inferred types. Change square 9 to square 2.5 and run again. This exercises the distinction between integer and floating-point representations.
4. Checkpoint: the first program prints 81. Now replace the argument with a string. The checker should report a type conflict before the program reaches WebAssembly execution.
let square n = n * n
let main = println (square 9)