summaryrefslogtreecommitdiff
path: root/stwice.icl
diff options
context:
space:
mode:
Diffstat (limited to 'stwice.icl')
-rw-r--r--stwice.icl22
1 files changed, 22 insertions, 0 deletions
diff --git a/stwice.icl b/stwice.icl
new file mode 100644
index 0000000..4c9a2df
--- /dev/null
+++ b/stwice.icl
@@ -0,0 +1,22 @@
+module stwice
+
+/*
+The strict Twice function.
+
+An integer (0) is incremented 65536 times using the higher
+order function Twice. The Twice function has a local
+strictness annotation which makes it more efficient.
+
+To generate an application for this program the Clean 0.8
+application should be set to at least 1.1 Mb. To launch the
+generated application another 400K of free memory is needed.
+*/
+
+import StdEnv
+
+Twice::(a -> a) a -> a
+Twice f x #! evalfx = f x
+ = f evalfx
+
+Start::Int
+Start = Twice Twice Twice Twice inc 0