X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_opt.ml;fp=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_opt.ml;h=8eee986f27ba22921f8320c04f0406e7a7c66be2;hp=cdacd0e85fdb48a934eec22fc61196650a199ec4;hb=eb9263c83a812a5872e4305bdd87f8a2ffe2dfc3;hpb=753f38382d7a2952c23521fd6c75093c8bd63199 diff --git a/compiler/src/lib/tiger/tiger_opt.ml b/compiler/src/lib/tiger/tiger_opt.ml index cdacd0e..8eee986 100644 --- a/compiler/src/lib/tiger/tiger_opt.ml +++ b/compiler/src/lib/tiger/tiger_opt.ml @@ -5,6 +5,9 @@ let map t f = | None -> None | Some x -> Some (f x) +let iter t ~f = + ignore (map t f) + let get t ~default = match t with | None -> default