mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
added composOp generation to haskell-gadt, and an example in examples/gadt-transfer
This commit is contained in:
35
examples/gadt-transfer/README
Normal file
35
examples/gadt-transfer/README
Normal file
@@ -0,0 +1,35 @@
|
||||
AR 5/3/2011
|
||||
|
||||
Example on using GADT and composOp in transfer.
|
||||
|
||||
To compile:
|
||||
|
||||
make
|
||||
|
||||
To test:
|
||||
|
||||
echo "this expensive boring wine is warm" | ./VeryFoods
|
||||
this expensive very boring wine is warm
|
||||
|
||||
echo "deze dure wijn is saai" | ./VeryFoods
|
||||
deze dure wijn is erg saai
|
||||
|
||||
Functionality: wraps every occurrence of "boring" with "very".
|
||||
|
||||
This is implemented with a function that needs only two cases: one for "Boring" and another
|
||||
for the rest of trees. On the method, see
|
||||
|
||||
B. Bringert and A. Ranta.
|
||||
A Pattern for Almost Compositional Functions.
|
||||
Journal of Functional Programming, 18(5-6), pp. 567-598, 2008.
|
||||
http://www.cse.chalmers.se/alumni/bringert/publ/composOp-jfp/composOp-jfp.pdf
|
||||
|
||||
Source code:
|
||||
|
||||
VeryFoods.hs -- main Haskell module, hand-written
|
||||
Makefile
|
||||
Foods.gf, FoodsEng.gf, FoodsDut.gf -- from GF/contrib/summerschool/foods/
|
||||
|
||||
Foods.hs and Foods.pgf are generated by 'make'.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user