microlens- A tiny part of the lens library which you can depend upon

Safe HaskellNone



This module is needed to give other packages from the microlens family (like microlens-ghc) access to functions that don't need to be exported from Lens.Micro (because they just clutter the namespace). Also, okay, uh, e.g. traversed is here because otherwise there'd be a dependency cycle.



traversed :: Traversable f => Traversal (f a) (f b) a b Source

traversed traverses any Traversable container (list, vector, Map, Maybe, you name it):

>>> Just 1 ^.. traversed

traversed is the same as traverse, but can be faster thanks to magic rewrite rules.

folded :: (Foldable f, Applicative (Const r)) => Getting r (f a) a Source

folded is a fold for anything Foldable. In a way, it's an opposite of mapped – the most powerful getter, but can't be used as a setter.

foldring :: Applicative (Const r) => ((a -> Const r a -> Const r a) -> Const r a -> s -> Const r a) -> (a -> Const r b) -> s -> Const r t Source

foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r Source

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

sets :: ((a -> b) -> s -> t) -> ASetter s t a b Source

sets creates an ASetter from an ordinary function. (The only thing it does is wrapping and unwrapping Identity.)

(#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c Source

(.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c Source