diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-06-26 11:09:30 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-06-26 11:09:30 -0400 |
commit | 77790187bb1c1e0de956d4bbc7795678fb0c6544 (patch) | |
tree | d748a92db1c3c4b8466e6cd0728b7cf93832a84c /tests | |
parent | 1d4b2683a02155a474d79436247d8a1d293237ae (diff) |
Elaborate efold
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cfold.lac | 9 | ||||
-rw-r--r-- | tests/efold.lac | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/tests/cfold.lac b/tests/cfold.lac index 03f4b695..0fcf9d60 100644 --- a/tests/cfold.lac +++ b/tests/cfold.lac @@ -1,12 +1,15 @@ con currier = fold (fn nm => fn t => fn acc => t -> acc) {} -con greenCurry = currier [] +con greenCurryIngredients :: {Type} = [] +con greenCurry = currier greenCurryIngredients val greenCurry : greenCurry = {} -con redCurry = currier [A = int, B = string] +con redCurryIngredients = [A = int, B = string] +con redCurry = currier redCurryIngredients val redCurry : redCurry = fn x : int => fn y : string => {} -con yellowCurry = currier [A = string, B = int, C = float] +con yellowCurryIngredients = [A = string, B = int, C = float] +con yellowCurry = currier yellowCurryIngredients val yellowCurry : yellowCurry = fn x => fn y => fn z => {} val main = yellowCurry diff --git a/tests/efold.lac b/tests/efold.lac new file mode 100644 index 00000000..6f4c768c --- /dev/null +++ b/tests/efold.lac @@ -0,0 +1,6 @@ +val currier : rs :: {Type} -> Cfold.currier rs = + fold [Cfold.currier] (fn nm :: Name => fn t :: Type => fn rest :: {Type} => fn acc => fn x => acc) {} + +val greenCurry : Cfold.greenCurry = currier [Cfold.greenCurryIngredients] +val redCurry : Cfold.redCurry = currier [Cfold.redCurryIngredients] +val yellowCurry : Cfold.yellowCurry = currier [Cfold.yellowCurryIngredients] |