[ANN] Haskell Theory Exploration scripts

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ANN] Haskell Theory Exploration scripts

Haskell - Haskell-Cafe mailing list
Hello all,

I thought I'd make a public announcement about some scripts I've built
up over the last few years for "exploring" Haskell code. They can be
found at:


With mirrors at /ipns/QmWv958VzBJQchGjYKiSaxLC9ugrjvXkqMpVrmjp9AonXq and

These use the excellent QuickSpec library from:


This empirically (through brute force and QuickCheck testing)
conjectures equations about given Haskell function definitions.

I think it's a very under-utilised library, perhaps due to a couple of

 - It requires hand-holding from the user, e.g. installing packages,
   importing modules, naming functions, monomorphising types, picking an
   arity, etc.
 - It can be very resource-intensive!

I know there's some work to address the efficiency concerns in a newer
version, but that's not made its way to Hackage, Nixpkgs, etc. yet:


My scripts try to address the usability issues. More details are in the
README, but basically we can run:

    quickspec myHaskellDir | renderEqs

This will (hopefully) output conjectures found by QuickSpec about the
functions defined in myHaskellDir. This automatically finds all function
definitions, looks up their types, arities, etc. and invokes QuickSpec
in a subprocess (with optional timeouts and memory limits).

If we leave off the 'renderEqs', we get an easily-parsed JSON format,
which we can feed into other tools.

Note that I make *heavy* use of the Nix language, and it's quite
hit-or-miss whether a package will work. My hope is that more widespread
knowledge of these tools will alleviate some of the existing pain

In particular, many packages define `Arbitrary` instances for their
types, but they do so in their test suites rather than their libraries,
so nobody else can make use of them (I assume this is to keep down
library dependencies?)

Suggestions and contributions are welcome!

Chris Warburton
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.