Merge branch 'cleaning_again_example_sin_cos' into 'master'
[why3.git] / stdlib / option.mlw
blob5f77ed6275c0604da8d8d8c47aaf896cc0a75edb
1 (** {1 Option type} *)
3 module Option
5   type option 'a = None | Some 'a
7   let predicate is_none (o: option 'a)
8     ensures { result <-> o = None }
9   = match o with None -> true | Some _ -> false end
11 end
13 module Map
15   use Option
17   function map (f: 'a -> 'b) (o: option 'a) : option 'b
18   = match o with None -> None | Some x -> Some (f x) end
20 end