hedgehog-optics-1.0.0.3: Hedgehog properties for optics laws
Safe HaskellSafe-Inferred
LanguageGHC2021

Hedgehog.Optics

Synopsis

Documentation

wellFormedPrism Source #

Arguments

:: Monad m 
=> (Show large, Eq large) 
=> (Show small, Eq small) 
=> Gen large 
-> Gen small 
-> Prism' large small

Prism signifying that the small type is a subset of the large type -}

-> PropertyT m () 

Checks whether a prism respects the well-formedness laws given in Optics.Prism

wellFormedLens Source #

Arguments

:: Monad m 
=> (Show large, Eq large) 
=> (Show small, Eq small) 
=> Gen large 
-> Gen small 
-> Lens' large small

Lens signifying that the small type is a constituent part of the large type

-> PropertyT m () 

Checks whether a lens respects the well-formedness laws given in Optics.Lens

wellFormedIso Source #

Arguments

:: Monad m 
=> (Show a, Eq a) 
=> (Show b, Eq b) 
=> Gen a 
-> Gen b 
-> Iso' a b

Isomorphism signifying that types a and b are basically the same thing

-> PropertyT m () 

Checks whether an isomorphism respects the well-formedness laws given in Optics.Iso

prismExample Source #

Arguments

:: Monad m 
=> (Show large, Eq large) 
=> (Show small, Eq small) 
=> Prism' large small

Prism signifying that the small type is a subset of the large type

-> large 
-> small 
-> PropertyT m () 

Assert that a prism matches for a particular set of values

A review of the small value should produce the large value, and a preview of the large value should produce the small value.