
Data.Ring.Semi.BitSet  Portability  portable (instances use MPTCs)  Stability  experimental  Maintainer  ekmett@gmail.com 





Description 
Replacement for Data.BitSet extended to handle enumerations where fromEnum
can return negative values, support efficient intersection and union
and allow complementing of the set with respect to the bounds of the
enumeration. Treated as a Boolean semiring over .&./... To get a
Boolean Ring, use Boolean (BitSet a).


Synopsis 



Documentation 

module Data.Monoid.Reducer 

module Data.Ring 

BitSet



Set operations optimized for tightly grouped sets or nearly universal sets with a close by group of elements missing.
Stores itself like an arbitrary precision floating point number, tracking the least valued member of the set and an
Integer comprised of the members.
 Instances  Typeable1 BitSet  Foldable BitSet  Enum a => Reducer a (BitSet a)  (Bounded a, Enum a) => Algebra Natural (BitSet a)  Enum a => Bimodule Natural (BitSet a)  Enum a => RightModule Natural (BitSet a)  Enum a => LeftModule Natural (BitSet a)  Enum a => Module Natural (BitSet a)  (Enum a, Bounded a) => Bounded (BitSet a)  (Enum a, Bounded a) => Enum (BitSet a)  Eq (BitSet a)  (Enum a, Data a) => Data (BitSet a)  (Show a, Bounded a, Enum a) => Num (BitSet a)  (Enum a, Read a) => Read (BitSet a)  Show a => Show (BitSet a)  Enum a => Monoid (BitSet a)  (Show a, Bounded a, Enum a) => Bits (BitSet a)  Generator (BitSet a)  (Bounded a, Enum a) => Multiplicative (BitSet a)  (Bounded a, Enum a) => SemiRing (BitSet a)  (Bounded a, Enum a) => RightSemiNearRing (BitSet a)  (Bounded a, Enum a) => LeftSemiNearRing (BitSet a)  (Bounded a, Enum a) => Ringoid (BitSet a)  (Bounded a, Enum a) => Algebra (BitSet a) (BitSet a)  (Bounded a, Enum a) => Bimodule (BitSet a) (BitSet a)  (Bounded a, Enum a) => RightModule (BitSet a) (BitSet a)  (Bounded a, Enum a) => LeftModule (BitSet a) (BitSet a)  (Bounded a, Enum a) => Module (BitSet a) (BitSet a) 



Manipulation



O(1) The empty set. Permits O(1) null and size.



O(1) Construct a BitSet with a single element. Permits O(1) null and size



O(d) A BitSet containing every member of the enumeration of a.



O(d).



O(d)



O(d) Insert a single element of type a into the BitSet. Preserves order of null and size



O(d) Delete a single item from the BitSet. Preserves order of null and size



O(d) Infix difference



O(d * n) Make a BitSet from a list of items.



O(d * n) Make a BitSet from a distinct ascending list of items


Acessors



O(1) Test for membership in a BitSet



O(1) amortized cost. Is the BitSet empty? May be faster than checking if size == 0.



O(1) amortized cost. The number of elements in the bit set.



O(1) Check to see if we are represented as a complemented BitSet.



O(d) convert to an Integer representation. Discards negative elements


Produced by Haddock version 2.3.0 