doc-src/IsarAdvanced/Codegen/Thy/examples/class.ocaml
changeset 25056 743f3603ba8b
parent 24628 33137422d7fd
child 25182 64e3f45dc6f4
equal deleted inserted replaced
25055:3bb2ad8b1b37 25056:743f3603ba8b
    12 let null _A = _A.null;;
    12 let null _A = _A.null;;
    13 
    13 
    14 let rec head _B = function x :: xs -> x
    14 let rec head _B = function x :: xs -> x
    15                   | [] -> null _B;;
    15                   | [] -> null _B;;
    16 
    16 
    17 let null_option () = ({null = None} : ('a option) null);;
    17 let rec null_option = None;;
       
    18 
       
    19 let null_optiona () = ({null = null_option} : ('a option) null);;
    18 
    20 
    19 let rec dummy
    21 let rec dummy
    20   = head (null_option ()) [Some (Nat.Suc Nat.Zero_nat); None];;
    22   = head (null_optiona ()) [Some (Nat.Suc Nat.Zero_nat); None];;
    21 
    23 
    22 end;; (*struct Codegen*)
    24 end;; (*struct Codegen*)