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

📝 liveSplit.

This commit is contained in:
Rob Rix 2017-12-20 16:51:56 -05:00
parent fc9ded164d
commit 2fcb8b3834

View File

@ -34,6 +34,7 @@ liveDifference = fmap Live . (Set.difference `on` unLive)
liveMember :: Ord l => Address l v -> Live l v -> Bool
liveMember addr = Set.member addr . unLive
-- | Decompose a 'Live' set into a pair of one member address and the remaining set, or 'Nothing' if empty.
liveSplit :: Ord l => Live l v -> Maybe (Address l v, Live l v)
liveSplit = fmap (second Live) . Set.minView . unLive