lens-4.2: Lenses, Folds and Traversals

Copyright(C) 2012-2014 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Lens.Internal.Getter

Contents

Description

 

Synopsis

Internal Classes

class (Contravariant f, Functor f) => Gettable f Source

This class is provided mostly for backwards compatibility with lens 3.8, but it can also shorten type signatures.

Instances

Getters

coerce :: (Contravariant f, Functor f) => f a -> f b Source

This Generalizes Const so we can apply simple Applicative transformations to it and so we can get nicer error messages.

A Functor you can coerce ignores its argument, which it carries solely as a phantom type parameter.

By the Functor and Contravariant laws, an instance of Gettable will necessarily satisfy:

id = fmap f = coerce = contramap g

noEffect :: (Contravariant f, Applicative f) => f a Source

The mempty equivalent for a Gettable Applicative Functor.