Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec map_filter =
- fun f l ->
- match l with
- [] -> []
- | h::t ->
- try (f h)::map_filter f t
- with _ -> map_filter f t
- exception NoResult
- let rec f = fun n l ->
- match l with
- [] -> if n = 0 then [] else raise NoResult
- | h::t ->
- try h::(f (n - h) t)
- with _ -> f n t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement