Changeset 11961

Show
Ignore:
Timestamp:
16.07.2009 20:56:07 (8 months ago)
Author:
mkhl
Message:

Add Rel.intersection.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Common/Lib/Rel.hs

    r11871 r11961  
    3434module Common.Lib.Rel 
    3535    ( Rel(), empty, null, insert, member, toMap, map 
    36     , union , isSubrelOf, difference, path, delete 
    37     , succs, predecessors, irreflex, sccOfClosure 
     36    , union, intersection, isSubrelOf, difference, path 
     37    , delete, succs, predecessors, irreflex, sccOfClosure 
    3838    , transClosure, fromList, toList, image, toPrecMap 
    3939    , intransKernel, mostRight, restrict, delSet 
     
    6969union :: Ord a => Rel a -> Rel a -> Rel a 
    7070union a b = fromSet $ Set.union (toSet a) $ toSet b 
     71 
     72-- | intersection of two relations 
     73intersection :: Ord a => Rel a -> Rel a -> Rel a 
     74intersection a b = fromSet $ Set.intersection (toSet a) $ toSet b 
    7175 
    7276-- | is the first relation a sub-relation of the second