Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Layer a r = Layer {}
- embed ∷ MonadFree ((,) a) m ⇒ a → m ()
- nestWith ∷ ([a] → a) → Layer a () → Layer a ()
- newtype TestNestedM r = TestNestedM {
- unTestNestedM ∷ ReaderT [FilePath] (Layer TestTree) r
- type TestNested = TestNestedM ()
- runTestNestedM ∷ [String] → TestNested → TestTree
- testNestedNamedM ∷ FilePath → String → TestNested → TestNested
- testNestedM ∷ FilePath → TestNested → TestNested
- testNestedGhcM ∷ TestNested → TestNested
- runTestNested ∷ [String] → [TestNested] → TestTree
- testNestedNamed ∷ FilePath → String → [TestNested] → TestNested
- testNested ∷ FilePath → [TestNested] → TestNested
- testNestedGhc ∷ [TestNested] → TestNested
- goldenVsText ∷ TestName → FilePath → Text → TestTree
- goldenVsTextM ∷ TestName → FilePath → IO Text → TestTree
- goldenVsDoc ∷ TestName → FilePath → Doc ann → TestTree
- goldenVsDocM ∷ TestName → FilePath → IO (Doc ann) → TestTree
- nestedGoldenVsText ∷ TestName → FilePath → Text → TestNested
- nestedGoldenVsTextM ∷ TestName → FilePath → IO Text → TestNested
- nestedGoldenVsDoc ∷ TestName → FilePath → Doc ann → TestNested
- nestedGoldenVsDocM ∷ TestName → FilePath → IO (Doc ann) → TestNested
- makeVersionedFilePath ∷ [FilePath] → FilePath → FilePath
Documentation
A monad allowing one to emit elements of type a
. Semantically equivalent to
Writer (DList a) r
, but:
- is faster, being based on the Church-encoded free monad
- implements
Monoid
, so that all the Data.Foldable convenience is supported - has better ergonomics as it doesn't require the user to wrap
a
values intoDList
s
This type is also semantically equivalent to Stream (Of a) Identity r
.
Useful for monadically creating tree-like structures, for example the following
import Data.Tree yield = embed . pure main = putStrLn . drawTree . Node "a" . toList $ do yield "b" nestWith (Node "c") $ do yield "d" yield "e" yield "f"
will produce
-a | +- b | +- c | | | +- d | | | `- e | `- f
Instances
Applicative (Layer a) Source # | |
Functor (Layer a) Source # | |
Monad (Layer a) Source # | |
MonadFree ((,) a) (Layer a) Source # | |
unit ~ () ⇒ Monoid (Layer a unit) Source # | |
unit ~ () ⇒ Semigroup (Layer a unit) Source # | |
unit ~ () ⇒ IsList (Layer a unit) Source # | |
type Item (Layer a unit) Source # | |
Defined in Test.Tasty.Extras |
newtype TestNestedM r Source #
TestNestedM | |
|
Instances
type TestNested = TestNestedM () Source #
A TestTree
of tests under some name prefix.
runTestNestedM ∷ [String] → TestNested → TestTree Source #
Run a TestNested
computation to produce a TestTree
(without actually executing the tests).
∷ FilePath | The name of the folder. |
→ String | The name of the test group to render in CLI. |
→ TestNested | |
→ TestNested |
Descend into a folder.
testNestedM ∷ FilePath → TestNested → TestNested Source #
Descend into a folder for a TestNested
computation.
testNestedGhcM ∷ TestNested → TestNested Source #
Like testNestedM
but adds a subdirectory corresponding to the GHC version being used.
runTestNested ∷ [String] → [TestNested] → TestTree Source #
Run a list of TestNested
computation to produce a TestTree
(without actually executing the
tests).
∷ FilePath | The name of the folder. |
→ String | The name of the test group to render in CLI. |
→ [TestNested] | |
→ TestNested |
Descend into a folder for a list of tests.
testNested ∷ FilePath → [TestNested] → TestNested Source #
Descend into a folder for a list of TestNested
computations.
testNestedGhc ∷ [TestNested] → TestNested Source #
Like testNested
but adds a subdirectory corresponding to the GHC version being used.
goldenVsText ∷ TestName → FilePath → Text → TestTree Source #
Check the contents of a file against a Text
.
goldenVsTextM ∷ TestName → FilePath → IO Text → TestTree Source #
Check the contents of a file against a Text
.
goldenVsDoc ∷ TestName → FilePath → Doc ann → TestTree Source #
Check the contents of a file against a Doc
.
goldenVsDocM ∷ TestName → FilePath → IO (Doc ann) → TestTree Source #
Check the contents of a file against a Doc
.
nestedGoldenVsText ∷ TestName → FilePath → Text → TestNested Source #
Check the contents of a file under a name prefix against a Text
.
nestedGoldenVsTextM ∷ TestName → FilePath → IO Text → TestNested Source #
Check the contents of a file under a name prefix against a Text
.
nestedGoldenVsDoc ∷ TestName → FilePath → Doc ann → TestNested Source #
Check the contents of a file under a name prefix against a Text
.
nestedGoldenVsDocM ∷ TestName → FilePath → IO (Doc ann) → TestNested Source #
Check the contents of a file under a name prefix against a Text
.