/usr/share/doc/libghc-lens-doc/html/Control-Lens-Plated.html is in libghc-lens-doc 4.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Control.Lens.Plated</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Lens-Plated.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Lens-Plated.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">lens-4.13: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>(C) 2012-15 Edward Kmett</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE)</td></tr><tr><th>Maintainer</th><td>Edward Kmett <ekmett@gmail.com></td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>Rank2Types</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Control.Lens.Plated</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Uniplate</a></li><li><a href="#g:2">Uniplate Combinators</a></li><li><a href="#g:3">Compos</a></li><li><a href="#g:4">Parts</a></li><li><a href="#g:5">Generics</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The name "plate" stems originally from "boilerplate", which was the term
used by the "Scrap Your Boilerplate" papers, and later inherited by Neil
Mitchell's "Uniplate".</p><p><a href="http://community.haskell.org/~ndm/uniplate/">http://community.haskell.org/~ndm/uniplate/</a></p><p>The combinators in here are designed to be compatible with and subsume the
<code>uniplate</code> API with the notion of a <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> replacing
a <code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code> or <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code>.</p><p>By implementing these combinators in terms of <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> instead of
<code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code> additional type safety is gained, as the user is
no longer responsible for maintaining invariants such as the number of
children they received.</p><p>Note: The <code>Biplate</code> is <em>deliberately</em> excluded from the API here, with the
intention that you replace them with either explicit traversals, or by using the
<code>On</code> variants of the combinators below with <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code> from
<code>Data.Data.Lens</code>. As a design, it forced the user into too many situations where
they had to choose between correctness and ease of use, and it was brittle in the
face of competing imports.</p><p>The sensible use of these combinators makes some simple assumptions. Notably, any
of the <code>On</code> combinators are expecting a <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> or <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code>
to play the role of the <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code> combinator, and so when the
types of the contents and the container match, they should be the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:id">id</a></code> <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>,
<code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> or <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code>.</p><p>It is often beneficial to use the combinators in this module with the combinators
from <code>Data.Data.Lens</code> or <code>GHC.Generics.Lens</code> to make it easier to automatically
derive definitions for <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>, or to derive custom traversals.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span> <a href="#t:Plated">Plated</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:plate">plate</a> :: <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> a a</li></ul></li><li class="src short"><a href="#v:children">children</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [a]</li><li class="src short"><a href="#v:rewrite">rewrite</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> a -> a</li><li class="src short"><a href="#v:rewriteOf">rewriteOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> a -> a</li><li class="src short"><a href="#v:rewriteOn">rewriteOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> s -> t</li><li class="src short"><a href="#v:rewriteOnOf">rewriteOnOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> s -> t</li><li class="src short"><a href="#v:rewriteM">rewriteM</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> a -> m a</li><li class="src short"><a href="#v:rewriteMOf">rewriteMOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> a -> m a</li><li class="src short"><a href="#v:rewriteMOn">rewriteMOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> s -> m t</li><li class="src short"><a href="#v:rewriteMOnOf">rewriteMOnOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> s -> m t</li><li class="src short"><a href="#v:universe">universe</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [a]</li><li class="src short"><a href="#v:universeOf">universeOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] a a -> a -> [a]</li><li class="src short"><a href="#v:universeOn">universeOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] s a -> s -> [a]</li><li class="src short"><a href="#v:universeOnOf">universeOnOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] s a -> <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] a a -> s -> [a]</li><li class="src short"><a href="#v:cosmos">cosmos</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Type.html#t:Fold">Fold</a> a a</li><li class="src short"><a href="#v:cosmosOf">cosmosOf</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a</li><li class="src short"><a href="#v:cosmosOn">cosmosOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a</li><li class="src short"><a href="#v:cosmosOnOf">cosmosOnOf</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a</li><li class="src short"><a href="#v:transform">transform</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> a) -> a -> a</li><li class="src short"><a href="#v:transformOf">transformOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> a) -> a -> a</li><li class="src short"><a href="#v:transformOn">transformOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> (a -> a) -> s -> t</li><li class="src short"><a href="#v:transformOnOf">transformOnOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> a) -> s -> t</li><li class="src short"><a href="#v:transformM">transformM</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => (a -> m a) -> a -> m a</li><li class="src short"><a href="#v:transformMOf">transformMOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m a) -> a -> m a</li><li class="src short"><a href="#v:transformMOn">transformMOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> (a -> m a) -> s -> m t</li><li class="src short"><a href="#v:transformMOnOf">transformMOnOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m a) -> s -> m t</li><li class="src short"><a href="#v:contexts">contexts</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a a]</li><li class="src short"><a href="#v:contextsOf">contextsOf</a> :: <a href="Control-Lens-Traversal.html#t:ATraversal-39-">ATraversal'</a> a a -> a -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a a]</li><li class="src short"><a href="#v:contextsOn">contextsOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Traversal.html#t:ATraversal">ATraversal</a> s t a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a t]</li><li class="src short"><a href="#v:contextsOnOf">contextsOnOf</a> :: <a href="Control-Lens-Traversal.html#t:ATraversal">ATraversal</a> s t a a -> <a href="Control-Lens-Traversal.html#t:ATraversal-39-">ATraversal'</a> a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a t]</li><li class="src short"><a href="#v:holes">holes</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> (->) a a a]</li><li class="src short"><a href="#v:holesOn">holesOn</a> :: <a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p => <a href="Control-Lens-Type.html#t:Over">Over</a> p (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p a a) s t a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> p a a t]</li><li class="src short"><a href="#v:holesOnOf">holesOnOf</a> :: <a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p r r) s t a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p r r) a b r r -> s -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> p r r t]</li><li class="src short"><a href="#v:para">para</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> [r] -> r) -> a -> r</li><li class="src short"><a href="#v:paraOf">paraOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Endo">Endo</a> [a]) a a -> (a -> [r] -> r) -> a -> r</li><li class="src short"><a href="#v:...">(...)</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> c) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> f s t c c -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f c c a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f s t a b</li><li class="src short"><a href="#v:deep">deep</a> :: (<a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> s) => <a href="Control-Lens-Traversal.html#t:Traversing">Traversing</a> p f s s a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f s s a b</li><li class="src short"><a href="#v:composOpFold">composOpFold</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => b -> (b -> b -> b) -> (a -> b) -> a -> b</li><li class="src short"><a href="#v:parts">parts</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> a [a]</li><li class="src short"><a href="#v:gplate">gplate</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Generic">Generic</a> a, <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Rep">Rep</a> a)) => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> a a</li><li class="src short"><span class="keyword">class</span> <a href="#t:GPlated">GPlated</a> a g</li></ul></div><div id="interface"><h1 id="g:1">Uniplate</h1><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Plated" class="def">Plated</a> a <span class="keyword">where</span> <a href="src/Control-Lens-Plated.html#Plated" class="link">Source</a></p><div class="doc"><p>A <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> type is one where we know how to extract its immediate self-similar children.</p><p><em>Example 1</em>:</p><pre>import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (<code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code>)
</pre><pre>data Expr
= Val <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></code>
| Neg Expr
| Add Expr Expr
deriving (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Read.html#t:Read">Read</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a></code>)
</pre><pre>instance <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> Expr where
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> f (Neg e) = Neg <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#v:-60--36--62-"><$></a></code> f e
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> f (Add a b) = Add <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#v:-60--36--62-"><$></a></code> f a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-60--42--62-"><*></a></code> f b
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> _ a = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:pure">pure</a></code> a
</pre><p><em>or</em></p><pre>instance <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> Expr where
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> = <code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code>
</pre><p><em>Example 2</em>:</p><pre>import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (<code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code>)
</pre><pre>data Tree a
= Bin (Tree a) (Tree a)
| Tip a
deriving (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Read.html#t:Read">Read</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a></code>,<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a></code>)
</pre><pre>instance <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> (Tree a) where
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> f (Bin l r) = Bin <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#v:-60--36--62-"><$></a></code> f l <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-60--42--62-"><*></a></code> f r
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> _ t = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:pure">pure</a></code> t
</pre><p><em>or</em></p><pre>instance <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a></code> a => <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> (Tree a) where
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> = <code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code>
</pre><p>Note the big distinction between these two implementations.</p><p>The former will only treat children directly in this tree as descendents,
the latter will treat trees contained in the values under the tips also
as descendants!</p><p>When in doubt, pick a <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> and just use the various <code>...Of</code> combinators
rather than pollute <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> with orphan instances!</p><p>If you want to find something unplated and non-recursive with <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code>
use the <code>...OnOf</code> variant with <code><a href="Control-Lens-Traversal.html#v:ignored">ignored</a></code>, though those usecases are much better served
in most cases by using the existing <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> combinators! e.g.</p><pre><code><a href="Control-Lens-Fold.html#v:toListOf">toListOf</a></code> <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code> ≡ <code><a href="Control-Lens-Plated.html#v:universeOnOf">universeOnOf</a></code> <code><a href="Data-Data-Lens.html#v:biplate">biplate</a></code> <code><a href="Control-Lens-Traversal.html#v:ignored">ignored</a></code>
</pre><p>This same ability to explicitly pass the <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> in question is why there is no
analogue to uniplate's <code>Biplate</code>.</p><p>Moreover, since we can allow custom traversals, we implement reasonable defaults for
polymorphic data types, that only <code><a href="Control-Traversable.html#v:traverse">traverse</a></code> into themselves, and <em>not</em> their
polymorphic arguments.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">Nothing</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:plate" class="def">plate</a> :: <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> a a <a href="src/Control-Lens-Plated.html#plate" class="link">Source</a></p><div class="doc"><p><code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> of the immediate children of this structure.</p><p>If you're using GHC 7.2 or newer and your type has a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a></code> instance,
<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> will default to <code><a href="Data-Data-Lens.html#v:uniplate">uniplate</a></code> and you can choose to not override
it with your own definition.</p></div></div><div class="subs instances"><p id="control.i:Plated" class="caption collapser" onclick="toggleSection('i:Plated')">Instances</p><div id="section.i:Plated" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></span> <a href="src/Control-Lens-Plated.html#line-262" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Pat">Pat</a></span> <a href="src/Control-Lens-Plated.html#line-270" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Type">Type</a></span> <a href="src/Control-Lens-Plated.html#line-265" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Dec">Dec</a></span> <a href="src/Control-Lens-Plated.html#line-263" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Stmt">Stmt</a></span> <a href="src/Control-Lens-Plated.html#line-269" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Con">Con</a></span> <a href="src/Control-Lens-Plated.html#line-264" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> [a]</span> <a href="src/Control-Lens-Plated.html#line-226" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Tree.html#t:Tree">Tree</a> a)</span> <a href="src/Control-Lens-Plated.html#line-258" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f => <a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/libghc-free-doc/html/Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</span> <a href="src/Control-Lens-Plated.html#line-255" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f => <a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/libghc-free-doc/html/Control-Monad-Free-Church.html#t:F">F</a> f a)</span> <a href="src/Control-Lens-Plated.html#line-244" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f => <a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/libghc-free-doc/html/Control-Monad-Free.html#t:Free">Free</a> f a)</span> <a href="src/Control-Lens-Plated.html#line-230" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> w) => <a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/libghc-free-doc/html/Control-Comonad-Trans-Cofree.html#t:CofreeT">CofreeT</a> f w a)</span> <a href="src/Control-Lens-Plated.html#line-252" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> m) => <a href="Control-Lens-Plated.html#t:Plated">Plated</a> (<a href="file:///usr/share/doc/libghc-free-doc/html/Control-Monad-Trans-Free.html#t:FreeT">FreeT</a> f m a)</span> <a href="src/Control-Lens-Plated.html#line-234" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:2">Uniplate Combinators</h1><div class="top"><p class="src"><a name="v:children" class="def">children</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [a] <a href="src/Control-Lens-Plated.html#children" class="link">Source</a></p><div class="doc"><p>Extract the immediate descendants of a <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> container.</p><pre><code><a href="Control-Lens-Plated.html#v:children">children</a></code> ≡ <code><a href="Control-Lens-Fold.html#v:toListOf">toListOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:rewrite" class="def">rewrite</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> a -> a <a href="src/Control-Lens-Plated.html#rewrite" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a rule everywhere you can. Ensures that the rule cannot
be applied anywhere in the result:</p><pre>propRewrite r x = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:all">all</a></code> (<code><a href="Data-Just.html#v:isNothing">isNothing</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:.">.</a></code> r) (<code><a href="Control-Lens-Plated.html#v:universe">universe</a></code> (<code><a href="Control-Lens-Plated.html#v:rewrite">rewrite</a></code> r x))
</pre><p>Usually <code><a href="Control-Lens-Plated.html#v:transform">transform</a></code> is more appropriate, but <code><a href="Control-Lens-Plated.html#v:rewrite">rewrite</a></code> can give better
compositionality. Given two single transformations <code>f</code> and <code>g</code>, you can
construct <code>a -> f a <code>mplus</code> g a</code> which performs both rewrites until a fixed point.</p></div></div><div class="top"><p class="src"><a name="v:rewriteOf" class="def">rewriteOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> a -> a <a href="src/Control-Lens-Plated.html#rewriteOf" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a rule everywhere you can. Ensures that the rule cannot
be applied anywhere in the result:</p><pre>propRewriteOf l r x = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:all">all</a></code> (<code><a href="Data-Just.html#v:isNothing">isNothing</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:.">.</a></code> r) (<code><a href="Control-Lens-Plated.html#v:universeOf">universeOf</a></code> l (<code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> l r x))
</pre><p>Usually <code><a href="Control-Lens-Plated.html#v:transformOf">transformOf</a></code> is more appropriate, but <code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> can give better
compositionality. Given two single transformations <code>f</code> and <code>g</code>, you can
construct <code>a -> f a <code>mplus</code> g a</code> which performs both rewrites until a fixed point.</p><pre><code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> :: <code><a href="Control-Lens-Iso.html#v:Iso-39-">Iso'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> a -> a
<code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> a -> a
<code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> a -> a
<code><a href="Control-Lens-Plated.html#v:rewriteOf">rewriteOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> a -> a
</pre></div></div><div class="top"><p class="src"><a name="v:rewriteOn" class="def">rewriteOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> s -> t <a href="src/Control-Lens-Plated.html#rewriteOn" class="link">Source</a></p><div class="doc"><p>Rewrite recursively over part of a larger structure.</p><pre><code><a href="Control-Lens-Plated.html#v:rewriteOn">rewriteOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Iso.html#v:Iso-39-">Iso'</a></code> s a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOn">rewriteOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOn">rewriteOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOn">rewriteOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a></code> s a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
</pre></div></div><div class="top"><p class="src"><a name="v:rewriteOnOf" class="def">rewriteOnOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> s -> t <a href="src/Control-Lens-Plated.html#rewriteOnOf" class="link">Source</a></p><div class="doc"><p>Rewrite recursively over part of a larger structure using a specified <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code>.</p><pre><code><a href="Control-Lens-Plated.html#v:rewriteOnOf">rewriteOnOf</a></code> :: <code><a href="Control-Lens-Iso.html#v:Iso-39-">Iso'</a></code> s a -> <code><a href="Control-Lens-Iso.html#v:Iso-39-">Iso'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOnOf">rewriteOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOnOf">rewriteOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:rewriteOnOf">rewriteOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> a a -> (a -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a></code> a) -> s -> s
</pre></div></div><div class="top"><p class="src"><a name="v:rewriteM" class="def">rewriteM</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> a -> m a <a href="src/Control-Lens-Plated.html#rewriteM" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a monadic rule everywhere you can. Ensures that the rule cannot
be applied anywhere in the result.</p></div></div><div class="top"><p class="src"><a name="v:rewriteMOf" class="def">rewriteMOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> a -> m a <a href="src/Control-Lens-Plated.html#rewriteMOf" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a monadic rule everywhere you recursing with a user-specified <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>.
Ensures that the rule cannot be applied anywhere in the result.</p></div></div><div class="top"><p class="src"><a name="v:rewriteMOn" class="def">rewriteMOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> s -> m t <a href="src/Control-Lens-Plated.html#rewriteMOn" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>.
Ensures that the rule cannot be applied anywhere in the result.</p></div></div><div class="top"><p class="src"><a name="v:rewriteMOnOf" class="def">rewriteMOnOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) -> s -> m t <a href="src/Control-Lens-Plated.html#rewriteMOnOf" class="link">Source</a></p><div class="doc"><p>Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>,
using a user-specified <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> for recursion. Ensures that the rule cannot be applied anywhere in the result.</p></div></div><div class="top"><p class="src"><a name="v:universe" class="def">universe</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [a] <a href="src/Control-Lens-Plated.html#universe" class="link">Source</a></p><div class="doc"><p>Retrieve all of the transitive descendants of a <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> container, including itself.</p></div></div><div class="top"><p class="src"><a name="v:universeOf" class="def">universeOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] a a -> a -> [a] <a href="src/Control-Lens-Plated.html#universeOf" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.</p><pre><code><a href="Control-Lens-Plated.html#v:universeOf">universeOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> a a -> a -> [a]
</pre></div></div><div class="top"><p class="src"><a name="v:universeOn" class="def">universeOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] s a -> s -> [a] <a href="src/Control-Lens-Plated.html#universeOn" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to find <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> parts of a container retrieve them and all of their descendants, recursively.</p></div></div><div class="top"><p class="src"><a name="v:universeOnOf" class="def">universeOnOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] s a -> <a href="Control-Lens-Getter.html#t:Getting">Getting</a> [a] a a -> s -> [a] <a href="src/Control-Lens-Plated.html#universeOnOf" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself that lie
in a region indicated by another <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code>.</p><pre><code><a href="Control-Lens-Fold.html#v:toListOf">toListOf</a></code> l ≡ <code><a href="Control-Lens-Plated.html#v:universeOnOf">universeOnOf</a></code> l <code><a href="Control-Lens-Traversal.html#v:ignored">ignored</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:cosmos" class="def">cosmos</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Type.html#t:Fold">Fold</a> a a <a href="src/Control-Lens-Plated.html#cosmos" class="link">Source</a></p><div class="doc"><p>Fold over all transitive descendants of a <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> container, including itself.</p></div></div><div class="top"><p class="src"><a name="v:cosmosOf" class="def">cosmosOf</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a <a href="src/Control-Lens-Plated.html#cosmosOf" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself.</p><pre><code><a href="Control-Lens-Plated.html#v:cosmosOf">cosmosOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> a a -> <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> a a
</pre></div></div><div class="top"><p class="src"><a name="v:cosmosOn" class="def">cosmosOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a <a href="src/Control-Lens-Plated.html#cosmosOn" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to find <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> parts of a container fold them and all of their descendants, recursively.</p><pre><code><a href="Control-Lens-Plated.html#v:cosmosOn">cosmosOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a
</pre></div></div><div class="top"><p class="src"><a name="v:cosmosOnOf" class="def">cosmosOnOf</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Getter.html#t:Contravariant">Contravariant</a> f) => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> f s a <a href="src/Control-Lens-Plated.html#cosmosOnOf" class="link">Source</a></p><div class="doc"><p>Given a <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself that lie
in a region indicated by another <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code>.</p><pre><code><a href="Control-Lens-Plated.html#v:cosmosOnOf">cosmosOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> a a -> <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a
</pre></div></div><div class="top"><p class="src"><a name="v:transform" class="def">transform</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> a) -> a -> a <a href="src/Control-Lens-Plated.html#transform" class="link">Source</a></p><div class="doc"><p>Transform every element in the tree, in a bottom-up manner.</p><p>For example, replacing negative literals with literals:</p><pre>negLits = <code><a href="Control-Lens-Plated.html#v:transform">transform</a></code> $ \x -> case x of
Neg (Lit i) -> Lit (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#v:negate">negate</a></code> i)
_ -> x
</pre></div></div><div class="top"><p class="src"><a name="v:transformOf" class="def">transformOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> a) -> a -> a <a href="src/Control-Lens-Plated.html#transformOf" class="link">Source</a></p><div class="doc"><p>Transform every element by recursively applying a given <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> in a bottom-up manner.</p><pre><code><a href="Control-Lens-Plated.html#v:transformOf">transformOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> a) -> a -> a
<code><a href="Control-Lens-Plated.html#v:transformOf">transformOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> a a -> (a -> a) -> a -> a
</pre></div></div><div class="top"><p class="src"><a name="v:transformOn" class="def">transformOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> (a -> a) -> s -> t <a href="src/Control-Lens-Plated.html#transformOn" class="link">Source</a></p><div class="doc"><p>Transform every element in the tree in a bottom-up manner over a region indicated by a <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code>.</p><pre><code><a href="Control-Lens-Plated.html#v:transformOn">transformOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> (a -> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:transformOn">transformOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s a -> (a -> a) -> s -> s
</pre></div></div><div class="top"><p class="src"><a name="v:transformOnOf" class="def">transformOnOf</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t a a -> <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> a a -> (a -> a) -> s -> t <a href="src/Control-Lens-Plated.html#transformOnOf" class="link">Source</a></p><div class="doc"><p>Transform every element in a region indicated by a <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> by recursively applying another <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code>
in a bottom-up manner.</p><pre><code><a href="Control-Lens-Plated.html#v:transformOnOf">transformOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> a) -> s -> s
<code><a href="Control-Lens-Plated.html#v:transformOnOf">transformOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> a a -> (a -> a) -> s -> s
</pre></div></div><div class="top"><p class="src"><a name="v:transformM" class="def">transformM</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => (a -> m a) -> a -> m a <a href="src/Control-Lens-Plated.html#transformM" class="link">Source</a></p><div class="doc"><p>Transform every element in the tree, in a bottom-up manner, monadically.</p></div></div><div class="top"><p class="src"><a name="v:transformMOf" class="def">transformMOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m a) -> a -> m a <a href="src/Control-Lens-Plated.html#transformMOf" class="link">Source</a></p><div class="doc"><p>Transform every element in a tree using a user supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> in a bottom-up manner with a monadic effect.</p><pre><code><a href="Control-Lens-Plated.html#v:transformMOf">transformMOf</a></code> :: <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a></code> m => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> m a) -> a -> m a
</pre></div></div><div class="top"><p class="src"><a name="v:transformMOn" class="def">transformMOn</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> (a -> m a) -> s -> m t <a href="src/Control-Lens-Plated.html#transformMOn" class="link">Source</a></p><div class="doc"><p>Transform every element in the tree in a region indicated by a supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, in a bottom-up manner, monadically.</p><pre><code><a href="Control-Lens-Plated.html#v:transformMOn">transformMOn</a></code> :: (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a></code> m, <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a) => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> (a -> m a) -> s -> m s
</pre></div></div><div class="top"><p class="src"><a name="v:transformMOnOf" class="def">transformMOnOf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) s t a a -> <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m) a a -> (a -> m a) -> s -> m t <a href="src/Control-Lens-Plated.html#transformMOnOf" class="link">Source</a></p><div class="doc"><p>Transform every element in a tree that lies in a region indicated by a supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, walking with a user supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> in
a bottom-up manner with a monadic effect.</p><pre><code><a href="Control-Lens-Plated.html#v:transformMOnOf">transformMOnOf</a></code> :: <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a></code> m => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> (a -> m a) -> s -> m s
</pre></div></div><div class="top"><p class="src"><a name="v:contexts" class="def">contexts</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a a] <a href="src/Control-Lens-Plated.html#contexts" class="link">Source</a></p><div class="doc"><p>Return a list of all of the editable contexts for every location in the structure, recursively.</p><pre>propUniverse x = <code><a href="Control-Lens-Plated.html#v:universe">universe</a></code> x <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:map">map</a></code> <code><a href="file:///usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#v:pos">pos</a></code> (<code><a href="Control-Lens-Plated.html#v:contexts">contexts</a></code> x)
propId x = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:all">all</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> x) [<code><a href="Control-Lens-Internal-Context.html#v:extract">extract</a></code> w | w <- <code><a href="Control-Lens-Plated.html#v:contexts">contexts</a></code> x]
</pre><pre><code><a href="Control-Lens-Plated.html#v:contexts">contexts</a></code> ≡ <code><a href="Control-Lens-Plated.html#v:contextsOf">contextsOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:contextsOf" class="def">contextsOf</a> :: <a href="Control-Lens-Traversal.html#t:ATraversal-39-">ATraversal'</a> a a -> a -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a a] <a href="src/Control-Lens-Plated.html#contextsOf" class="link">Source</a></p><div class="doc"><p>Return a list of all of the editable contexts for every location in the structure, recursively, using a user-specified <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> to walk each layer.</p><pre>propUniverse l x = <code><a href="Control-Lens-Plated.html#v:universeOf">universeOf</a></code> l x <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:map">map</a></code> <code><a href="file:///usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#v:pos">pos</a></code> (<code><a href="Control-Lens-Plated.html#v:contextsOf">contextsOf</a></code> l x)
propId l x = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:all">all</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> x) [<code><a href="Control-Lens-Internal-Context.html#v:extract">extract</a></code> w | w <- <code><a href="Control-Lens-Plated.html#v:contextsOf">contextsOf</a></code> l x]
</pre><pre><code><a href="Control-Lens-Plated.html#v:contextsOf">contextsOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> a -> [<code><a href="Control-Lens-Internal-Context.html#t:Context">Context</a></code> a a a]
</pre></div></div><div class="top"><p class="src"><a name="v:contextsOn" class="def">contextsOn</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Traversal.html#t:ATraversal">ATraversal</a> s t a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a t] <a href="src/Control-Lens-Plated.html#contextsOn" class="link">Source</a></p><div class="doc"><p>Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, recursively using <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>.</p><pre><code><a href="Control-Lens-Plated.html#v:contextsOn">contextsOn</a></code> b ≡ <code><a href="Control-Lens-Plated.html#v:contextsOnOf">contextsOnOf</a></code> b <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre><pre><code><a href="Control-Lens-Plated.html#v:contextsOn">contextsOn</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> a => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Context">Context</a></code> a a s]
</pre></div></div><div class="top"><p class="src"><a name="v:contextsOnOf" class="def">contextsOnOf</a> :: <a href="Control-Lens-Traversal.html#t:ATraversal">ATraversal</a> s t a a -> <a href="Control-Lens-Traversal.html#t:ATraversal-39-">ATraversal'</a> a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Context">Context</a> a a t] <a href="src/Control-Lens-Plated.html#contextsOnOf" class="link">Source</a></p><div class="doc"><p>Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, recursively using
another user-supplied <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> to walk each layer.</p><pre><code><a href="Control-Lens-Plated.html#v:contextsOnOf">contextsOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Context">Context</a></code> a a s]
</pre></div></div><div class="top"><p class="src"><a name="v:holes" class="def">holes</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => a -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> (->) a a a] <a href="src/Control-Lens-Plated.html#holes" class="link">Source</a></p><div class="doc"><p>The one-level version of <code><a href="Control-Lens-Internal-Context.html#v:context">context</a></code>. This extracts a list of the immediate children as editable contexts.</p><p>Given a context you can use <code><a href="file:///usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#v:pos">pos</a></code> to see the values, <code><a href="file:///usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#v:peek">peek</a></code> at what the structure would be like with an edited result, or simply <code><a href="Control-Lens-Internal-Context.html#v:extract">extract</a></code> the original structure.</p><pre>propChildren x = <code><a href="Control-Lens-Plated.html#v:children">children</a></code> l x <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:map">map</a></code> <code><a href="file:///usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#v:pos">pos</a></code> (<code><a href="Control-Lens-Plated.html#v:holes">holes</a></code> l x)
propId x = <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:all">all</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#v:-61--61-">==</a></code> x) [<code><a href="Control-Lens-Internal-Context.html#v:extract">extract</a></code> w | w <- <code><a href="Control-Lens-Plated.html#v:holes">holes</a></code> l x]
</pre><pre><code><a href="Control-Lens-Plated.html#v:holes">holes</a></code> = <code><a href="Control-Lens-Traversal.html#v:holesOf">holesOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:holesOn" class="def">holesOn</a> :: <a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p => <a href="Control-Lens-Type.html#t:Over">Over</a> p (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p a a) s t a a -> s -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> p a a t] <a href="src/Control-Lens-Plated.html#holesOn" class="link">Source</a></p><div class="doc"><p>An alias for <code><a href="Control-Lens-Traversal.html#v:holesOf">holesOf</a></code>, provided for consistency with the other combinators.</p><pre><code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> ≡ <code><a href="Control-Lens-Traversal.html#v:holesOf">holesOf</a></code>
</pre><pre><code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> :: <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code> s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> :: <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> :: <code><a href="Control-Lens-Type.html#t:IndexedLens-39-">IndexedLens'</a></code> i s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (<code><a href="Control-Lens-Internal-Indexed.html#v:Indexed">Indexed</a></code> i) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOn">holesOn</a></code> :: <code><a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a></code> i s a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (<code><a href="Control-Lens-Internal-Indexed.html#v:Indexed">Indexed</a></code> i) a a s]
</pre></div></div><div class="top"><p class="src"><a name="v:holesOnOf" class="def">holesOnOf</a> :: <a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p r r) s t a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p (<a href="Control-Lens-Internal-Bazaar.html#t:Bazaar">Bazaar</a> p r r) a b r r -> s -> [<a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a> p r r t] <a href="src/Control-Lens-Plated.html#holesOnOf" class="link">Source</a></p><div class="doc"><p>Extract one level of <code><a href="Control-Lens-Plated.html#v:holes">holes</a></code> from a container in a region specified by one <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code>, using another.</p><pre><code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> b l ≡ <code><a href="Control-Lens-Traversal.html#v:holesOf">holesOf</a></code> (b <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:.">.</a></code> l)
</pre><pre><code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code> a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (->) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:IndexedLens-39-">IndexedLens'</a></code> i a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (<code><a href="Control-Lens-Internal-Indexed.html#v:Indexed">Indexed</a></code> i) a a s]
<code><a href="Control-Lens-Plated.html#v:holesOnOf">holesOnOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s a -> <code><a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a></code> i a a -> s -> [<code><a href="Control-Lens-Internal-Context.html#t:Pretext">Pretext</a></code> (<code><a href="Control-Lens-Internal-Indexed.html#v:Indexed">Indexed</a></code> i) a a s]
</pre></div></div><div class="top"><p class="src"><a name="v:para" class="def">para</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => (a -> [r] -> r) -> a -> r <a href="src/Control-Lens-Plated.html#para" class="link">Source</a></p><div class="doc"><p>Perform a fold-like computation on each value, technically a paramorphism.</p><pre><code><a href="Control-Lens-Plated.html#v:para">para</a></code> ≡ <code><a href="Control-Lens-Plated.html#v:paraOf">paraOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:paraOf" class="def">paraOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Endo">Endo</a> [a]) a a -> (a -> [r] -> r) -> a -> r <a href="src/Control-Lens-Plated.html#paraOf" class="link">Source</a></p><div class="doc"><p>Perform a fold-like computation on each value, technically a paramorphism.</p><pre><code><a href="Control-Lens-Plated.html#v:paraOf">paraOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> a a -> (a -> [r] -> r) -> a -> r
</pre></div></div><div class="top"><p class="src"><a name="v:..." class="def">(...)</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> c) => <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> f s t c c -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f c c a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f s t a b <span class="fixity">infixr 9</span><span class="rightedge"></span> <a href="src/Control-Lens-Plated.html#..." class="link">Source</a></p><div class="doc"><p>Compose through a plate</p></div></div><div class="top"><p class="src"><a name="v:deep" class="def">deep</a> :: (<a href="Control-Lens-Internal-Indexed.html#t:Conjoined">Conjoined</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f, <a href="Control-Lens-Plated.html#t:Plated">Plated</a> s) => <a href="Control-Lens-Traversal.html#t:Traversing">Traversing</a> p f s s a b -> <a href="Control-Lens-Type.html#t:Over">Over</a> p f s s a b <a href="src/Control-Lens-Plated.html#deep" class="link">Source</a></p><div class="doc"><p>Try to apply a traversal to all transitive descendants of a <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> container, but
do not recurse through matching descendants.</p><pre><code><a href="Control-Lens-Plated.html#v:deep">deep</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> s => <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a -> <code><a href="Control-Lens-Type.html#t:Fold">Fold</a></code> s a
<code><a href="Control-Lens-Plated.html#v:deep">deep</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> s => <code><a href="Control-Lens-Type.html#t:IndexedFold">IndexedFold</a></code> s a -> <code><a href="Control-Lens-Type.html#t:IndexedFold">IndexedFold</a></code> s a
<code><a href="Control-Lens-Plated.html#v:deep">deep</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> s => <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> s s a b -> <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> s s a b
<code><a href="Control-Lens-Plated.html#v:deep">deep</a></code> :: <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> s => <code><a href="Control-Lens-Type.html#t:IndexedTraversal">IndexedTraversal</a></code> s s a b -> <code><a href="Control-Lens-Type.html#t:IndexedTraversal">IndexedTraversal</a></code> s s a b
</pre></div></div><h1 id="g:3">Compos</h1><div class="doc"><p>Provided for compatibility with Björn Bringert's <code>compos</code> library.</p><p>Note: Other operations from compos that were inherited by <code>uniplate</code> are <em>not</em> included
to avoid having even more redundant names for the same operators. For comparison:</p><pre><code>composOpMonoid</code> ≡ <code><a href="Control-Lens-Fold.html#v:foldMapOf">foldMapOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
<code>composOpMPlus</code> f ≡ <code><a href="Control-Lens-Fold.html#v:msumOf">msumOf</a></code> (<code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:.">.</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#v:to">to</a></code> f)
<code>composOp</code> ≡ <code>descend</code> ≡ <code><a href="Control-Lens-Setter.html#v:over">over</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
<code>composOpM</code> ≡ <code>descendM</code> ≡ <code><a href="Control-Lens-Traversal.html#v:mapMOf">mapMOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
<code>composOpM_</code> ≡ <code>descendM_</code> ≡ <code><a href="Control-Lens-Fold.html#v:mapMOf_">mapMOf_</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre></div><div class="top"><p class="src"><a name="v:composOpFold" class="def">composOpFold</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => b -> (b -> b -> b) -> (a -> b) -> a -> b <a href="src/Control-Lens-Plated.html#composOpFold" class="link">Source</a></p><div class="doc"><p>Fold the immediate children of a <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> container.</p><pre><code><a href="Control-Lens-Plated.html#v:composOpFold">composOpFold</a></code> z c f = <code><a href="Control-Lens-Fold.html#v:foldrOf">foldrOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> (c <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Function.html#v:.">.</a></code> f) z
</pre></div></div><h1 id="g:4">Parts</h1><div class="top"><p class="src"><a name="v:parts" class="def">parts</a> :: <a href="Control-Lens-Plated.html#t:Plated">Plated</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> a [a] <a href="src/Control-Lens-Plated.html#parts" class="link">Source</a></p><div class="doc"><p>The original <code>uniplate</code> combinator, implemented in terms of <code><a href="Control-Lens-Plated.html#t:Plated">Plated</a></code> as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.</p><pre><code><a href="Control-Lens-Plated.html#v:parts">parts</a></code> ≡ <code><a href="Control-Lens-Traversal.html#v:partsOf">partsOf</a></code> <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code>
</pre><p>The resulting <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> is safer to use as it ignores 'over-application' and deals gracefully with under-application,
but it is only a proper <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> if you don't change the list <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:length">length</a></code>!</p></div></div><h1 id="g:5">Generics</h1><div class="top"><p class="src"><a name="v:gplate" class="def">gplate</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Generic">Generic</a> a, <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Rep">Rep</a> a)) => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> a a <a href="src/Control-Lens-Plated.html#gplate" class="link">Source</a></p><div class="doc"><p>Implement <code><a href="Control-Lens-Plated.html#v:plate">plate</a></code> operation for a type using its <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:Generic">Generic</a></code> instance.</p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:GPlated" class="def">GPlated</a> a g <a href="src/Control-Lens-Plated.html#GPlated" class="link">Source</a></p><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">gplate'</p></div><div class="subs instances"><p id="control.i:GPlated" class="caption collapser" onclick="toggleSection('i:GPlated')">Instances</p><div id="section.i:GPlated" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:V1">V1</a></span> <a href="src/Control-Lens-Plated.html#line-764" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:U1">U1</a></span> <a href="src/Control-Lens-Plated.html#line-760" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:K1">K1</a> i b)</span> <a href="src/Control-Lens-Plated.html#line-756" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:K1">K1</a> i a)</span> <a href="src/Control-Lens-Plated.html#line-752" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a f, <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a g) => <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t::-42-:">(:*:)</a> f g)</span> <a href="src/Control-Lens-Plated.html#line-748" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a f, <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a g) => <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t::-43-:">(:+:)</a> f g)</span> <a href="src/Control-Lens-Plated.html#line-743" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a f => <a href="Control-Lens-Plated.html#t:GPlated">GPlated</a> a (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-Generics.html#t:M1">M1</a> i c f)</span> <a href="src/Control-Lens-Plated.html#line-739" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>
|