From ac8abc4a94648cec89304d1550058d577f60903c Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 26 Aug 2016 14:28:16 +0200 Subject: Added strictness example --- examples/strict.fusp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/strict.fusp (limited to 'examples') 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); -- cgit v1.2.3