profunctor-optics-0.0.0.5: An optics library compatible with the typeclasses in 'profunctors'.

Safe HaskellNone
LanguageHaskell2010

Data.Connection.Optic

Synopsis

Documentation

dual :: Prd a => Prd b => Conn a b -> Grate' (Down b) (Down a) Source #

just :: Prd a => Prd b => Conn a b -> Grate' (Maybe a) (Maybe b) Source #

connected :: Conn s a -> Grate' s a Source #

Obtain a Grate from a Galois connection.

Useful for giving precise semantics to numerical computations.

This is an example of a Grate that would not be a legal Iso, as Galois connections are not in general inverses.

>>> zipsWith (connected i08i16) (+) 126 1
127
>>> zipsWith (connected i08i16) (+) 126 2
127