Safe Haskell | None |
---|---|

Language | Haskell2010 |

This module is intended for internal use only, and may change without warning in subsequent releases.

## Synopsis

- data Identity' a = Identity' !() a
- wrapIdentity' :: a -> Identity' a
- unwrapIdentity' :: Identity' a -> a
- newtype Traversed f a = Traversed (f a)
- runTraversed :: Functor f => Traversed f a -> f ()
- data OrT f a = OrT !Bool (f a)
- wrapOrT :: f a -> OrT f a
- (#.) :: Coercible b c => (b -> c) -> (a -> b) -> a -> c
- (.#) :: Coercible a b => (b -> c) -> (a -> b) -> a -> c

# Documentation

Identity' !() a |

wrapIdentity' :: a -> Identity' a Source #

Mark a value for evaluation to whnf.

This allows us to, when applying a setter to a structure, evaluate only the parts that we modify. If an optic focuses on multiple targets, Applicative instance of Identity' makes sure that we force evaluation of all of them, but we leave anything else alone.

unwrapIdentity' :: Identity' a -> a Source #

newtype Traversed f a Source #

Helper for `traverseOf_`

and the like for better
efficiency than the foldr-based version.

Note that the argument `a`

of the result should not be used.

Traversed (f a) |

## Instances

Applicative f => Semigroup (Traversed f a) Source # | |

Applicative f => Monoid (Traversed f a) Source # | |

runTraversed :: Functor f => Traversed f a -> f () Source #

Helper for `failing`

family to visit the first fold only once.

## Instances

Functor f => Functor (OrT f) Source # | |

Applicative f => Applicative (OrT f) Source # | |

wrapOrT :: f a -> OrT f a Source #

Wrap the applicative action in `OrT`

so that we know later that it was
executed.