Created
October 30, 2016 10:35
-
-
Save gsg/00712c488e92fc3f674d09e05b3f3764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec filter_map f = function | |
| [] -> [] | |
| x::xs -> | |
match f x with | |
| Some y -> y::filter_map f xs | |
| None -> filter_map f xs | |
let list = | |
filter_map (function `G a -> Some (`G a) | _ -> None) | |
[`G 0; `F "wat"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment