HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

ModuleImpSpec-0.2.0.0Haskell2010

Test.ImpSpec.Expectations.Lifted

  • 1 type
  • 30 values
  • PackageImpSpec-0.2.0.0
  • Exports31
  • LanguageHaskell2010
  • LicenceApache-2.0
  • SourceLifted.hs

Lifted Expectations

1 declaration
valueio :: IO a -> IO a
#

Enforce the type of expectation

Useful with polymorphic expectations that are defined below.

Example

Because shouldBeExpr is polymorphic in m, compiler will choke with a unification error. This is due to the fact that hspec's it expects a polymorphic Example.

it "MyTest" $ do
  "foo" `shouldBeExpr` "bar"

However, this is easily solved by io:

it "MyTest" $ io $ do
  "foo" `shouldBeExpr` "bar"

Common

valueshouldContain
  1. :: (HasCallStack, MonadIO m, Show a, Eq a)
  2. => [a]
  3. -> [a]
  4. -> m ()
#

list `shouldContain` sublist sets the expectation that sublist is contained, wholly and intact, anywhere in list.

typetype Selector a = a -> Bool
#

A Selector is a predicate; it can simultaneously constrain the type and value of an exception.

Custom

Either

Maybe