Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | hpacheco@di.uminho.pt |
Pointless Lenses: bidirectional lenses with point-free programming
This module defines the structure of lenses and provides Quickcheck procedures to test lens well-behavedness.
- data Lens c a = Lens {}
- type NatLens f g = forall x. x -> Lens (Rep f x) (Rep g x)
- inc_lns :: Enum a => Lens a a
- dec_lns :: Enum a => Lens a a
- lnsEq :: (Eq a, Eq c) => Lens c a -> Lens c a -> a -> c -> Bool
- getEq :: Eq a => Lens c a -> Lens c a -> c -> Bool
- putEq :: (Eq a, Eq c) => Lens c a -> Lens c a -> a -> c -> Bool
- createEq :: Eq c => Lens c a -> Lens c a -> a -> Bool
- wb :: (Eq a, Eq c) => Lens c a -> a -> c -> Bool
- putget :: (Eq a, Eq c) => Lens c a -> a -> c -> Bool
- getput :: Eq c => Lens c a -> c -> Bool
- createget :: Eq a => Lens c a -> a -> Bool
Documentation
type NatLens f g = forall x. x -> Lens (Rep f x) (Rep g x)Source
The type of natural lenses. Lenses that encode bidirectional natural transformations.
lnsEq :: (Eq a, Eq c) => Lens c a -> Lens c a -> a -> c -> BoolSource
QuickCheck procedure to test if two lenses are equivalent.
wb :: (Eq a, Eq c) => Lens c a -> a -> c -> BoolSource
QuickCheck procedure to test if a lens is well-behaved.
putget :: (Eq a, Eq c) => Lens c a -> a -> c -> BoolSource
QuickCheck procedure to test if a lens satisfies the PutGet law.