I am currently developing a Haskell library for constraint functional-logic programming. It is in an early alpha stage (does not support higher-order functions and implements no constraint solvers) but can already be used to mimic simple lazy functional-logic programs in Haskell.

You can install the latest version of the library from Hackage using cabal-install as follows:

> cabal update
> cabal install cflp

You can upgrade a previously installed version by typing:

> cabal update
> cabal upgrade cflp

If you are interested in the sources, you can fetch them from github or download the tarball, which is available from Hackage and also contains installation instructions for those who do not have cabal-install. If you just want to read the code, consider the highlighted sources.

Tutorial Introduction

I have written an introduction on how to use the library that describes how to implement a lazy functional-logic program for solving the n-queens problem. You can read a highlighted version of the Literate Haskell file, or download the source code if you want to execute it.

What’s missing

This is an unstable release, i.e., the interface may be subject to frequent changes. Currently, basic (higher-order) functional-logic programming is supported but without any constraint solvers.

Although you can use this library by hand (as indicated by the tutorial) its original intention is to be the basis for a constraint-based demand-driven test-case generator (that generates functional-logic programs from purely functional ones). The main focus lies on preserving laziness and sharing, which comes at the cost of explicitly passing unique identifiers and constraint stores — tedious things to write by hand.