doc-src/IsarAdvanced/Codegen/Thy/examples/class.ML
changeset 25182 64e3f45dc6f4
parent 25056 743f3603ba8b
equal deleted inserted replaced
25181:7c86f9ed8588 25182:64e3f45dc6f4
     9 struct
     9 struct
    10 
    10 
    11 type 'a null = {null : 'a};
    11 type 'a null = {null : 'a};
    12 fun null (A_:'a null) = #null A_;
    12 fun null (A_:'a null) = #null A_;
    13 
    13 
    14 fun head B_ (x :: xs) = x
    14 fun head A_ (x :: xs) = x
    15   | head B_ [] = null B_;
    15   | head A_ [] = null A_;
    16 
    16 
    17 val null_option : 'a option = NONE;
    17 val null_option : 'a option = NONE;
    18 
    18 
    19 fun null_optiona () = {null = null_option} : ('a option) null;
    19 fun null_optiona () = {null = null_option} : ('a option) null;
    20 
    20