HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehedgehog-1.7Haskell2010

Hedgehog.Internal.Tripping

  • 1 value
  • Packagehedgehog-1.7
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTripping.hs
valuetripping
  1. :: (MonadTest m, Applicative f, Show b, Show (f a), Eq (f a), HasCallStack)
  2. => a
  3. -> a -> b
  4. -> b -> f a
  5. -> m ()
#

Test that a pair of encode / decode functions are compatible.

Given a printer from some type a -> b, and a parser with a potential failure case b -> f a. Ensure that a valid a round trips through the "print" and "parse" to yield the same a.

For example, types should have tripping Read and Show instances:

trippingShowRead :: (Show a, Read a, Eq a, MonadTest m) => a -> m ()
trippingShowRead a = tripping a show readEither