-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Sets and maps with 8-bit words for keys -- -- This library provides variant of Data.Map and -- Data.Set from the containers library where the key -- is specialized to Word8. Internally, this uses a 256-bit -- bitmask for the presence of keys and a SmallArray of values -- of keys that were present. For example, the map {2 => Z, 3 -- => B, 5 => X, 9 => A} would be repsented in memory as: -- --
-- Bitmask: 0011010001000000... (240 more zero bits) -- Value Array: Z,B,X,A ---- -- This is optimized for reads. Lookup is O(1). Union is -- technically O(1) but only because the universe of keys is -- finite. The current implementation always scans through all 256 bits -- of key space. @package byte-containers @version 0.1.0.1 module Data.Map.Word8 -- | A map whose keys are 8-bit words. data Map a -- | Lookup the value at a key in the map. lookup :: Word8 -> Map a -> Maybe a -- | Is the passed map empty? null :: Map a -> Bool -- | The number of elements the passed map contains. size :: Map a -> Int -- | The empty map. empty :: Map a singleton :: Word8 -> a -> Map a -- | The expression union t1 t2 takes the left-biased union -- of t1 and t2. It prefers t1 when duplicate -- keys are encountered (i.e. union == unionWith -- const). union :: Map a -> Map a -> Map a -- | Union with a combining function. unionWith :: (a -> a -> a) -> Map a -> Map a -> Map a insert :: Word8 -> a -> Map a -> Map a -- | Insert with a function, combining new value and old value. -- insertWith f key value mp will insert the pair -- (key, value) into mp if key does not exist -- in the map. If the key does exist, the function will insert the pair -- (key, f new_value old_value). insertWith :: (a -> a -> a) -> Word8 -> a -> Map a -> Map a foldrWithKeys :: (Word8 -> a -> b -> b) -> b -> Map a -> b foldl' :: (b -> a -> b) -> b -> Map a -> b traverse_ :: Applicative m => (a -> m b) -> Map a -> m () toList :: Map a -> [(Word8, a)] fromList :: [(Word8, a)] -> Map a instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Map.Word8.Map a) instance GHC.Base.Functor Data.Map.Word8.Map instance GHC.Show.Show a => GHC.Show.Show (Data.Map.Word8.Map a) instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Data.Map.Word8.Map a) instance GHC.Base.Semigroup a => GHC.Base.Monoid (Data.Map.Word8.Map a) module Data.Set.Word8 -- | A map whose keys are 8-bit words. data Set member :: Word8 -> Set -> Bool -- | Is the passed map empty? null :: Set -> Bool -- | The number of elements the passed map contains. size :: Set -> Int empty :: Set singleton :: Word8 -> Set union :: Set -> Set -> Set insert :: Word8 -> Set -> Set