
7 Jul
2019
7 Jul
'19
1:22 p.m.
In https://github.com/haskell/containers/issues/647 I proposed the following util: composition :: Ord b => Map b c -> Map a b -> Map a c composition bc ab = flip mapMaybe ab $ flip lookup bc Which has O(|ab| * log |bc|) performance. It's not particularly hard to write, but it does feel like a primitive-ish operation, and it's not obvious to me whether there's a faster implementation. Other name suggestions - (.) - chain - compose