Safe Haskell | None |
---|

Array utilities.

IArray is awkward and I don't like it. `vector`

is nicer but it's a big
library so I don't want to depend on it unless I have more than one data
structure using arrays.

## Synopsis

- type Array = Array Int
- empty :: Array a
- null :: Array a -> Bool
- length :: Array a -> Int
- from_list :: [a] -> Array a
- at :: String -> Array a -> Int -> a
- assert_in_bounds :: String -> Int -> Array a -> Int
- in_bounds :: Int -> Array a -> Bool
- check :: Int -> Array a -> Maybe (Array a)
- bsearch :: Ord k => Array k -> k -> Int
- bsearch_on :: Ord k => (a -> k) -> Array a -> k -> Int
- bsearch_with :: (k -> a -> Bool) -> Array a -> k -> Int
- _do_bsearch :: (a -> Bool) -> Array a -> Int -> Int -> Int