doc-src/IsarAdvanced/Codegen/Thy/examples/class.ocaml
changeset 22751 1bfd75c1f232
parent 22308 7901493455ca
child 22798 e3962371f568
equal deleted inserted replaced
22750:bff5d59de79b 22751:1bfd75c1f232
    12 struct
    12 struct
    13 
    13 
    14 type 'a null = {null : 'a};;
    14 type 'a null = {null : 'a};;
    15 let null _A = _A.null;;
    15 let null _A = _A.null;;
    16 
    16 
    17 let rec head _A = function y :: xs -> y
    17 let rec head _A = function x :: xs -> x
    18                   | [] -> null _A;;
    18                   | [] -> null _A;;
    19 
    19 
    20 let rec null_option = None;;
    20 let rec null_option = None;;
    21 
    21 
    22 let null_optiona () = ({null = null_option} : ('b option) null);;
    22 let null_optiona () = ({null = null_option} : ('b option) null);;