author | haftmann |
Tue, 03 Mar 2009 11:00:51 +0100 | |
changeset 30209 | 2f4684e2ea95 |
parent 25182 | doc-src/IsarAdvanced/Codegen/Thy/examples/class.ocaml@64e3f45dc6f4 |
permissions | -rw-r--r-- |
1 module Nat =
2 struct
4 type nat = Suc of nat | Zero_nat;;
6 end;; (*struct Nat*)
8 module Codegen =
9 struct
11 type 'a null = {null : 'a};;
12 let null _A = _A.null;;
14 let rec head _A = function x :: xs -> x
15 | [] -> null _A;;
17 let rec null_option = None;;
19 let null_optiona () = ({null = null_option} : ('a option) null);;
21 let rec dummy
22 = head (null_optiona ()) [Some (Nat.Suc Nat.Zero_nat); None];;
24 end;; (*struct Codegen*)