aboutsummaryrefslogtreecommitdiff
path: root/examples/list.fusp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/list.fusp')
-rw-r--r--examples/list.fusp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/list.fusp b/examples/list.fusp
index de3059e..b3f4ea5 100644
--- a/examples/list.fusp
+++ b/examples/list.fusp
@@ -29,3 +29,7 @@ repeat n x = [x:repeat (sub 1 n) x];
map f [] = [];
map f [x:xs] = [f x:map f xs];
+
+take _ [] = [];
+take 0 _ = [];
+take n [x:xs] = [x:take (sub 1 n) xs];