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

Test.Credit.Deque.Streams

Synopsis

Documentation

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

Constructors

SCons a (Stream m a) 
SNil 
SIndirect (SThunk m (Stream m a)) 

Instances

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

Defined in Test.Credit.Deque.Streams

Methods

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

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

Constructors

SAppend :: forall (m :: Type -> Type) a1. Stream m a1 -> Stream m a1 -> SLazyCon m (Stream m a1) 
SRevDrop :: forall (m :: Type -> Type) a1. Int -> Stream m a1 -> Stream m a1 -> SLazyCon m (Stream m a1) 
STake :: forall (m :: Type -> Type) a1. Int -> Stream m a1 -> SLazyCon m (Stream m a1) 

Instances

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

Defined in Test.Credit.Deque.Streams

Methods

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

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

Defined in Test.Credit.Deque.Streams

Methods

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

smatch Source #

Arguments

:: MonadInherit m 
=> Stream m a

Scrutinee

-> (a -> Stream m a -> m b)

Cons case

-> m b

Nil case

-> m b 

Smart destructor for streams, consuming one credit

credit :: MonadInherit m => Credit -> Stream m a -> m () Source #

eval :: MonadInherit m => Int -> Stream m a -> m () Source #