Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
data BinaryHeap (f :: Type -> Type) s a Source #
BinaryHeap | |
|
type MinBinaryHeap s a = BinaryHeap Identity s a Source #
type MaxBinaryHeap s a = BinaryHeap Down s a Source #
newBinaryHeap :: (Unbox a, PrimMonad m) => (a -> f a) -> Int -> m (BinaryHeap f (PrimState m) a) Source #
newMinBinaryHeap :: (Unbox a, PrimMonad m) => Int -> m (MinBinaryHeap (PrimState m) a) Source #
newMaxBinaryHeap :: (Unbox a, PrimMonad m) => Int -> m (MaxBinaryHeap (PrimState m) a) Source #
getBinaryHeapSize :: PrimMonad m => BinaryHeap f (PrimState m) a -> m Int Source #
siftUpBy :: (Unbox a, PrimMonad m) => (a -> a -> Ordering) -> Int -> MVector (PrimState m) a -> m () Source #
siftDownBy :: (Unbox a, PrimMonad m) => (a -> a -> Ordering) -> Int -> MVector (PrimState m) a -> m () Source #
heapifyBy :: (Unbox a, PrimMonad m) => (a -> a -> Ordering) -> MVector (PrimState m) a -> m () Source #
buildBinaryHeapVia :: (OrdVia f a, Unbox a, PrimMonad m) => (a -> f a) -> Vector a -> m (BinaryHeap f (PrimState m) a) Source #
buildMinBinaryHeap :: (Ord a, Unbox a, PrimMonad m) => Vector a -> m (BinaryHeap Identity (PrimState m) a) Source #
buildMaxBinaryHeap :: (Ord a, Unbox a, PrimMonad m) => Vector a -> m (BinaryHeap Down (PrimState m) a) Source #
unsafeViewBH :: (Unbox a, PrimMonad m) => BinaryHeap f (PrimState m) a -> m a Source #
viewBH :: (Unbox a, PrimMonad m) => BinaryHeap f (PrimState m) a -> m (Maybe a) Source #
insertBH :: (OrdVia f a, Unbox a, PrimMonad m) => a -> BinaryHeap f (PrimState m) a -> m () Source #
unsafeDeleteBH :: (OrdVia f a, Unbox a, PrimMonad m) => BinaryHeap f (PrimState m) a -> m () Source #
modifyTopBH :: (OrdVia f a, Unbox a, PrimMonad m) => (a -> a) -> BinaryHeap f (PrimState m) a -> m () Source #
deleteFindTopBH :: (OrdVia f a, Unbox a, PrimMonad m) => BinaryHeap f (PrimState m) a -> m (Maybe a) Source #
clearBH :: PrimMonad m => BinaryHeap f (PrimState m) a -> m () Source #
freezeInternalVecBH :: (Unbox a, PrimMonad m) => BinaryHeap f (PrimState m) a -> m (Vector a) Source #