A List of Mercury Resources

Here’re pointers to Mercury related resources, in no particular order. It’s been updated last time on 2023-10-19. If you have comments or resources to include, I’d like to hear from you. My email address is post at volker-wysk dot de. Or write to the mercury-users mailing list.


The list of documentation on the mercurylang.org site

The Mercuy team collects all Mercury documentation in a central place. Here it is.

Examples in the Mercury source distributions

The samples directory in the Mercury source code distribution contains examples for diverse parts of the language. The README.md file is an overview.

For your convenience I’m including the HTML-version of the README file here. It’s from the 2023-08-15 Release Of The Day of the Mercury compiler.


A page about Mercury limitations.

“The current implementation does not yet completely implement the Mercury language. The main limitations of the current implementation are the following.”

An explanation of Mercury grades by Paul Bone


Adventures in Mercury blog series

This is a series of (long) blog posts, which range from March to December 2011. Paul Bone writes: “There’s also the blog series, not mine, but more “here’s how to” style writing for Mercury is always good.” The “labels” on the right are a sort of a table of contents.


Developer Documentation

This are documents meant for developers of the Mercury compiler.

Mercury at Wikipedia


Libraries and Tools

The Mercury Standard Libraries

The standard libraries should be first place to look for libraries. They are documented in the Mercury Library Reference Manual (see Documentation, above).

Extra libraries in the Mercury source code

The “extra libraries” are distributed with the Mercury source code. They are in the extras subdirectory. It consist of 35 libraries (as of 2022-11-24), that are being held up-to-date with respect of the latest Mercury compiler. See the README files for documentation.

For your convenience I’m including the HTML-version of the README file here. It’s from the 2023-08-15 Release Of The Day of the Mercury compiler.

Ondrej Bojar’s Mercury Anarchy Archive (Manarchive)

Ondrej has put together some Mercury libraries and called that the Mercury Anarchy Archive. The web site has last been updated in 2007, but it’s still up: https://manarchive.sourceforge.net/

However, the subversion download no longer works. So I’m hosting it here (with Ondrej’s consent): manarchive-code-r84.zip.

It consists of the following packages:

Julian Fondren’s libraries and tools

Julian Fondren <jfondren at minimaltype dot com> has written some Mercury code which he shares. It’s on his Github page. As of 2022-11-24, this consists of the following projects.

Package management with mmc-get and the “Packages” website

mmc-get and the (badly named) “Packages” website have been an approach to set up a Mercury packages database and distribution system. It consist of libraries, tools and other programs such as games. This system seems to be abandoned now. I’ve tried to compile the mmc-get program, but this failed. However, the following are the libraries which are registered there, excluding the ones which are mentioned elsewhere in this collection.

A human-readable form of the full mmc-get database is here. It’s long, so I’ve placed on a separate page.


This is a “benchmarking wrapper around getrusage”. See https://github.com/jrfondren/getr-mercury.


This is a little program that downloads and displays documentation from mercurylang.org. See https://github.com/jrfondren/mmc-doc.

A Command Line Parser by Volker Wysk

Colipa is a command line parser library. The design goals are:

It’s hosted on Gitlab: https://gitlab.com/volkerwysk/colipa.

An improved ODBC library by Volker Wysk

This is a library which lets you access SQL databases over ODBC. It’s derived from the ODBC “extra” library, but a lot has changed. Most notably, it supports multiple threads now.

It’s hosted here: https://gitlab.com/volkerwysk/odbc.

Julien Fischer’s Mercury libraries

Julien Fischer has 9 Mercury libraries and library bindings on his Github page, as of 2022-11-24. There are libraries for the JSON and CSV formats, bindings of Java things, a library of additional integer types, miscellaneous utilities and more.

Sean Charles’s Mercury code

Sean Charles has 51 projects (as of 2023-08-18) on his Github page, some of which are Mercury related:

Sebastian Godelet’s code

Sebastian Godelet has a huge lot of Github projects. Amongst them is a Unicode character database parser and library for Mercury.

Paul Bone’s Mercury libraries

They haven’t tested these in a while, but this are libraries that Mission Critical opensourced:

An audio player library by M. McDonough

An “OGG decoder library with no foreign code (used in the audio player demo)”: https://github.com/FlyingJester/fjogg

AlaskanEmily’s libraries

AlaskanEmily of Transnat Games, has released the following code:

Mark Clements’s aggregates library

Aggregates: bag and set aggregates for Mercury

“This is a module to provide bag and set aggregates for Mercury.

“The motivation for this module is to provide aggregates that are comparable to aggregates provided by Prolog (e.g. XSB and SWI-Prolog) and Datalog (e.g. Soufflé). This suggests working with nondeterministic predicates rather than other data structures.

“This is an exploratory exercise, so that the API is likely to change. In particular, the current API and implementations for the bag_row_number and bag_cum_sum window functions are experimental.”

Mark Clements’s automatic differentiation library

Mark Clements has written a Mercury module that does Automatic differentiation, including both backwards and forwards differentiation. The module adapts an approach used in https://github.com/qobi/AD-Rosetta-Stone/, with a purely functional implementation.

See mercury-ad: Mercury module for automatic differentiation (on Github) for the code, documentation and some examples.

Mark Clements’s implementation of the Mersenne Twister random number generator

“I have written a Mercury-only implementation of the Mersenne Twister random number generator. This is a very common and reasonably good pseudo random number generator. For details: https://github.com/mclements/mercury-mt.”

Mark Clements’s SQLite 3 database interface

“The sqlite3 module is a modest extension of the pushpull.sqlite3 module from the pushpull module by Peter Wang.”


Peter Wang’s pushpull module

“pushpull is a bidirectional IMAP/Maildir synchronisation tool. It synchronises one IMAP folder with one Maildir folder, then optionally waits for a change to either the IMAP folder (using the IDLE command) or to the Maildir folder (using the inotify API) before synchronising again.”


Other code

About code that isn’t libraries or tools.

Package management with mmc-get and the “Packages” website

The mmc-get database contains, apart from libraries and tools, also some other code. See above.


Docker images

Docker is a cross-platform method of sandboxing, packaging and distributing software. See here for an introduction.

Fabrice Nicol is compiling and distributing the Mercury Compiler on a daily basis and is distibuting it as Docker images. This means you don’t need to compile the compiler yourself, when you want the latest and greatest version, and you have set up Docker on your system.

Each Docker image contains both, the latest ROTD version and the latest Git version. He provides three versions of his Docker images, named gentoo4mercruy, ubuntu4mercury and alpine4mercury, which correspond to the Linux distribution with the respective name.

The three versions of Docker images should work under any GNU/Linux 64-bit platform with an appropriate Docker installation.

The name of the GitHub repository refers to the GNU/Linux platform of the Docker guest (respectively, Gentoo, Ubuntu or Alpine), not the host.

The Gentoo distribution is aimed at users who want to build dependencies from source code. The Alpine distribution is aimed at those who would like to test builds against the musl C library or need a more compact image.