example.ml
- open Batteries
- module type M =
- sig
- include Map.S
- val filter: (key -> 'a -> bool) -> 'a t -> 'a t
- end
- module BetterMap (OM: Map.S): (M with type key = OM.key) =
- struct
- include OM
- let filter pred m =
- fold
- (fun k v accum ->
- if pred k v then
- add k v accum
- else
- accum)
- m
- empty
- end
- module IntMap = BetterMap(IntMap)
error.txt
- Values do not match:
- val filter : (key -> 'a -> bool) -> 'a t -> 'a t
- is not included in
- val filter : ('a -> bool) -> 'a t -> 'a t