vgrep- A pager for grep

Safe HaskellSafe




to :: (Profunctor p, Functor f, Contravariant f) => (s -> a) -> Optic' p f s a Source #

Build an (index-preserving) Getter from an arbitrary Haskell function. See for details.

In lens-4.14, the constraint Functor f is missing from the definition of to. When compiling with GHC 8.0, this leads to warnings for definitions like

foo :: Getter Bar Foo
foo = to fooFromBar

because of the redundant Functor f constraint. This definition is identical to except for the additional constraint Functor f.