setop-0.1.0.0: Perform set operations on files.

Safe HaskellSafe
LanguageHaskell2010

Setop

Description

Implementation of Set Operations.

Synopsis

Documentation

fromList :: Ord a => [a] -> Set a Source #

Set construction.

toList :: Set a -> [a] Source #

Set export to list.

union :: Ord a => Set a -> Set a -> Set a Source #

Set Union on two sets.

>>> fromList [0, 1, 2] `union` fromList [0, 2, 4]
fromList [0,1,2,4]
>>> fromList [0, 2, 4] `union` fromList [0, 1, 2]
fromList [0,1,2,4]

difference :: Ord a => Set a -> Set a -> Set a Source #

Set Difference on two sets.

>>> fromList [0, 1, 2] `difference` fromList [0, 2, 4]
fromList [1]
>>> fromList [0, 2, 4] `difference` fromList [0, 1, 2]
fromList [4]

disjunction :: Ord a => Set a -> Set a -> Set a Source #

Set Disjunction on two sets.

>>> fromList [0, 1, 2] `disjunction` fromList [0, 2, 4]
fromList [1,4]
>>> fromList [0, 2, 4] `disjunction` fromList [0, 1, 2]
fromList [1,4]

intersection :: Ord a => Set a -> Set a -> Set a Source #

Set Intersection on two sets.

>>> fromList [0, 1, 2] `intersection` fromList [0, 2, 4]
fromList [0,2]
>>> fromList [0, 2, 4] `intersection` fromList [0, 1, 2]
fromList [0,2]