src/HOL/Option.thy
changeset 4133 0a08c2b9b1ed
parent 2019 b45d9f2042e0
child 4192 c38ab5af38b5
equal deleted inserted replaced
4132:daff3c9987cc 4133:0a08c2b9b1ed
     5 
     5 
     6 Datatype 'a option
     6 Datatype 'a option
     7 *)
     7 *)
     8 
     8 
     9 Option = Arith +
     9 Option = Arith +
       
    10 
    10 datatype 'a option = None | Some 'a
    11 datatype 'a option = None | Some 'a
       
    12 
       
    13 constdefs
       
    14 
       
    15   the		:: "'a option => 'a"
       
    16  "the Ú %y. case y of None => arbitrary | Some x => x"
       
    17 
       
    18   option_map	:: "('a => 'b) => ('a option => 'b option)"
       
    19  "option_map Ú %f y. case y of None => None | Some x => Some (f x)"
       
    20 
    11 end
    21 end