The Bidirectional Generic Update Language http://www.prg.nii.ac.jp/project/bigul/
|Latest on Hackage:||1.0.1|
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 stackage.org to host generated Haddocks.
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. BiGUL was originally developed in the dependently typed programming language Agda, and its well-behavedness has been completely formally verified; this package is the Haskell port of BiGUL.
For more detail, see the following paper:
Hsiang-Shang Ko, Tao Zan, and Zhenjiang Hu. BiGUL: A formally verified core language for putback-based bidirectional programming. In Partial Evaluation and Program Manipulation, PEPM’16, pages 61–72. ACM, 2016. http://dx.doi.org/10.1145/2847538.2847544.
GHC 8.0.1 compabitility
Generics.BiGUL.TH now works with template-haskell-2.11 (which is used by GHC 8.0.1). Also explanations of the GADT constructors in Generics.BiGUL have been included in the haddock documentation.
This new BiGUL constructor lets the programmer display a customised message in error traces.
Fixed the glitch that normalSV does not convert boolean-valued lambdas to total functions.
Eliminated a “Pattern match(es) are overlapped” warning reported when using patterns as conditions.
Fixed a panic produced by
Version 1.0.0 is the first official release, and is not compatible with 0.9.0 and earlier development versions.
The targeted GHC version is 7.10; 8.0 support is postponed due to its non–backward compatible revisions to Template Haskell.
The module structure is refined and simplified, with
Generics.BiGUL, pattern matching functions extracted to
Generics.BiGUL.Libcreated to serve as a prelude. More specific library modules are placed under
Generics.BiGUL.Lib.Listis the place for list-processing library programs. For now the only inhabitant is the “BiFluX alignment”.
Generics.BiGUL.Lib.HuStudiescontains some small, concrete examples illustrating the use of every BiGUL construct.
The view type of
Skipis not restricted to
()anymore, but when skipping, the view should be determined by the source as specified by the new functional argument to
Skip— we can perform
Skip fon a source
sif and only if the view is
f s. The old
Skipcan be defined in terms of the new one as
Skip (const ()). There is a helper function
skip = Skip . constdefined in
Dephas been reverted to the original version, used to ignore the second component of the view when it depends on the first (but not the source).
Major changes to
updatesyntax now takes the source pattern as its first argument and the view pattern as its second argument. (Previously the view pattern comes first.)
updatenow check at compile time whether all view information is used (forbidding wildcard in view patterns and requiring all view variables are used); also
rearrVcheck whether their first argument is a one-argument lambda-expression.
The branch construction syntax has been slimmed down to just four functions:
Normal branch constructing functions now take an additional argument specifying on the source an “exit condition”, which should be satisfied by the updated source after the branch body is executed. All the exit conditions in a
Casestatement should (ideally) be disjoint. Overlapping exit conditions are still allowed for fast prototyping, though — the putback semantics of ‘Case’ will compute successfully as long as the ranges of the branches are disjoint (regardless of whether the exit conditions are specified precisely enough).
Error-reporting mechanism overhauled
The types of
Generics.BiGUL.Interpreterare changed to produce simply
Mayberesults. When execution fails (producing
getTraceto see the exact failure and the execution trace leading to the failure.
The execution traces include intermediate sources and views; the types used in a BiGUL program are thus required to be instances of
Show instances for BiGUL programs removed
There are two reasons: Functions, which are everywhere in BiGUL programs, cannot be shown; and worse, printing of recursive BiGUL programs will not terminate.