The call-by-preference
library is an algebraic effect framework.
It provides an effect called Let
which enables control over evaluation strategies.
By choosing an appropriate interpretation of this effect, programs are evaluated in either call-by-name, call-by-need, or even call-by-value semantics.
Multiple occurrences of the Let
effect can each be interpreted with different strategies.
For instance, while one part of a program can use call-by-name, another part can use call-by-value.
Programs written in this way are therefore flexible with respect to not only
the interpretation of their effects, but also with respect to the evaluation
strategy.
To use this library, GHC and Cabal are required. The library has been tested with the following software versions.
The library provided by this package is not yet available on Hackage.
In order to use the library in your own project, add the following stanza to your cabal.project
file and add call-by-preference
to your build-depends
.
source-repository-package
type: git
location: git://github.com/FreeProving/call-by-preference.git
subdir: library
tag: v0.1.0.0
If you want to use the library interactively, run the following command in the root directory of the library to open a GHCi prompt.
cabal new-repl
By default the Control.Prog
module is loaded.
Use the :m
command to switch to or load another module.
To run the test suite run the following command in the root directory of the library.
cabal new-run call-by-preference-tests
The test suite is built using the Hspec testing framework. Command line options can be passed to the framework by adding two dashes after the command above.
cabal new-run call-by-preference-tests -- [OPTIONS...]
By default the package is configured such that compilation fails if GHC reports any warning.
Add the -Wwarn
option during development to disable this behavior temporarily.
The --ghc-option
s have to be specified before Hspec options.
cabal new-run call-by-preference-tests --ghc-option -Wwarn -- [OPTIONS...]
The library provides a Control.Prog
module that exports the infrastructure for the Prog
monad, combination of signatures as well as theEmbed
, Let
and None
effects.
All other effects are not exported by the Control.Prog
module and have to be imported individually from the Control.Prog.Effect.*
modules.
This library is licensed under The 3-Clause BSD License. See the LICENSE file for details.