- Formally verified: Machine-checked in Isabelle/HOL: well-typed programs never crash, and compilation preserves I/O behaviour down to the target code.
- Total by default: Function types carry their (named) effects - no unstated side-effects. Divergence is an effect too, so a pure type means a total function.
- Multi-shot handlers: A
handlerclause binds the resumption as an ordinary value. Call it once, many times, or never. - Modular implicits: Interfaces are signatures, instances are modules, nothing is canonical. Implicit arguments are elaborated from the instances in scope.
- Statically interpreted modules: ML signatures, functors and sealing, compiled away by static interpretation. Expressive abstraction without runtime indirection.
- Recursion schemes: Every
typegets anInductiveinstance from the compiler: a generic fold, with termination for free. - Layout syntax: UTF-8 source, user-defined operators, blocks by braces or by indentation. No preprocessor, no fixity tables.
- Separate compilation: One file compiles to one module. Modules link after compilation, nothing is recompiled twice.
Install your editor plugin, open a .caraml file and follow the dialog to
install the compiler (either download from release, or build from sources).
Install the extension from either
b4er.caraml(Visual Studio Marketplace), orb4er.caraml(Open VSX Registry).
In ~/.spacemacs, fetch the mode from git in
dotspacemacs-additional-packages:
(caraml-mode :location (recipe :fetcher github :repo "b4er/caraml"
:files ("editors/emacs/local/caraml-mode/*.el")))and start the language server in dotspacemacs/user-config:
(add-hook 'caraml-mode-hook #'caraml-eglot-ensure)Requires Emacs 29.1 or later (for Eglot). With Emacs 30, in your init.el:
(use-package caraml-mode
:vc (:url "https://github.com/b4er/caraml"
:lisp-dir "editors/emacs/local/caraml-mode")
:hook (caraml-mode . caraml-eglot-ensure))With Emacs 29, install once with M-x eval-expression:
(package-vc-install
'(caraml-mode :url "https://github.com/b4er/caraml"
:lisp-dir "editors/emacs/local/caraml-mode"))and add (add-hook 'caraml-mode-hook #'caraml-eglot-ensure) to your init.el.
git clone --recursive https://github.com/b4er/caraml.git && cd caramlThis repository contains the Isabelle formalization split across the following roots:
prelude/ |
Shared Isabelle library (predictable, named cases) |
spec/ |
Abstract compiler specification (program refinement and separate compilation) |
syntax/ |
The abstract syntax for (module) expressions |
parser/ |
Surface grammar and generated parser |
core/ |
Core calculus |
typing/ |
Type checking and inference |
haskell/ |
Code exports |
web/ |
Static website |
You'll need Isabelle2025-2, the
AFP (release 2026-07-21) to generate the
verified code (writes to haskell/verified):
isabelle build -bed . CaraML_ExportThe verified Haskell code is wrapped by the project in
haskell/caraml.cabal and can be installed with Cabal:
cabal install --project-dir=haskell/ exe:caramlThe executable provides a language server which can be used by the editor
plugins implemented in editors/.
CaraML is distributed under the BSD 3-Clause License.