smallcheck-lens-0.1: SmallCheck lens laws

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.SmallCheck.Lens.Prism

Synopsis

Documentation

testPrism :: (Eq s, Eq a, Show s, Show a, Serial IO a, Serial Identity a, CoSerial IO a, Serial IO s) => Prism' s a -> TestTree Source

A Prism' is only legal if it is a valid Traversal' (see testTraversal), and if the following laws hold:

  1. preview l (review l b) ≡ Just b"
  2. maybe s (review l) (preview l s) ≡ s