microlens-contra-0.1.0.3: True folds and getters for microlens
Copyright(C) 2013-2016 Edward Kmett 2015-2016 Artyom Kazak 2018 Monadfix
LicenseBSD-style (see the file LICENSE)
Safe HaskellSafe
LanguageHaskell2010

Lens.Micro.Contra

Contents

Description

This module provides types and functions that require Contravariant; they aren't included in the main microlens package because contravariant has a lot of dependencies.

Synopsis

Getter

type Getter s a = forall f. (Contravariant f, Functor f) => (a -> f a) -> s -> f s Source #

This is the same thing as SimpleGetter but more generalised (so that it would fully match the type used in lens).

Fold

type Fold s a = forall f. (Contravariant f, Applicative f) => (a -> f a) -> s -> f s Source #

This is the same thing as SimpleFold but more generalised (so that it would fully match the type used in lens). See documentation of SimpleFold for the list of functions that work on Fold but don't work on SimpleFold.

fromSimpleFold :: SimpleFold s a -> Fold s a Source #

Turn a SimpleFold into a true Fold.