aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCamil Staps2016-08-26 14:28:16 +0200
committerCamil Staps2016-08-26 14:28:16 +0200
commitac8abc4a94648cec89304d1550058d577f60903c (patch)
treeffd7ea8cc1101a6e4ead676b6e8b27fff36b1882 /examples
parentFix code; memory leaks (diff)
Added strictness example
Diffstat (limited to 'examples')
-rw-r--r--examples/strict.fusp10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/strict.fusp b/examples/strict.fusp
new file mode 100644
index 0000000..5795112
--- /dev/null
+++ b/examples/strict.fusp
@@ -0,0 +1,10 @@
+sub a b = code sub a b;
+
+take 0 _ = [];
+take _ [] = [];
+take n ![x:xs] = [x:take (sub 1 n) xs];
+
+repeat 0 x = [];
+repeat n x = [x:repeat (sub 1 n) x];
+
+main = take 1 (repeat 200 5);