pointless-lenses-0.0.7: Pointless Lenses library

Portabilitynon-portable
Stabilityexperimental
Maintainerhpacheco@di.uminho.pt

Generics.Pointless.Lenses

Description

Pointless Lenses: bidirectional lenses with point-free programming

This module defines the structure of lenses and provides Quickcheck procedures to test lens well-behavedness.

Synopsis

Documentation

data Lens c a Source

The data type of lenses

Constructors

Lens 

Fields

get :: c -> a
 
put :: (a, c) -> c
 
create :: a -> c
 

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.

inc_lns :: Enum a => Lens a aSource

Increment a number.

dec_lns :: Enum a => Lens a aSource

Decrement a number.

lnsEq :: (Eq a, Eq c) => Lens c a -> Lens c a -> a -> c -> BoolSource

QuickCheck procedure to test if two lenses are equivalent.

getEq :: Eq a => Lens c a -> Lens c a -> c -> BoolSource

putEq :: (Eq a, Eq c) => Lens c a -> Lens c a -> a -> c -> BoolSource

createEq :: Eq c => Lens c a -> Lens c a -> a -> BoolSource

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.

getput :: Eq c => Lens c a -> c -> BoolSource

QuickCheck procedure to test if a lens satisfies the GetPut law.

createget :: Eq a => Lens c a -> a -> BoolSource

QuickCheck procedure to test if a lens satisfies the CreateGet law.