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

Test.Credit.Deque.Catenable

Synopsis

Documentation

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

A rose tree where the elements are pre-ordered

Constructors

E 
C 

Fields

Instances

Instances details
BoundedDeque CatDeque Source # 
Instance details

Defined in Test.Credit.Deque.Catenable

Methods

qcost :: Size -> DequeOp a -> Credit Source #

Deque CatDeque Source # 
Instance details

Defined in Test.Credit.Deque.Catenable

Methods

empty :: MonadInherit m => m (CatDeque a m) Source #

cons :: MonadInherit m => a -> CatDeque a m -> m (CatDeque a m) Source #

snoc :: MonadInherit m => CatDeque a m -> a -> m (CatDeque a m) Source #

uncons :: MonadInherit m => CatDeque a m -> m (Maybe (a, CatDeque a m)) Source #

unsnoc :: MonadInherit m => CatDeque a m -> m (Maybe (CatDeque a m, a)) Source #

concat :: MonadInherit m => CatDeque a m -> CatDeque a m -> m (CatDeque a m) Source #

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

Defined in Test.Credit.Deque.Catenable

Methods

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

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

Defined in Test.Credit.Deque.Catenable

data CLazyCon (m :: Type -> Type) a where Source #

Constructors

Pure :: forall a (m :: Type -> Type). a -> CLazyCon m a 
LinkAll :: forall (m :: Type -> Type) a1. BQueue (Thunk m (CLazyCon m) (CatDeque a1 m)) m -> CLazyCon m (CatDeque a1 m) 

Instances

Instances details
MonadInherit m => HasStep (CLazyCon m :: Type -> Type) (m :: Type -> Type) Source # 
Instance details

Defined in Test.Credit.Deque.Catenable

Methods

step :: CLazyCon m a -> m a Source #

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

Defined in Test.Credit.Deque.Catenable

Methods

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

link :: MonadInherit m => CatDeque a m -> Thunk m (CLazyCon m) (CatDeque a m) -> m (CatDeque a m) Source #

linkAll :: MonadInherit m => BQueue (Thunk m (CLazyCon m) (CatDeque a m)) m -> m (CatDeque a m) Source #

concat' :: MonadInherit m => CatDeque a m -> CatDeque a m -> m (CatDeque a m) Source #

dischargeThunk :: MonadInherit m => Thunk m (CLazyCon m) (CatDeque a m) -> m () Source #

Assign credits to the thunk and force it unless it is a `LinkAll(t:_)` where t requires credits. In the latter case, recursive until we can force a thunk.