filter in Ocaml
摘要:
1 let filter p l = 2 let rec filter_int g ll rr = 3 match ll with 4 | [] -> rr 5 | h::r -> if (g h) then filter_int g r (h::rr) else filter_int g r rr 6 in 7 let rec map_int g ll rr = 8 match ll with 9 | [] -> rr10 | h::r -> map_int ... 阅读全文
posted @ 2012-11-25 19:04 mathlover 阅读(205) 评论(0) 推荐(0) 编辑