ajhc-0.8.0.6: Haskell compiler that produce binary through C language

Safe HaskellNone

Util.Relation

Description

extend Data.Set with relation operations

Documentation

newtype Rel a b Source

Constructors

Rel (Map a (Set b)) 

Instances

(Eq a, Eq b) => Eq (Rel a b) 
(Ord a, Ord b) => Monoid (Rel a b) 
(Ord a, Ord b) => Collection (Rel a b) 
(Ord a, Ord b) => Unionize (Rel a b) 

prune :: Map a (Set b) -> Rel a bSource

domain :: (Ord a, Ord b) => Rel a b -> Set aSource

range :: (Ord a, Ord b) => Rel a b -> Set bSource

restrictDomain :: (Ord a, Ord b) => (a -> Bool) -> Rel a b -> Rel a bSource

restrictDomainS :: (Ord a, Ord b) => a -> Rel a b -> Rel a bSource

restrictDomainSet :: (Ord a, Ord b) => Set a -> Rel a b -> Rel a bSource

restrictRange :: (Ord a, Ord b) => (b -> Bool) -> Rel a b -> Rel a bSource

mapDomain :: (Ord a, Ord b, Ord c) => (a -> c) -> Rel a b -> Rel c bSource

mapRange :: (Ord a, Ord b, Ord c) => (b -> c) -> Rel a b -> Rel a cSource

partitionDomain :: (a -> Bool) -> Rel a b -> (Rel a b, Rel a b)Source

unRel :: Rel t t1 -> Map t (Set t1)Source

toRelationList :: (Ord a, Ord b) => Rel a b -> [(a, [b])]Source