Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
- data OSet a
- empty :: OSet a
- singleton :: a -> OSet a
- (<|) :: Ord a => a -> OSet a -> OSet a
- (|<) :: Ord a => a -> OSet a -> OSet a
- (>|) :: Ord a => OSet a -> a -> OSet a
- (|>) :: Ord a => OSet a -> a -> OSet a
- (<>|) :: Ord a => OSet a -> OSet a -> OSet a
- (|<>) :: Ord a => OSet a -> OSet a -> OSet a
- null :: OSet a -> Bool
- size :: OSet a -> Int
- member :: Ord a => a -> OSet a -> Bool
- notMember :: Ord a => a -> OSet a -> Bool
- delete :: Ord a => a -> OSet a -> OSet a
- filter :: Ord a => (a -> Bool) -> OSet a -> OSet a
- (\\) :: Ord a => OSet a -> OSet a -> OSet a
- type Index = Int
- findIndex :: Ord a => a -> OSet a -> Maybe Index
- elemAt :: OSet a -> Index -> Maybe a
- fromList :: Ord a => [a] -> OSet a
- toAscList :: OSet a -> [a]
Documentation
Instances
Foldable OSet Source # | Values appear in insertion order, not ascending order. |
Defined in Data.Set.Ordered fold :: Monoid m => OSet m -> m # foldMap :: Monoid m => (a -> m) -> OSet a -> m # foldr :: (a -> b -> b) -> b -> OSet a -> b # foldr' :: (a -> b -> b) -> b -> OSet a -> b # foldl :: (b -> a -> b) -> b -> OSet a -> b # foldl' :: (b -> a -> b) -> b -> OSet a -> b # foldr1 :: (a -> a -> a) -> OSet a -> a # foldl1 :: (a -> a -> a) -> OSet a -> a # elem :: Eq a => a -> OSet a -> Bool # maximum :: Ord a => OSet a -> a # | |
Eq a => Eq (OSet a) Source # | |
Ord a => Ord (OSet a) Source # | |
(Ord a, Read a) => Read (OSet a) Source # | |
Show a => Show (OSet a) Source # | |
Trivial sets
Insertion
Conventionts:
- The open side of an angle bracket points to an
OSet
- The pipe appears on the side whose indices take precedence for keys that appear on both sides
- The left argument's indices are lower than the right argument's indices
Query
Deletion
(\\) :: Ord a => OSet a -> OSet a -> OSet a Source #
Set difference: r \\ s
deletes all the values in s
from r
. The
order of r
is unchanged.
Indexing
A 0-based index, much like the indices used by lists' !!
operation. All
indices are with respect to insertion order.