csci2041/public-class-repo/SamplePrograms/Sec_01_1:25pm/nat.ml
Michael Zhang 399845160c
f
2018-01-29 17:35:31 -06:00

6 lines
105 B
OCaml

type nat = Zero | Succ of nat
let rec toInt n = match n with
| Zero -> 0
| Succ n' -> 1 + toInt n'