Mezzo

Mezzo is a dialect of ML with effects control and a fine-grained type system.

Main modules


Mezzo
This is the entry point of the program.
Driver
This module sets up a lexer and a parser to create an AST.

Type-checker modules

Definitions of types and binders


TypeCore
This module defines the syntax of types, as manipulated by the type-checker.
DeBruijn
Dealing with binders.
Types
This module provides a variety of functions for dealing with types, mostly built on top of DeBruijn and TypeCore.
ExpressionsCore
This module defines the syntax of expressions.
Expressions
This module defines substitution functions and binding functions on expressions as well as data type groups.

High-level type-checking modules


Merge
This module implements the merge operation.
Permissions
This module provides permission manipulation functions.
TypeChecker
This is the top of the pyramid: the module that actually performs type-checking.

Handling type errors


Derivations
This file provides a representation of typing derivations, built by Permissions.
TypeErrors
Everything you ever dreamed of for reporting errors.
DerivationPrinter
This module provide a convenient way to print a typing derivation into a (supposedly) human-readable form.

Various analyses performed by the type-checker

Fact analysis


DataTypeFlavor
Mode
The four modes.
Fact
Conjunction of hypotheses.
FactInference
This module analyzes data type declarations to synthesize facts about data types.

Other analyses


Variance
This module is entirely devoted to computing the variance of type parameters in data types.

Other type-checking operations

Dealing with modules and interfaces


Modules
Find the dependencies of a module.
Interfaces
Treatment of interfaces.
Exports
Handling the names exported by interfaces and implementations.

Manipulating types and expressions


Hoist

From the external syntax down to the internal syntax

Parsing and lexing


SurfaceSyntax
Grammar
Lexer
The lexer for Mezzo.
ParserUtils
Resugar
This function converts an internal name to a possibly-qualified name in the surface syntax.

Front-end modules


KindCheck
This module implements a well-kindedness check for the types of the surface language.
TransSurface
Translating the surface syntax down into the core language syntax.

Misc

The data structures of Mezzo


Identifier
This functor creates a fresh abstract type of names.
Mark
Hashcons
A simple Hashconsing facility.
GMap
GSet
This is a stripped down version of GSet that describes both Patricia and CompressedBitSet.
Patricia
This is an implementation of Patricia trees, following Chris Okasaki's paper at the 1998 ML Workshop in Baltimore.
InfiniteArray
This module implements infinite arrays.
PersistentUnionFind
A persistent version of the classic union-find algorithm.
PersistentRef
This module implements a persistent store: in other words, it is a purely functional implementation of references, with an explicit store.

The Mezzo standard library


Bash
Provides wrappers for some bash fancy printing, mainly boxes and colors.
MzList
A bunch of useful functions for lists.
MzMap
Various missing functions from the Map module.
MzString
Various string utilities.
MzPprint
Option
No "J" prefix for this module since OCaml's standard library does not have an Option module.
Log
This module provides error reporting functions for Mezzo.

Misc


Debug
TestUtils
Utils

Dependency graph