Please sign in to comment.
New example: EvenDouble in the generator style, rathen than as a tail…
… recursive function (so we get fusion)
- Loading branch information...
Showing with 14 additions and 0 deletions.
|@@ -0,0 +1,13 @@|
|+double y = case y of Z -> Z|
|+ S x -> S (S (double x))|
|+even y = case y of Z -> True|
|+ S z -> case z of Z -> False|
|+ S x -> even x|
|+root x = even (double x)|
|+tests = [|
|+ (root Z, True),|
|+ (root (S Z), True)|