aboutsummaryrefslogtreecommitdiff
path: root/examples/list.fusp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/list.fusp')
-rw-r--r--examples/list.fusp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/list.fusp b/examples/list.fusp
index b3f4ea5..340eb6d 100644
--- a/examples/list.fusp
+++ b/examples/list.fusp
@@ -33,3 +33,8 @@ map f [x:xs] = [f x:map f xs];
take _ [] = [];
take 0 _ = [];
take n [x:xs] = [x:take (sub 1 n) xs];
+
+scan op r [] = [r];
+scan op r [a:x] = [r:scan op (op r a) x];
+
+iterate f x = [x:iterate f (f x)];