BiGUL: The Bidirectional Generic Update Language

Putback-based bidirectional programming allows the programmer to write only one putback transformation, from which the unique corresponding forward transformation is derived for free. BiGUL, short for the Bidirectional Generic Update Language, is designed to be a minimalist putback-based bidirectional programming language. Originally developed in the dependently typed programming language Agda, BiGUL’s well-behavedness has been completely formally verified. It has subsequently been ported to Haskell for developing various bidirectional applications.

The module Generics.BiGUL.Lib.HuStudies (haddock documentation on Hackage) contains some small, illustrative examples of BiGUL programs, and is a good place for getting started quickly.

Recommended (especially to mathematically inclined programmers) is a semi-formal introduction to BiGUL programming in terms of an axiomatic semantics, which clarifies the reasoning required for writing correct BiGUL programs:

There is a less theory-oriented tutorial, which gives a taste of programming with the Haskell port of BiGUL and its implementation:

An earlier paper describes the reification technique used in the Agda formalisation; this paper uses an outdated version of BiGUL, but the reification technique still underlies the current formalisation.


BiGUL works with GHC 7.10 and 8.0 (and possibly above — see below), and is released to Hackage, so the installation of the latest release of BiGUL is as simple as executing

cabal update
cabal install BiGUL

in the command line (i.e., the standard way of installing Haskell packages).

For newer versions of GHC, you may see some cabal error messages like the following, which complains about the version of base:

cabal: Could not resolve dependencies:
trying: BiGUL-1.0.1 (user goal)
next goal: base (dependency of BiGUL-1.0.1)
rejecting: base- (conflict: BiGUL => base==4.9.*)

In this case, try to execute

cabal install BiGUL --allow-newer=base

instead. If there are no major changes to the API of GHC, BiGUL should still compile.

The most recent development version (with changes not yet released to Hackage) is maintained in the master branch. To install the development version, first clone this git repository, and then invoke cabal install under the Haskell/ subdirectory of the local copy of the repository:

git clone
cd BiGUL/Haskell/
cabal update
cabal install