microlens-contra-0.1.0.2: True folds and getters for microlens

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).

fromSimpleGetter :: SimpleGetter s a -> Getter s a Source #

Turn a SimpleGetter into a true Getter.

# 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.