Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- newtype FiniteSet a = FiniteSet {
- unFiniteSet :: (Set a, Set a)
- (\\) :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a
- null :: Eq a => FiniteSet a -> Bool
- size :: FiniteSet a -> Int
- member :: Ord a => a -> FiniteSet a -> Bool
- notMember :: Ord a => a -> FiniteSet a -> Bool
- isSubsetOf :: Ord a => FiniteSet a -> FiniteSet a -> Bool
- isProperSubsetOf :: Ord a => FiniteSet a -> FiniteSet a -> Bool
- empty :: Set a -> FiniteSet a
- total :: FiniteSet a -> Set a
- singleton :: Set a -> a -> FiniteSet a
- insert :: Ord a => a -> FiniteSet a -> FiniteSet a
- delete :: Ord a => a -> FiniteSet a -> FiniteSet a
- union :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a
- difference :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a
- intersection :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a
- complement :: Ord a => FiniteSet a -> FiniteSet a
- filter :: (a -> Bool) -> FiniteSet a -> FiniteSet a
- partition :: (a -> Bool) -> FiniteSet a -> (FiniteSet a, FiniteSet a)
- map :: Ord b => (a -> b) -> FiniteSet a -> FiniteSet b
Documentation
FiniteSet | |
|
Ord a => HasInsert a (FiniteSet a) Source | |
Ord a => HasDelete a (FiniteSet a) Source | |
Eq a => Eq (FiniteSet a) Source | |
Show a => Show (FiniteSet a) Source | |
Ord a => CanBeProperSubset (FiniteSet a) Source | |
Ord a => CanBeSubset (FiniteSet a) Source | |
HasSize (FiniteSet a) Source | |
Ord a => HasComplement (FiniteSet a) Source | |
Ord a => HasDifference (FiniteSet a) Source | |
Ord a => HasIntersection (FiniteSet a) Source | |
Ord a => HasUnion (FiniteSet a) Source | |
HasSingletonWith (Set a) a (FiniteSet a) Source | |
HasTotalWith (FiniteSet a) (FiniteSet a) Source | |
HasEmptyWith (Set a) (FiniteSet a) Source |
Operators
Query
Construction
Combine
complement :: Ord a => FiniteSet a -> FiniteSet a Source
/O(n+t)
Filter
partition :: (a -> Bool) -> FiniteSet a -> (FiniteSet a, FiniteSet a) Source
O(n) - Guaranteed to be disjoint