summaryrefslogtreecommitdiff
path: root/twice.icl
blob: bdc5bba471f787e57d2ca7acb9f1a004132bf342 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module twice

/*
The Twice function.

Increase stack size and heap size to 1m to run this program.

An integer (0) is incremented 65536 times using the higher
order function Twice.
*/

import StdClass, StdInt

Twice::(x -> x) x -> x
Twice f x =  f (f x)

Start::Int
Start = Twice Twice Twice Twice inc 0