home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
C
/
Applications
/
Moscow ML 1.42
/
examples
/
lexyacc
/
cl
/
nats.cl
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1997-08-18
|
284 b
|
10 lines
|
[
TEXT/R*ch
]
(* The infinite list of natural numbers *)
letrec map = \f.\xs. case xs of
<1> -> pack{1};
<2> x xr -> pack{2, f x, map f xr}
end;
add1 = \y.y+1;
nats = pack{2, 0, map add1 nats}
in nats