vgrep-0.2.2.0: A pager for grep

Control.Lens.Compat

Synopsis

Documentation

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 Control.Lens.to 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 Control.Lens.to except for the additional constraint Functor f.