2006-12-04から1日間の記事一覧

ExtList.List.filter_mapが死ぬほど便利. type t = A of int | B of string let filter_a xs = List.filter (fun x -> match x with A i -> true | _ -> false) xs let get_a_integers xs = List.map (fun x -> match x with A i -> i | _ -> assert false)…