- masterChildCommon =
- Map.fromList . catMaybes . map procKV . Map.toList . Map.union
- (Map.intersection master lastchild) $
- (Map.intersection child master)
- where procKV (k, v) =
- case (Map.lookup k master, Map.lookup k child,
- Map.lookup k lastchild) of
- (Just m, Just c, Just lc) ->
- if lc == c
- then if lc == m
- then Nothing
- else Just (k, m)
- else Just (k, c)
- (Just m, Just c, Nothing) ->
- if m == c
- then Nothing
- else Just (k, c)
- (Just m, Nothing, Just lc) ->
- if m == lc
+
+ masterMods = catMaybes . map procKV $ (Map.toList master)
+ where procKV (k, m) =
+ case (Map.lookup k child, Map.lookup k lastchild) of
+ (Just c, Just lc) ->
+ if c == lc -- child didn't change