~ubuntu-branches/ubuntu/trusty/ocamlbricks/trusty-proposed

« back to all changes in this revision

Viewing changes to STRUCTURES/option.ml

  • Committer: Package Import Robot
  • Author(s): Lucas Nussbaum
  • Date: 2013-07-05 16:29:21 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130705162921-y1d2ct6betni2a5i
Tags: 0.90+bzr367-1
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
let bind x f = match x with None -> None | Some x -> (f x)
32
32
let return x = Some x
33
33
let iter f = function None -> () | Some x -> (f x)
 
34
let join = function
 
35
| None -> None
 
36
| Some x -> x
34
37
 
35
38
(* Monadic definition: *)
36
39
let map2 f m1 m2  = bind m1 (function x1 -> map (f x1) m2)