
15 Nov
2012
15 Nov
'12
5:34 a.m.
When using the new Data.Map.fromSet function I encountered that I use it many times in connection with Map.intersection and Map.difference like so Map.intersection m (Map.fromSet (const ()) s) Map.difference m (Map.fromSet (const ()) s) Actually the element types of the second operands of Map.intersection and Map.difference are completely independent and the values of these maps are not touched. Thus I think that intersection and difference with a Set are the more natural operation. How about adding Map.intersectionSet :: Ord k => Map k a -> Set k -> Map k a Map.differenceSet :: Ord k => Map k a -> Set k -> Map k a to Data.Map?