Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype BitSet = BitSet {}
- emptyBS :: BitSet
- singletonBS :: Int -> BitSet
- insertBS :: Int -> BitSet -> BitSet
- deleteBS :: Int -> BitSet -> BitSet
- memberBS :: Int -> BitSet -> Bool
- notMemberBS :: Int -> BitSet -> Bool
- nullBS :: BitSet -> Bool
- sizeBS :: BitSet -> Int
- isSubsetOfBS :: BitSet -> BitSet -> Bool
- unionBS :: BitSet -> BitSet -> BitSet
- complementBS :: BitSet -> BitSet
- differenceBS :: BitSet -> BitSet -> BitSet
- intersectionBS :: BitSet -> BitSet -> BitSet
- findMinBS :: BitSet -> Int
- findMaxBS :: BitSet -> Int
- deleteMinBS :: BitSet -> BitSet
- deleteMaxBS :: BitSet -> BitSet
- deleteFindMinBS :: BitSet -> (Int, BitSet)
- deleteFindMaxBS :: BitSet -> (Int, BitSet)
- minViewBS :: BitSet -> Maybe (Int, BitSet)
- maxViewBS :: BitSet -> Maybe (Int, BitSet)
- powersetBS :: Monad m => BitSet -> Stream m BitSet
- strictPowersetBS :: Monad m => BitSet -> Stream m BitSet
- toListBS :: BitSet -> [Int]
- toStreamBS :: Monad m => BitSet -> Stream m Int
Documentation
>>>
:set -XOverloadedLists
Instances
singletonBS :: Int -> BitSet Source #
insertBS :: Int -> BitSet -> BitSet Source #
>>>
insertBS 0 []
fromList [0]>>>
insertBS 0 [0]
fromList [0]
deleteBS :: Int -> BitSet -> BitSet Source #
>>>
deleteBS 2 [1,2,3]
fromList [1,3]>>>
deleteBS 10 [1,2,3]
fromList [1,2,3]>>>
deleteBS 0 []
fromList []
isSubsetOfBS :: BitSet -> BitSet -> Bool Source #
>>>
isSubsetOfBS [] [1,2,3]
True>>>
isSubsetOfBS [1] []
False>>>
isSubsetOfBS [1,2,3] [1,2,3]
True
complementBS :: BitSet -> BitSet Source #
deleteMinBS :: BitSet -> BitSet Source #
>>>
deleteMinBS [1,2,3]
fromList [2,3]>>>
deleteMinBS []
fromList []
deleteMaxBS :: BitSet -> BitSet Source #
>>>
deleteMaxBS [1,2,3]
fromList [1,2]>>>
deleteMaxBS []
fromList []
powersetBS :: Monad m => BitSet -> Stream m BitSet Source #
>>>
import Data.Functor.Identity
>>>
runIdentity . MS.toList $ powersetBS [0,1,2]
[fromList [0,1,2],fromList [1,2],fromList [0,2],fromList [2],fromList [0,1],fromList [1],fromList [0],fromList []]>>>
runIdentity . MS.toList $ powersetBS []
[fromList []]
strictPowersetBS :: Monad m => BitSet -> Stream m BitSet Source #
>>>
import Data.Functor.Identity
>>>
runIdentity . MS.toList $ strictPowersetBS [0,1,2]
[fromList [1,2],fromList [0,2],fromList [2],fromList [0,1],fromList [1],fromList [0],fromList []]>>>
runIdentity . MS.toList $ strictPowersetBS []
[]