-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | True folds and getters for microlens
--   
--   This package provides <tt>Fold</tt> and <tt>Getter</tt> that are fully
--   compatible with lens; the downside is that this package depends on
--   contravariant, which in its turn depends on a lot of other packages
--   (but still less than lens).
--   
--   The difference between <tt>Fold</tt> and <tt>SimpleFold</tt> is that
--   you can use e.g. <tt>takingWhile</tt>/<tt>droppingWhile</tt> and
--   <tt>backwards</tt> on the former but not on the latter. Most functions
--   from lens that work with <tt>Fold</tt> would work with
--   <tt>SimpleFold</tt> as well, tho.
--   
--   Starting from GHC 8.6, this package doesn't depend on contravariant
--   anymore.
--   
--   This package is a part of the <a>microlens</a> family; see the readme
--   <a>on Github</a>.
@package microlens-contra
@version 0.1.0.2


-- | This module provides types and functions that require
--   <a>Contravariant</a>; they aren't included in the main microlens
--   package because <a>contravariant</a> has a lot of dependencies.
module Lens.Micro.Contra

-- | This is the same thing as <a>SimpleGetter</a> but more generalised (so
--   that it would fully match the type used in lens).
type Getter s a = forall f. (Contravariant f, Functor f) => (a -> f a) -> s -> f s

-- | Turn a <a>SimpleGetter</a> into a true <a>Getter</a>.
fromSimpleGetter :: SimpleGetter s a -> Getter s a

-- | This is the same thing as <a>SimpleFold</a> but more generalised (so
--   that it would fully match the type used in lens). See documentation of
--   <a>SimpleFold</a> for the list of functions that work on <a>Fold</a>
--   but don't work on <a>SimpleFold</a>.
type Fold s a = forall f. (Contravariant f, Applicative f) => (a -> f a) -> s -> f s

-- | Turn a <a>SimpleFold</a> into a true <a>Fold</a>.
fromSimpleFold :: SimpleFold s a -> Fold s a
