Module
Mote.Monad
- Package
- purescript-mote
- Repository
- garyb/purescript-mote
#MoteT Source
newtype MoteT bracket test m a
The main MoteT
/ Mote
monadic DSL used to describe tests and groups of
tests.
After description via this DSL a Plan
can be generated, that can then
finally be interpreted into some target monad.
- The
bracket
type represents a type of kindType -> Type
kind in which bracketing can be dealt with. This type is higher kinded as the "before" part of a bracket is expressed by a type likebracket r
, so that the "after" part can consume it asr -> bracket Unit
later. If bracketing is not required, setting this toConst Void
is a good way to communicate that it is unused/unusable. - The
test
type represents the type of tests. The kind here is only required to beType
but will usually be something likem Unit
(wherem
here is some monad to run the tests in, not them
ofMoteT
). - The
m
is an underlying monad that can be used to perform effects while constructing the test suite. This allows for tests to be generated from the filesystem, reading from aReader
-based environment, etc.
The bracket
and test
types are separated to allow for tests and
bracketing to have different constraints and capabilities. In some cases
it might be desirable to run tests with an alternative Reader
, or
restrict the kind of effects tests are allowed to perform compared with
the bracketing code.
Constructors
MoteT (WriterT (Array (Description bracket test)) m a)
Instances
Newtype (MoteT bracket test m a) _
(Functor m) => Functor (MoteT bracket test m)
(Apply m) => Apply (MoteT bracket test m)
(Applicative m) => Applicative (MoteT bracket test m)
(Bind m) => Bind (MoteT bracket test m)
(Monad m) => Monad (MoteT bracket test m)
MonadTrans (MoteT bracket test)
(MonadAsk r m) => MonadAsk r (MoteT bracket test m)
(MonadReader r m) => MonadReader r (MoteT bracket test m)
(MonadEffect m) => MonadEffect (MoteT bracket test m)
#bracket Source
bracket :: forall resource a m test bracket. Monad m => { after :: resource -> bracket Unit, before :: bracket resource } -> MoteT bracket test m a -> MoteT bracket test m a
Specifies actions to run before and after the following group(s) and/or test(s).
The bracketing is applied to every following group or test individually; it will be repeated when each group or test is run.