Hoogle Search
Within Stackage Nightly 2025-10-08 (ghc-9.12.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
offsetBytes :: Int -> StringBuffer -> StringBufferghc GHC.Data.StringBuffer Return a StringBuffer with the first n bytes removed. Warning: If there aren't enough characters, the returned StringBuffer will be invalid and any use of it may lead to undefined behavior. The result shares the same buffer as the original.
fromSet :: (Key -> a) -> Word64Set -> Word64Map aghc GHC.Data.Word64Map.Internal Build a map from a set of keys and a function which for each key computes its value.
fromSet (\k -> replicate k 'a') (Data.Word64Set.fromList [3, 5]) == fromList [(5,"aaaaa"), (3,"aaa")] fromSet undefined Data.Word64Set.empty == empty
keysSet :: Word64Map a -> Word64Setghc GHC.Data.Word64Map.Internal The set of all keys of the map.
keysSet (fromList [(5,"a"), (3,"b")]) == Data.Word64Set.fromList [3,5] keysSet empty == Data.Word64Set.empty
fromSet :: (Key -> a) -> Word64Set -> Word64Map aghc GHC.Data.Word64Map.Lazy Build a map from a set of keys and a function which for each key computes its value.
fromSet (\k -> replicate k 'a') (Data.Word64Set.fromList [3, 5]) == fromList [(5,"aaaaa"), (3,"aaa")] fromSet undefined Data.Word64Set.empty == empty
keysSet :: Word64Map a -> Word64Setghc GHC.Data.Word64Map.Lazy The set of all keys of the map.
keysSet (fromList [(5,"a"), (3,"b")]) == Data.Word64Set.fromList [3,5] keysSet empty == Data.Word64Set.empty
fromSet :: (Key -> a) -> Word64Set -> Word64Map aghc GHC.Data.Word64Map.Strict Build a map from a set of keys and a function which for each key computes its value.
fromSet (\k -> replicate k 'a') (Data.Word64Set.fromList [3, 5]) == fromList [(5,"aaaaa"), (3,"aaa")] fromSet undefined Data.Word64Set.empty == empty
keysSet :: Word64Map a -> Word64Setghc GHC.Data.Word64Map.Strict The set of all keys of the map.
keysSet (fromList [(5,"a"), (3,"b")]) == Data.Word64Set.fromList [3,5] keysSet empty == Data.Word64Set.empty
fromSet :: (Key -> a) -> Word64Set -> Word64Map aghc GHC.Data.Word64Map.Strict.Internal Build a map from a set of keys and a function which for each key computes its value.
fromSet (\k -> replicate k 'a') (Data.Word64Set.fromList [3, 5]) == fromList [(5,"aaaaa"), (3,"aaa")] fromSet undefined Data.Word64Set.empty == empty
keysSet :: Word64Map a -> Word64Setghc GHC.Data.Word64Map.Strict.Internal The set of all keys of the map.
keysSet (fromList [(5,"a"), (3,"b")]) == Data.Word64Set.fromList [3,5] keysSet empty == Data.Word64Set.empty
-
Finite Int Sets
The Word64Set type represents a set of elements of type Int. For a walkthrough of the most commonly used functions see their sets introduction. These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.import Data.Word64Set (Word64Set) import qualified Data.Word64Set as Word64Set
Performance information
Many operations have a worst-case complexity of <math>. This means that the operation can become linear in the number of elements with a maximum of <math> -- the number of bits in an Int (32 or 64).Implementation
The implementation is based on big-endian patricia trees. This data structure performs especially well on binary operations like union and intersection. However, my benchmarks show that it is also (much) faster on insertions and deletions when compared to a generic size-balanced set implementation (see Data.Set).- Chris Okasaki and Andy Gill, "Fast Mergeable Integer Maps", Workshop on ML, September 1998, pages 77-86, http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.5452
- D.R. Morrison, "PATRICIA -- Practical Algorithm To Retrieve Information Coded In Alphanumeric", Journal of the ACM, 15(4), October 1968, pages 514-534.