author | haftmann |
Tue, 18 Sep 2007 10:44:02 +0200 | |
changeset 24628 | 33137422d7fd |
parent 24421 | acfb2413faa3 |
child 25056 | 743f3603ba8b |
permissions | -rw-r--r-- |
22308 | 1 |
module Nat = |
2 |
struct |
|
3 |
||
24421 | 4 |
type nat = Suc of nat | Zero_nat;; |
22308 | 5 |
|
6 |
end;; (*struct Nat*) |
|
7 |
||
8 |
module Codegen = |
|
9 |
struct |
|
10 |
||
11 |
type 'a null = {null : 'a};; |
|
12 |
let null _A = _A.null;; |
|
13 |
||
22798 | 14 |
let rec head _B = function x :: xs -> x |
15 |
| [] -> null _B;; |
|
22308 | 16 |
|
24628 | 17 |
let null_option () = ({null = None} : ('a option) null);; |
22308 | 18 |
|
19 |
let rec dummy |
|
24421 | 20 |
= head (null_option ()) [Some (Nat.Suc Nat.Zero_nat); None];; |
22308 | 21 |
|
22 |
end;; (*struct Codegen*) |