Created
October 30, 2016 10:28
-
-
Save gsg/791fd04c9564f3ea0ca54ab72d7b0210 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 filter xs = | |
List.filter (function `G a -> true | _ -> false) xs | |
let rec refine (xs : [> `G of 'a] list) : [`G of 'a] list = | |
match xs with | |
| [] -> [] | |
| ((`G _) as elt)::rest -> elt::refine rest | |
| _::_ -> assert false | |
let argtest = [`X(`True);`G(`False)];; | |
let toto = refine (filter argtest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment