-
Notifications
You must be signed in to change notification settings - Fork 186
Closed
Description
I was surprised that I couldn't find a Map
composition function in containers
. It seems it could be done with something no worse than O(n * log m)
, where n
is the size of the initial/source map.
composition :: (Ord a, Ord b) => Map.Map b c -> Map.Map a b -> Map.Map a c
composition bc ab = flip Map.mapMaybe ab $ flip Map.lookup bc
Metadata
Metadata
Assignees
Labels
No labels