1 module Auxiliary ( breakMap
6 import qualified Data.Map as M
8 dupl :: (Arrow a) => a b c -> a (b,b) (c,c)
11 breakMap :: (Ord k) => k -> Map k a -> (Map k a, Map k a)
12 breakMap k m = (smaller, larger')
13 where (smaller, maybeValue, larger) = M.splitLookup k m
14 larger' = maybe larger (\v -> M.insert k v larger) maybeValue