Relational Algebra Engine

Latest on Hackage:0.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

PublicDomain licensed by AgentM

Ξ Project:M36 Relational Algebra Engine

Haskell Programming Language Public Domain Hackage Hackage dependency status Build status

Software can always be made faster, but rarely can it be made more correct.


Project:M36 implements a relational algebra engine as inspired by the writings of Chris Date.


Unlike most database management systems (DBMS), Project:M36 is opinionated software which adheres strictly to the mathematics of the relational algebra. The purpose of this adherence is to prove that software which implements mathematically-sound design principles reaps benefits in the form of code clarity, consistency, performance, and future-proofing.

Project:M36 can be used as an in-process or remote DBMS.

Project:M36 is written entirely in the Haskell programming language.

Sample Session


Try It!

You can experiment instantly with Project:M36 straight from your browser at!


Project:M36 supports multiple frontends which target different audiences.

  • learn about the relational algebra via TutorialD
  • store and manipulate databases
  • use Project:M36 as a native Haskell database backend



Introductory Materials

  1. Installation and Introduction to Project:M36
  2. Introduction to the Relational Algebra
  3. TutorialD Tutorial
  4. 15 Minute Tutorial
  5. Developer's Change Log
  6. Simple Client API

Database Comparisons

  1. ACID Database Properties
  2. On NULL (in SQL)
  3. Reaching "Out of the Tarpit" with Project:M36

Advanced Features

  1. Transaction Graph Operators
  2. ProjectM36.Client Library
  3. Adding New Data Types
  4. Database-Manipulating Functions
  5. Serving Remote ProjectM36 Databases
  6. Using Notifications
  7. Merge Transactions
  8. WebSocket Server
  9. Atom (Value) Functions
  10. Trans-Graph Relational Expressions
  11. Isomorphic Schemas
  12. Replication


Project:M36 is developed in Haskell and compiled with GHC 7.10 or GHC 8.0.2 or later.

  • The Third Manifesto: the philosophical basis for relational algebra engines
  • Rel: a TutorialD implementation against a BerkeleyDB backend
  • Andl: a new database language with SQLite and PostgreSQL backends
  • Coddie: a python-based relational algebra interpreter

Suggested Reading


2017-10-08 (v0.3)

  • replaced overuse of undefined with Proxy in Tupleable and Atomable typeclasses
  • allow notifications to return query results from before and after the commit which triggered the notification
  • alert users in tutd console before a transaction graph expression is evaluated which would throw out their changes
  • drastically-improved CSV import/export now supports all possible types except RelationAtom
  • fix serious file handle leaks when using on-disk persistence
  • fix case where invalid number of arguments to ConstructedAtom did not result in an error
  • add support for IntegerAtom (previously, only IntAtom was supported)

2017-09-16 (v0.2)

  • a new simple client API with a monadic transaction manager
  • complete hlint compliance
  • the generics-based [Tupleable typeclass]( ) which makes it easy to marshal Haskell data types to-and-from the database
  • timestamps attached to transactions to allow specific point-in-time travel
  • autoMergeToHead, a variant of commit which attempts to merge and commit to the latest head transaction to reduce incidents of TransactionNotAHeadErrors
  • interval data types
  • transaction dirtiness detection which allows the client to determine if an update expression actually changed the database state



In preparation for the simpler monad client API, ProjectM36.Client now includes a server-side merge for new transactions called "automerge". This feature should reduce head contention in cases where new transactions can be simply merged to the head without additional processing. The trade-off is reduced `TransactionIsNotAHeadError`s but an increased chance of merge errors. The feature operates similarly to a server-side git rebase.

critical bug in merging

Successfully merged transactions did not have their constraints validated. Fixed.


add file locking

This feature allows Project:M36 database directories to be shared amongst multiple Project:M36 processes. This is similar to how SQLite operates except that the remote server mode supports the feature as well. This could allow, for example, multi-master, file-based replication across Windows shares or NFS.



add functional dependency macro

Date demonstrates two ways to implement functional dependencies as constraints on page 21 in "Database Design and Relational Theory". A similar macros is now implemented in the tutd interpreter.

`funcdep sname_status (sname) -> (status) s`



add TransGraphRelationalExpr

The TransGraphRelationalExpr allows queries against all past states of the database.

The following example executes a query against two different committed transactions using syntax similar to that of git for graph traversal:

`:showtransgraphexpr s@master~ join sp@master`


comments powered byDisqus