monoids-0.1.28: Monoids, specialized containers and a general map/reduce frameworkSource codeContentsIndex
Data.Ring.Semi.BitSet
Synopsis
module Data.Monoid.Reducer
data BitSet a
empty :: BitSet a
singleton :: Enum a => a -> BitSet a
null :: BitSet a -> Bool
full :: (Enum a, Bounded a) => BitSet a
complement :: (Enum a, Bounded a) => BitSet a -> BitSet a
insert :: Enum a => a -> BitSet a -> BitSet a
delete :: Enum a => a -> BitSet a -> BitSet a
fromList :: Enum a => [a] -> BitSet a
fromDistinctAscList :: Enum a => [a] -> BitSet a
toInteger :: BitSet a -> Integer
(\\) :: (Enum a, Bounded a) => BitSet a -> BitSet a -> BitSet a
member :: Enum a => a -> BitSet a -> Bool
size :: BitSet a -> Int
Documentation
module Data.Monoid.Reducer
data BitSet a Source
show/hide Instances
empty :: BitSet aSource
The empty bit set.
singleton :: Enum a => a -> BitSet aSource
null :: BitSet a -> BoolSource
Is the bit set empty? Asymptotically faster than checking if size == 0 in some cases.
full :: (Enum a, Bounded a) => BitSet aSource
complement :: (Enum a, Bounded a) => BitSet a -> BitSet aSource
insert :: Enum a => a -> BitSet a -> BitSet aSource
O(d) Insert an item into the bit set.
delete :: Enum a => a -> BitSet a -> BitSet aSource
O(d) Delete an item from the bit set.
fromList :: Enum a => [a] -> BitSet aSource
O(d * n) Make a BitSet from a list of items.
fromDistinctAscList :: Enum a => [a] -> BitSet aSource
toInteger :: BitSet a -> IntegerSource
O(d) convert to an Integer representation. Discards negative elements
(\\) :: (Enum a, Bounded a) => BitSet a -> BitSet a -> BitSet aSource
member :: Enum a => a -> BitSet a -> BoolSource
O(testBit on Integer) Ask whether the item is in the bit set.
size :: BitSet a -> IntSource
O(1) or O(d) The number of elements in the bit set.
Produced by Haddock version 2.4.2