equal
deleted
inserted
replaced
91 |
91 |
92 |
92 |
93 modifyElem :: MStore e -> (e -> e) -> ElemIndex -> IO () |
93 modifyElem :: MStore e -> (e -> e) -> ElemIndex -> IO () |
94 modifyElem (MStore ref) f (ElemIndex n) = do |
94 modifyElem (MStore ref) f (ElemIndex n) = do |
95 (_, _, arr) <- readIORef ref |
95 (_, _, arr) <- readIORef ref |
96 IOA.readArray arr n >>= (IOA.writeArray arr n) . f |
96 IOA.readArray arr n >>= IOA.writeArray arr n . f |
97 |
97 |
98 elemExists :: MStore e -> ElemIndex -> IO Bool |
98 elemExists :: MStore e -> ElemIndex -> IO Bool |
99 elemExists (MStore ref) (ElemIndex n) = do |
99 elemExists (MStore ref) (ElemIndex n) = do |
100 (_, free, _) <- readIORef ref |
100 (_, free, _) <- readIORef ref |
101 return $ n `IntSet.notMember` free |
101 return $ n `IntSet.notMember` free |