diff --git a/src/Data/Abstract/Live.hs b/src/Data/Abstract/Live.hs index 32610355a..d8263139d 100644 --- a/src/Data/Abstract/Live.hs +++ b/src/Data/Abstract/Live.hs @@ -3,6 +3,7 @@ module Data.Abstract.Live where import Data.Abstract.Address import Data.Bifunctor (second) +import Data.Function (on) import Data.Functor.Classes.Generic import Data.Semigroup import Data.Set as Set @@ -18,6 +19,9 @@ singleton = Live . Set.singleton delete :: Ord l => Address l v -> Live l v -> Live l v delete addr (Live s) = Live (Set.delete addr s) +difference :: Ord l => Live l v -> Live l v -> Live l v +difference = fmap Live . (Set.difference `on` unLive) + member :: Ord l => Address l v -> Live l v -> Bool member addr = Set.member addr . unLive