Moggi documentation

Documentation

Read the path in order. Each page ends where the next begins, and each marks the point where the beginner material stops: a section headed Advanced can wait until you need it. You can stop after any step and still write working programs.

  Page After it you can…
1 quickstart.md install Moggi, run a program, build a .phar / .jar / .dll or a native executable, run the examples
2 tour.md read real code: modules, values, data types, classes, IO, failure, a first host call
3 types/data-types.md model a problem as data and take it apart with patterns
4 types/polymorphism.md read a signature, know when inference needs help, fix a type error
5 types/classes.md and deriving.md write instances, constrain a function, derive Show/Eq/Ord
6 effects/io.md write a program that reads input, writes output and keeps its pure parts pure
7 repl.md and stdlib.md try an expression, ask for a type, find a library function

The type system is the same material indexed by concept, with the pages beyond the path — kinds, higher-kinded types, type-level data, generic programming — all written for a reader who has finished step 6.

Reference

Page Contents
language.md complete syntax — every construct, pragma and rule
ffi.md calling PHP, the JVM or .NET
host-packages.md using Composer, Maven and NuGet libraries from Moggi
diagnostics.md compiler messages, uncaught-exception reports, source maps
formatting.md canonical layout, moggi format
pipeline.md inspecting a build: tokens, AST, IR, cache, unpacked output
api-docs.md doc comments, moogle search by name or type, mogdoc HTML and live server
differences every observable behaviour that deliberately differs from Haskell
lsp.md the language server: editor setup, capabilities, limits
env-vars.md the environment variables the compiler, runtimes and tests read

Working on the compiler

Page Contents
development/index.md setup, build and test commands, repo layout, debugging
development/architecture.md phases, representation contracts, invariants, backend layout
development/testing.md the suite: commands, discovery, goldens, adding a case
development/optimizations.md the IR model, stage order, pass families, adding a pass
development/packaging.md CI, targets, distributions, runtimes, versions, signing

Moggi is released under the BSD 3-Clause License. The full text also ships as LICENSE at the root of every distribution; the licences of the bundled runtimes and of the C libraries bin/schnorr links are listed in THIRD-PARTY-NOTICES.md beside it.

Copyright © 2026 Sascha-Oliver Prolic.


Moggi compiles to PHP, the JVM and .NET. This site is generated from docs/ in the moggi-lang/moggi repository; the same pages are readable there as Markdown.