| Copyright | (c) 2022 Tim Emiola |
|---|---|
| License | BSD3 |
| Maintainer | Tim Emiola <adetokunbo@emio.la> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Test.KeyedVals.Hspec
Description
Uses Test.Hspec to validate the behaviour of a Handle implementation
Synopsis
- void :: Functor f => f a -> f ()
- throwIO :: Exception e => e -> IO a
- data ByteString
- data NonEmpty a = a :| [a]
- data Natural
- mkGlob :: ByteString -> Maybe Glob
- data Handle (m :: Type -> Type)
- data HandleErr
- data Glob
- type Key = ByteString
- module Test.Hspec
- module Test.Hspec.Benri
- module Test.KeyedVals.Types
a test fixture
setup/teardown hspec tests
module re-export
functions
module re-eports
void :: Functor f => f a -> f () #
discards or ignores the result of evaluation, such
as the return value of an void valueIO action.
Examples
Replace the contents of a with unit:Maybe Int
>>>void NothingNothing>>>void (Just 3)Just ()
Replace the contents of an
with unit, resulting in an Either Int Int:Either Int ()
>>>void (Left 8675309)Left 8675309>>>void (Right 8675309)Right ()
Replace every element of a list with unit:
>>>void [1,2,3][(),(),()]
Replace the second element of a pair with unit:
>>>void (1,2)(1,())
Discard the result of an IO action:
>>>mapM print [1,2]1 2 [(),()]>>>void $ mapM print [1,2]1 2
throwIO :: Exception e => e -> IO a #
A variant of throw that can only be used within the IO monad.
Although throwIO has a type that is an instance of the type of throw, the
two functions are subtly different:
throw e `seq` x ===> throw e throwIO e `seq` x ===> x
The first example will cause the exception e to be raised,
whereas the second one won't. In fact, throwIO will only cause
an exception to be raised when it is used within the IO monad.
The throwIO variant should be used in preference to throw to
raise an exception within the IO monad because it guarantees
ordering with respect to other IO operations, whereas throw
does not.
data ByteString #
A space-efficient representation of a Word8 vector, supporting many
efficient operations.
A ByteString contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.
Instances
Non-empty (and non-strict) list type.
Since: base-4.9.0.0
Constructors
| a :| [a] infixr 5 |
Instances
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS constructor
Instances
Represents the errors that might arise in Handle functions
Instances
| Exception HandleErr | |
Defined in KeyedVals.Handle.Internal Methods toException :: HandleErr -> SomeException # fromException :: SomeException -> Maybe HandleErr # displayException :: HandleErr -> String # | |
| Show HandleErr | |
| Eq HandleErr | |
| FromHandleErr HandleErr | |
Defined in KeyedVals.Handle.Codec Methods fromHandleErr :: HandleErr -> HandleErr # | |
Represents a redis glob use to select keys
type Key = ByteString #
Represents a key used to store a Val.
module Test.Hspec
module Test.Hspec.Benri
module Test.KeyedVals.Types