Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
(This is a part of MIOS.) Abstraction Layer for Mutable Vectors
Synopsis
- class VecFamily v a | v -> a where
- data family Vec a
- class SingleStorage s t | s -> t where
- type Bool' = IOVector Bool
- type Double' = ByteArrayDouble
- type Int' = ByteArrayInt
- class SingleStorage s Int => StackFamily s t | s -> t where
- type Stack = Vec Int
- newStackFromList :: [Int] -> IO Stack
- realLength :: Vec Int -> Int
- sortStack :: Stack -> IO ()
Vector class and type
class VecFamily v a | v -> a where Source #
The interface on vectors.
getNth :: v -> Int -> IO a Source #
returns the n-th value.
setNth :: v -> Int -> a -> IO () Source #
sets the n-th value.
erases all elements in it.
swapBetween :: v -> Int -> Int -> IO () Source #
returns the n-th value (index starts from zero in any case). | swaps two elements.
modifyNth :: v -> (a -> a) -> Int -> IO () Source #
calls the update function.
newVec :: Int -> a -> IO v Source #
returns a new vector.
setAll :: v -> a -> IO () Source #
sets all elements.
growBy :: v -> Int -> IO v Source #
extends the size of stack by n; note: values in new elements aren't initialized maybe.
asList :: v -> IO [a] Source #
converts to a list.
Instances
Another abstraction layer on Vector
which reserves zero element for internal use.
Note: If you want to use the 0-th element, use UVector Int
.
Instances
data Vec Double Source # | |
Defined in SAT.Mios.Vec | |
data Vec Int Source # | |
Defined in SAT.Mios.Vec |
SingleStorage
class SingleStorage s t | s -> t where Source #
Interface for single (one-length vector) mutable data
allocates and returns an new data.
gets the value.
set' :: s -> t -> IO () Source #
sets the value.
modify' :: s -> (t -> t) -> IO () Source #
calls an update function on it.
Instances
SingleStorage Bool' Bool Source # | |
SingleStorage Clause Int Source # |
|
SingleStorage ClauseExtManager Int Source # |
|
SingleStorage ClauseSimpleManager Int Source # |
|
Stack
class SingleStorage s Int => StackFamily s t | s -> t where Source #
Interface on stacks
newStack :: Int -> IO s Source #
returns a new stack.
pushTo :: s -> t -> IO () Source #
pushs an value to the tail of the stack.
popFrom :: s -> IO () Source #
pops the last element.
peeks the last element.
shrinkBy :: s -> Int -> IO () Source #
shrinks the stack.
Instances
StackFamily Clause Lit Source # |
|
StackFamily ClauseExtManager Clause Source # |
|
Defined in SAT.Mios.ClauseManager | |
StackFamily ClauseSimpleManager Clause Source # |
|
Defined in SAT.Mios.ClauseManager |