unbound-generics-0.4.0: Support for programming with names and binders using GHC Generics

Copyright(c) 2014 Aleksey Kliger
LicenseBSD3 (See LICENSE)
MaintainerAleksey Kliger
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Unbound.Generics.LocallyNameless.Internal.Fold

Description

Some utilities for working with Folds.

If you are using lens, you don't need this module.

Documentation

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

type Traversal' s a = forall f. Applicative f => (a -> f a) -> s -> f s Source #

toListOf :: Fold s a -> s -> [a] Source #

filtered :: (a -> Bool) -> Traversal' a a Source #

justFiltered :: (a -> Maybe b) -> Fold a b Source #

foldMapOf :: Getting r s a -> (a -> r) -> s -> r Source #