Safe Haskell | None |
---|---|
Language | GHC2021 |
Test.Credit
Synopsis
- data Size
- logstar :: Size -> Credit
- log2 :: Size -> Credit
- linear :: Size -> Credit
- data Strategy
- genTree :: Arbitrary op => Strategy -> Gen (Tree op)
- class (Arbitrary op, Show op) => DataStructure (t :: (Type -> Type) -> Type) op | t -> op where
- create :: forall (m :: Type -> Type). MonadInherit m => t m
- action :: MonadInherit m => t m -> op -> (Credit, m (t m))
- runTree :: forall (t :: (Type -> Type) -> Type) op. DataStructure t op => Tree op -> Either Error ()
- checkCredits :: forall (t :: (Type -> Type) -> Type) op. DataStructure t op => Strategy -> Property
- runTreeMemory :: forall (t :: (Type -> Type) -> Type) op. (MemoryStructure t, DataStructure t op) => Tree op -> String
- checkCreditsMemory :: forall (t :: (Type -> Type) -> Type) op. (MemoryStructure t, DataStructure t op) => Strategy -> Property
Common time-complexity functions
Instances
Enum Size Source # | |
Num Size Source # | |
Integral Size Source # | |
Real Size Source # | |
Defined in Test.Credit Methods toRational :: Size -> Rational # | |
Show Size Source # | |
Eq Size Source # | |
Ord Size Source # | |
Pretty Size Source # | |
Defined in Test.Credit | |
Monad m => MemoryCell m Size Source # | |
Defined in Test.Credit Methods prettyCell :: Size -> m Memory Source # |
Tree shapes for testing
Testing data structures on trees of operations
class (Arbitrary op, Show op) => DataStructure (t :: (Type -> Type) -> Type) op | t -> op where Source #
Methods
create :: forall (m :: Type -> Type). MonadInherit m => t m Source #
action :: MonadInherit m => t m -> op -> (Credit, m (t m)) Source #
Instances
runTree :: forall (t :: (Type -> Type) -> Type) op. DataStructure t op => Tree op -> Either Error () Source #
checkCredits :: forall (t :: (Type -> Type) -> Type) op. DataStructure t op => Strategy -> Property Source #
Evaluate the queue operations using the given strategy on the given queue Reports only if evaluation succeeded.
runTreeMemory :: forall (t :: (Type -> Type) -> Type) op. (MemoryStructure t, DataStructure t op) => Tree op -> String Source #
checkCreditsMemory :: forall (t :: (Type -> Type) -> Type) op. (MemoryStructure t, DataStructure t op) => Strategy -> Property Source #
Evaluate the queue operations using the given strategy on the given queue Reports only if evaluation succeeded.