Strafunski is a bundle that provides support for generic programming in Haskell, based on the concept of a functional strategy. Functional strategies are generic functions that (i) can be applied to any type, (ii) allow generic traversal into subterms, (iii) can be customized with type-specific behaviour, (iv) are first-class citizens. Strafunski consists of a combinator library (StrategyLib) and a precompiler (DrIFT-Strafunski). Release 2.0 of StrategyLib and release 1.4 of the Strafunski variation on DrIFT are now available from: http://www.cs.vu.nl/Strafunski/ Please refer to the above URL for documentation and download information. StrategyLib ----------- Changes with respect to the previous release include: * Added many combinators to the library, and split up the module StrategyLib into: - The top-level module StrategyLib which imports all other modules. - A range of `theme' modules into which combinators are grouped according to the concerns they address. Among these are the TraversalTheme, the FlowTheme, the EffectTheme, the KeyholeTheme, the FixpointTheme, and more. - A module StrategyOverloading that allows type-unifying and type-preserving combinators to be treated in uniform manner. - A module StrategyPrelude which defines basic combinators that can be defined in term of truly primitive ones. - Some modules that do not provide strategy combinators but general utilities functions, such as MonadicFunctions, and MonadRun. * The underlying term representation has been improved. Conversion to/from this representation during generic traversal is now more efficient. Also, instances of the Term class have been added for the basic types Char, Int, 2-tuples, Either and Ratio. * The various theme modules feature many of the combinators that illustrate the design patterns for functional strategic programming as presented in [1]. * Added a number of examples, including one that demonstrates strategic programming on the abstract syntax of Haskell. The new term representation was contributed by John Meacham. DrIFT-Strafunski ---------------- Changes with respect to previous versions include: * Merger of instances derivation rules with those of jDrIFT. In particular, the rule for Term now supports the term representation module based on Dynamic as available in StrategyLib version 2.0. * Instance derivation for the ATermConvertible class, as available in the Haskell ATerm Library. * Command line option -r for generating instances only, i.e. not repeating the contents of the input file itself. * Command line option -g that allows global directives to be specified on the command line instead of in the input file. The DrIFT-Strafunski package was based on the original implementation of DrIFT by Noel Winstanley and its updated implementation by Malcolm Wallace. The new instance derivation rule for Term was contributed by John Meacham. We hope DrIFT-Strafunski will soon be made redundant by John's unifying implementation: jDrIFT. Background ---------- The following papers provide useful background info: [1] Ralf Laemmel and Joost Visser Design Patterns for Functional Strategic Programming. http://www.cs.vu.nl/Strafunski/dp-sf/ This paper seeks to provide practicing functional programmers with pragmatic guidance in crafting their own strategic programs. It presents the fundamentals and the support from a user's perspective, and includes a catalogue of design patterns. Read this paper if you want to use Strafunski. [2] Ralf Laemmel and Joost Visser Typed Combinators for Generic Traversal http://www.cs.vu.nl/Strafunski/sf/ This paper introduces the concept of functional strategies. It shows how strategies are modelled inside Haskell, and it present the first version of StrategyLib. Read this paper if you want to know what makes Strafunksi work. [3] Ralf Laemmel A Polymorphic Symphony http://www.cwi.nl/~ralf/polymorphic-symphony/ This paper reconstructs functional strategies as an amalgamation of certain bits of parametric polymorphism, type case, polytypism, and overloading. Read this paper if you want to know how Strafunski can be generalized and how it may look in future. Feedback is much appreciated, and can be directed to the authors: * Ralf Laemmel (mailto:ralf@cwi.nl) * Joost Visser (mailto:Joost.Visser@cwi.nl) Have fun!
Release 1.2 of the Haskell ATerm Library is now available from: http://www.cwi.nl/projects/MetaEnv/haterm/ This package provides support for ATerms in Haskell. Currently this includes the following: * Representation of ATerms (no sharing). * Reading and writing ATerms to/from Strings, either in plain textual format (TXT), or in maximally shared textual format (TAF). * Conversion betweens ATerms and user types. To enable the latter feature, you need to provide instances of the ATermConvertible class for all the datatypes that you want to convert to/from ATerms. Automatic generation of instances is supported by the DrIFT-Strafunski pre-compiler (version 1.4 and upward), which is available from: http://www.cs.vu.nl/Strafunski/ (We hope that soon jDrIFT will make this version of DrIFT redundant.) For details on how to use and install these packages, see the README and example files in the respective distributions. ATerms ------ The ATerms provide a generic format for representation and exchange of (annotated) terms. The ATerm Library (http://www.cwi.nl/projects/MetaEnv/aterm/) provides implementations of the ATerm Library in C and Java, including numerous ATerm command line utilities implemented in C. ATerms were developed in the context of the ASF+SDF Meta-Environment. They are also used by the rewriting language Stratego, by the transformation tool bundle XT, by the visitor generator JJForester, and by numerous other tools developed at CWI, Universiteit Utrecht, and elsewhere. Contributions ------------- The Haskell ATerm Library was initiated by Joost Visser. Improvement were contributed by Klaus Luettich. Links ----- Strafunski http://www.cs.vu.nl/Strafunski/ ATerm Library for C and Java http://www.cwi.nl/projects/MetaEnv/aterm/ ATerm Library for Java (alternative implementation) http://www.loria.fr/equipes/protheo/SOFTWARES/ELAN/Toolkit/ XT (transformation tool bundle) http://www.program-transformation.org/xt/ Stratego http://www.stratego-language.org/ JJForester http://www.jjforester.org/
participants (2)
-
Joost Visser -
Ralf Laemmel