hedgehog-checkers-lens-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Hedgehog.Checkers.Lens.Properties

Synopsis

Documentation

isSetter :: (Show s, Show a, Eq s) => Setter' s a -> Gen a -> Gen s -> Gen (a -> a) -> PropertyT IO () Source #

A Setter is only legal if the following 3 laws hold:

  1. set l y (set l x a) ≡ set l y a
  2. over l id ≡ id
  3. over l f . over l g ≡ over l (f . g)

isLens :: (Eq a, Eq s, Show a, Show s) => Lens' s a -> Gen a -> Gen s -> Gen (a -> a) -> PropertyT IO () Source #

isIso :: (Eq a, Eq s, Show a, Show s) => Iso' s a -> Gen a -> Gen s -> Gen (a -> a) -> Gen (s -> s) -> PropertyT IO () Source #

isPrism :: (Show s, Show a, Eq s, Eq a) => Prism' s a -> Gen a -> Gen s -> Gen (a -> a) -> PropertyT IO () Source #

isTraversal :: (Eq s, Show a, Show s) => Traversal' s a -> Gen a -> Gen s -> Gen (a -> a) -> PropertyT IO () Source #

A Traversal is only legal if it is a valid Setter (see isSetter for what makes a Setter valid), and the following laws hold:

  1. t pure ≡ pure
  2. fmap (t f) . t g ≡ getCompose . t (Compose . fmap f . g)