Module

Optic.Laws.Lens

Package
purescript-lensDEPRECATED
Repository
joneshf/purescript-lens

Valid Lenses should satisfy three laws.

#validLens Source

validLens :: forall a s. Eq a => Eq s => Lens' s a -> s -> a -> a -> a -> Boolean

A valid Lens satisfies all three of the following laws.

#getSet Source

getSet :: forall a s. Eq s => Lens' s a -> s -> Boolean

If you get a value out, and then set it immediately back, nothing should change.

#setGet Source

setGet :: forall a s. Eq a => Lens' s a -> s -> a -> Boolean

If you set a value, and them get it immediately out, you should get the value you set.

#setSet Source

setSet :: forall b a s. Eq s => Lens s s a b -> s -> b -> b -> Boolean

If you set two values, the last set is the one that matters.