diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-06-29 23:22:25 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-06-29 23:22:25 +0400 |
commit | f556bf196bf07308f024cc43c1a51dfd4c21188c (patch) | |
tree | 228de5a632e8b758d507df7ddabf7fd85d113694 /src/Data/Bitfield.hs | |
parent | d4ada1b8a392d67f2835935084c5f0f3ecef2ab5 (diff) |
+ Scetch basic broadcasting.
Diffstat (limited to 'src/Data/Bitfield.hs')
-rw-r--r-- | src/Data/Bitfield.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Bitfield.hs b/src/Data/Bitfield.hs index 11897786..46e0a71f 100644 --- a/src/Data/Bitfield.hs +++ b/src/Data/Bitfield.hs | |||
@@ -52,6 +52,7 @@ module Data.Bitfield | |||
52 | 52 | ||
53 | -- * Serialization | 53 | -- * Serialization |
54 | , fromBitmap, toBitmap | 54 | , fromBitmap, toBitmap |
55 | , toList | ||
55 | 56 | ||
56 | -- * Selection | 57 | -- * Selection |
57 | , Selector | 58 | , Selector |
@@ -259,6 +260,10 @@ unions = foldl' union (haveNone 0) | |||
259 | Serialization | 260 | Serialization |
260 | -----------------------------------------------------------------------} | 261 | -----------------------------------------------------------------------} |
261 | 262 | ||
263 | -- | List all have indexes. | ||
264 | toList :: Bitfield -> [PieceIx] | ||
265 | toList Bitfield {..} = S.toList bfSet | ||
266 | |||
262 | -- | Unpack 'Bitfield' from tightly packed bit array. Note resulting | 267 | -- | Unpack 'Bitfield' from tightly packed bit array. Note resulting |
263 | -- size might be more than real bitfield size, use 'adjustSize'. | 268 | -- size might be more than real bitfield size, use 'adjustSize'. |
264 | fromBitmap :: ByteString -> Bitfield | 269 | fromBitmap :: ByteString -> Bitfield |