creditmonad-1.0.0: Reasoning about amortized time complexity
Safe HaskellNone
LanguageGHC2021

Test.Credit.Heap.Binomial

Documentation

data Tree a Source #

Constructors

Node Int a [Tree a] 

Instances

Instances details
MemoryCell m a => MemoryCell m (Tree a) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

prettyCell :: Tree a -> m Memory Source #

Show a => Show (Tree a) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

showsPrec :: Int -> Tree a -> ShowS #

show :: Tree a -> String #

showList :: [Tree a] -> ShowS #

Eq a => Eq (Tree a) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

(==) :: Tree a -> Tree a -> Bool #

(/=) :: Tree a -> Tree a -> Bool #

Ord a => Ord (Tree a) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

compare :: Tree a -> Tree a -> Ordering #

(<) :: Tree a -> Tree a -> Bool #

(<=) :: Tree a -> Tree a -> Bool #

(>) :: Tree a -> Tree a -> Bool #

(>=) :: Tree a -> Tree a -> Bool #

max :: Tree a -> Tree a -> Tree a #

min :: Tree a -> Tree a -> Tree a #

rank :: Tree a -> Int Source #

root :: Tree a -> a Source #

rev :: MonadCredit m => [a] -> [a] -> m [a] Source #

link :: Ord a => Tree a -> Tree a -> Tree a Source #

insTree :: (MonadCredit m, Ord a) => Tree a -> [Tree a] -> m [Tree a] Source #

mrg :: (MonadCredit m, Ord a) => [Tree a] -> [Tree a] -> m [Tree a] Source #

removeMinTree :: (MonadCredit m, Ord a) => [Tree a] -> m (Tree a, [Tree a]) Source #

data Binomial a (m :: Type -> Type) Source #

Constructors

Binomial Size (Thunk m (Lazy m) [Tree a]) 

Instances

Instances details
BoundedHeap Binomial Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

hcost :: Size -> HeapOp a -> Credit Source #

Heap Binomial Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

empty :: MonadCredit m => m (Binomial a m) Source #

insert :: (MonadCredit m, Ord a) => a -> Binomial a m -> m (Binomial a m) Source #

merge :: (MonadCredit m, Ord a) => Binomial a m -> Binomial a m -> m (Binomial a m) Source #

splitMin :: (MonadCredit m, Ord a) => Binomial a m -> m (Maybe (a, Binomial a m)) Source #

(MonadMemory m, MemoryCell m a) => MemoryCell m (Binomial a m) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial

Methods

prettyCell :: Binomial a m -> m Memory Source #

Pretty a => MemoryStructure (Binomial (PrettyCell a)) Source # 
Instance details

Defined in Test.Credit.Heap.Binomial