{-# LANGUAGE GADTs #-}
module Control.SetAlgebra
(
List,
BiMap,
Bimap,
Single (..),
Basic (..),
Iter (..),
Embed (..),
HasExp (..),
BaseRep (..),
dom,
rng,
dexclude,
drestrict,
rexclude,
rrestrict,
unionleft,
unionright,
unionplus,
singleton,
setSingleton,
intersect,
subset,
keyeq,
(◁),
(⋪),
(▷),
(⋫),
(∈),
(∉),
(∪),
(⨃),
(∪+),
(∩),
(⊆),
(≍),
(<|),
(|>),
(➖),
Exp (Base),
eval,
materialize,
biMapToMap,
biMapFromMap,
biMapFromList,
biMapEmpty,
fromList,
keysEqual,
forwards,
backwards,
)
where
import Control.Iterate.BaseTypes (BaseRep (..), Basic (..), Embed (..), Iter (..), List, Single (..))
import Control.Iterate.Exp
( Exp (..),
HasExp (..),
dexclude,
dom,
drestrict,
intersect,
keyeq,
rexclude,
rng,
rrestrict,
setSingleton,
singleton,
subset,
unionleft,
unionplus,
unionright,
(<|),
(|>),
(∈),
(∉),
(∩),
(∪),
(∪+),
(≍),
(⊆),
(⋪),
(⋫),
(▷),
(◁),
(➖),
(⨃),
)
import Control.Iterate.SetAlgebra
import Data.BiMap (BiMap (..), Bimap, biMapEmpty, biMapFromList, biMapFromMap, biMapToMap)
import Data.Map (Map)
import Data.MapExtras (keysEqual)
import Data.Set (Set)
forwards :: BiMap v k v -> Map k v
forwards :: BiMap v k v -> Map k v
forwards (MkBiMap Map k v
l Map v (Set k)
_r) = Map k v
l
backwards :: BiMap v k v -> Map v (Set k)
backwards :: BiMap v k v -> Map v (Set k)
backwards (MkBiMap Map k v
_l Map v (Set k)
r) = Map v (Set k)
r