1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

📝 liveDifference.

This commit is contained in:
Rob Rix 2017-12-20 16:29:55 -05:00
parent 31a561751c
commit 06be77e006

View File

@ -26,6 +26,7 @@ liveInsert addr = Live . Set.insert addr . unLive
liveDelete :: Ord l => Address l v -> Live l v -> Live l v liveDelete :: Ord l => Address l v -> Live l v -> Live l v
liveDelete addr = Live . Set.delete addr . unLive liveDelete addr = Live . Set.delete addr . unLive
-- | Compute the (asymmetric) difference of two 'Live' sets, i.e. delete every element of the second set from the first set.
liveDifference :: Ord l => Live l v -> Live l v -> Live l v liveDifference :: Ord l => Live l v -> Live l v -> Live l v
liveDifference = fmap Live . (Set.difference `on` unLive) liveDifference = fmap Live . (Set.difference `on` unLive)