/
Control-Lens-Representable.html
121 lines (121 loc) · 28.7 KB
/
Control-Lens-Representable.html
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
<!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.Representable</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-Representable.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Lens-Representable.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-3.5.1: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>RankNTypes</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>Edward Kmett <ekmett@gmail.com></td></tr><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Control.Lens.Representable</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Representable Functors
</a></li><li><a href="#g:2">Using Lenses as Representations
</a></li><li><a href="#g:3">Default definitions
</a></li><li><a href="#g:4">Wrapped Representations
</a></li><li><a href="#g:5">Setting with Representation
</a></li><li><a href="#g:6">Folding with Representation
</a></li><li><a href="#g:7">Traversing with Representation
</a></li><li><a href="#g:8">Representable Setters, Folds and Traversals
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Corepresentable endofunctors represented by their polymorphic lenses
</p><p>The polymorphic lenses of the form <code>(forall x. <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> (f x) x)</code> each
represent a distinct path into a functor <code>f</code>. If the functor is entirely
characterized by assigning values to these paths, then the functor is
representable.
</p><p>Consider the following example.
</p><pre> import Control.Lens
import Data.Distributive
</pre><pre> data Pair a = Pair { _x :: a, _y :: a }
</pre><pre> <code><a href="Control-Lens-TH.html#t:makeLenses">makeLenses</a></code> ''Pair</pre><pre>
instance <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Pair where
<code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> f = Pair (f x) (f y)
</pre><p>From there, you can get definitions for a number of instances for free.
</p><pre>
instance <code>Applicative</code> Pair where
<code>pure</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
(<code><*></code>) = <code><a href="Control-Lens-Representable.html#v:apRep">apRep</a></code>
</pre><pre>
instance <code>Monad</code> Pair where
<code>return</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
(<code>>>=</code>) = <code><a href="Control-Lens-Representable.html#v:bindRep">bindRep</a></code>
</pre><pre>
instance <code><a href="Data-Distributive.html#t:Distributive">Distributive</a></code> Pair where
<code><a href="Data-Distributive.html#t:distribute">distribute</a></code> = <code><a href="Control-Lens-Representable.html#v:distributeRep">distributeRep</a></code>
</pre></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> Functor f => <a href="#t:Representable">Representable</a> f <span class="keyword">where</span><ul class="subs"><li><a href="#v:rep">rep</a> :: (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a) -> f a</li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Rep">Rep</a> f = <span class="keyword">forall</span> a. <a href="Control-Lens-Type.html#t:Simple">Simple</a> <a href="Control-Lens-Type.html#t:Lens">Lens</a> (f a) a</li><li class="src short"><a href="#v:fmapRep">fmapRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (a -> b) -> f a -> f b</li><li class="src short"><a href="#v:pureRep">pureRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => a -> f a</li><li class="src short"><a href="#v:apRep">apRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f (a -> b) -> f a -> f b</li><li class="src short"><a href="#v:bindRep">bindRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f a -> (a -> f b) -> f b</li><li class="src short"><a href="#v:distributeRep">distributeRep</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Functor w) => w (f a) -> f (w a)</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Path">Path</a> f = <a href="#v:Path">Path</a> {<ul class="subs"><li><a href="#v:walk">walk</a> :: <a href="Control-Lens-Representable.html#t:Rep">Rep</a> f</li></ul>}</li><li class="src short"><a href="#v:paths">paths</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f (<a href="Control-Lens-Representable.html#t:Path">Path</a> f)</li><li class="src short"><a href="#v:tabulated">tabulated</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (<a href="Control-Lens-Representable.html#t:Path">Path</a> f -> a) -> f a</li><li class="src short"><a href="#v:rmap">rmap</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> b) -> f a -> f b</li><li class="src short"><a href="#v:rfoldMap">rfoldMap</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Monoid m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m) -> f a -> m</li><li class="src short"><a href="#v:rfoldr">rfoldr</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> b -> b) -> b -> f a -> b</li><li class="src short"><a href="#v:rtraverse">rtraverse</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Applicative g) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> f a -> g (f b)</li><li class="src short"><a href="#v:rtraverse_">rtraverse_</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Applicative g) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> f a -> g ()</li><li class="src short"><a href="#v:rfor">rfor</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Applicative g) => f a -> (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> g (f b)</li><li class="src short"><a href="#v:rmapM">rmapM</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Monad m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> f a -> m (f b)</li><li class="src short"><a href="#v:rmapM_">rmapM_</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Monad m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> f a -> m ()</li><li class="src short"><a href="#v:rforM">rforM</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Monad m) => f a -> (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> m (f b)</li><li class="src short"><a href="#v:rmapped">rmapped</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => <a href="Control-Lens-IndexedSetter.html#t:IndexedSetter">IndexedSetter</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) (f b) a b</li><li class="src short"><a href="#v:rfolded">rfolded</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f) => <a href="Control-Lens-IndexedFold.html#t:IndexedFold">IndexedFold</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) a</li><li class="src short"><a href="#v:rtraversed">rtraversed</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f) => <a href="Control-Lens-IndexedTraversal.html#t:IndexedTraversal">IndexedTraversal</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) (f b) a b</li></ul></div><div id="interface"><h1 id="g:1">Representable Functors
</h1><div class="top"><p class="src"><span class="keyword">class</span> Functor f => <a name="t:Representable" class="def">Representable</a> f <span class="keyword">where</span><a href="src/Control-Lens-Representable.html#Representable" class="link">Source</a></p><div class="doc"><p>Representable Functors.
</p><p>A <code>Functor</code> <code>f</code> is <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> if it is isomorphic to <code>(x -> a)</code>
for some x. Nearly all such functors can be represented by choosing <code>x</code> to be
the set of lenses that are polymorphic in the contents of the <code>Functor</code>,
that is to say <code>x = <code><a href="Control-Lens-Representable.html#t:Rep">Rep</a></code> f</code> is a valid choice of <code>x</code> for (nearly) every
<code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code>.
</p><p>Note: Some sources refer to covariant representable functors as
corepresentable functors, and leave the "representable" name to
contravariant functors (those are isomorphic to <code>(a -> x)</code> for some <code>x</code>).
</p><p>As the covariant case is vastly more common, and both are often referred to
as representable functors, we choose to call these functors <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code>
here.
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:rep" class="def">rep</a> :: (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a) -> f a<a href="src/Control-Lens-Representable.html#rep" class="link">Source</a></p></div><div class="subs instances"><p id="control.i:Representable" class="caption collapser" onclick="toggleSection('i:Representable')">Instances</p><div id="section.i:Representable" class="show"><table><tr><td class="src"><a href="Control-Lens-Representable.html#t:Representable">Representable</a> Identity</td><td class="doc empty"> </td></tr><tr><td class="src">Eq e => <a href="Control-Lens-Representable.html#t:Representable">Representable</a> ((->) e)</td><td class="doc"><p>NB: The <code>Eq</code> requirement on this instance is a consequence of the choice of <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> as a <code><a href="Control-Lens-Representable.html#t:Rep">Rep</a></code>, it isn't fundamental.
</p></td></tr></table></div></div></div><h1 id="g:2">Using Lenses as Representations
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Rep" class="def">Rep</a> f = <span class="keyword">forall</span> a. <a href="Control-Lens-Type.html#t:Simple">Simple</a> <a href="Control-Lens-Type.html#t:Lens">Lens</a> (f a) a<a href="src/Control-Lens-Representable.html#Rep" class="link">Source</a></p><div class="doc"><p>The representation of a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code> as Lenses
</p></div></div><h1 id="g:3">Default definitions
</h1><div class="top"><p class="src"><a name="v:fmapRep" class="def">fmapRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (a -> b) -> f a -> f b<a href="src/Control-Lens-Representable.html#fmapRep" class="link">Source</a></p><div class="doc"><p><code><a href="Control-Lens-Representable.html#v:fmapRep">fmapRep</a></code> is a valid default definition for <code>fmap</code> for a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code>
functor.
</p><pre><code><a href="Control-Lens-Representable.html#v:fmapRep">fmapRep</a></code> f m = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> <code>$</code> i -> f (m <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i)</pre><p>Usage for a <code><code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Foo</code>:
</p><pre>
instance <code>Functor</code> Foo where
<code>fmap</code> = <code><a href="Control-Lens-Representable.html#v:fmapRep">fmapRep</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:pureRep" class="def">pureRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => a -> f a<a href="src/Control-Lens-Representable.html#pureRep" class="link">Source</a></p><div class="doc"><p><code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code> is a valid default definition for <code>pure</code> and <code>return</code> for a
<code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor.
</p><pre><code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code> = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> . <code>const</code></pre><p>Usage for a <code><code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Foo</code>:
</p><pre>
instance <code>Applicative</code> Foo where
<code>pure</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
...
</pre><pre>
instance <code>Monad</code> Foo where
<code>return</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
...
</pre></div></div><div class="top"><p class="src"><a name="v:apRep" class="def">apRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f (a -> b) -> f a -> f b<a href="src/Control-Lens-Representable.html#apRep" class="link">Source</a></p><div class="doc"><p><code><a href="Control-Lens-Representable.html#v:apRep">apRep</a></code> is a valid default definition for (<code><*></code>) for a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code>
functor.
</p><pre><code><a href="Control-Lens-Representable.html#v:apRep">apRep</a></code> mf ma = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> <code>$</code> i -> mf <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i <code>$</code> ma <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i</pre><p>Usage for a <code><code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Foo</code>:
</p><pre>
instance <code>Applicative</code> Foo where
<code>pure</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
(<code><*></code>) = <code><a href="Control-Lens-Representable.html#v:apRep">apRep</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:bindRep" class="def">bindRep</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f a -> (a -> f b) -> f b<a href="src/Control-Lens-Representable.html#bindRep" class="link">Source</a></p><div class="doc"><p><code><a href="Control-Lens-Representable.html#v:bindRep">bindRep</a></code> is a valid default default definition for '(>>=)' for a
representable functor.
</p><pre><code><a href="Control-Lens-Representable.html#v:bindRep">bindRep</a></code> m f = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> <code>$</code> i -> f (m <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i) <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i</pre><p>Usage for a <code><code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Foo</code>:
</p><pre>
instance <code>Monad</code> Foo where
<code>return</code> = <code><a href="Control-Lens-Representable.html#v:pureRep">pureRep</a></code>
(<code>>>=</code>) = <code><a href="Control-Lens-Representable.html#v:bindRep">bindRep</a></code>
</pre></div></div><div class="top"><p class="src"><a name="v:distributeRep" class="def">distributeRep</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Functor w) => w (f a) -> f (w a)<a href="src/Control-Lens-Representable.html#distributeRep" class="link">Source</a></p><div class="doc"><p>A default definition for <code><a href="Data-Distributive.html#t:distribute">distribute</a></code> for a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code>
</p><pre><code><a href="Control-Lens-Representable.html#v:distributeRep">distributeRep</a></code> wf = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> <code>$</code> i -> <code>fmap</code> (<code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i) wf</pre><p>Usage for a <code><code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> Foo</code>:
</p><pre>
instance <code><a href="Data-Distributive.html#t:Distributive">Distributive</a></code> Foo where
<code><a href="Data-Distributive.html#t:distribute">distribute</a></code> = <code><a href="Control-Lens-Representable.html#v:distributeRep">distributeRep</a></code>
</pre></div></div><h1 id="g:4">Wrapped Representations
</h1><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:Path" class="def">Path</a> f <a href="src/Control-Lens-Representable.html#Path" class="link">Source</a></p><div class="doc"><p>Sometimes you need to store a path lens into a container, but at least
at this time, <code>ImpredicativePolymorphism</code> in GHC is somewhat lacking.
</p><p>This type provides a way to, say, store a <code>[]</code> of paths.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Path" class="def">Path</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:walk" class="def">walk</a> :: <a href="Control-Lens-Representable.html#t:Rep">Rep</a> f</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><a name="v:paths" class="def">paths</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => f (<a href="Control-Lens-Representable.html#t:Path">Path</a> f)<a href="src/Control-Lens-Representable.html#paths" class="link">Source</a></p><div class="doc"><p>A <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code> has a fixed shape. This fills each position
in it with a <code><a href="Control-Lens-Representable.html#t:Path">Path</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:tabulated" class="def">tabulated</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (<a href="Control-Lens-Representable.html#t:Path">Path</a> f -> a) -> f a<a href="src/Control-Lens-Representable.html#tabulated" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> that is an isomorphism. Predicativity requires that
we wrap the <code><a href="Control-Lens-Representable.html#t:Rep">Rep</a></code> as a <code>Key</code>, however.
</p></div></div><h1 id="g:5">Setting with Representation
</h1><div class="top"><p class="src"><a name="v:rmap" class="def">rmap</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> b) -> f a -> f b<a href="src/Control-Lens-Representable.html#rmap" class="link">Source</a></p><div class="doc"><p>Map over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> for the
current position
</p><pre><code><a href="Control-Lens-Representable.html#v:rmap">rmap</a></code> f m = <code><a href="Control-Lens-Representable.html#v:rep">rep</a></code> <code>$</code> i -> f i (m <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> i)</pre></div></div><h1 id="g:6">Folding with Representation
</h1><div class="top"><p class="src"><a name="v:rfoldMap" class="def">rfoldMap</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Monoid m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m) -> f a -> m<a href="src/Control-Lens-Representable.html#rfoldMap" class="link">Source</a></p><div class="doc"><p>Fold over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>, yielding a <code>Monoid</code>
</p></div></div><div class="top"><p class="src"><a name="v:rfoldr" class="def">rfoldr</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> b -> b) -> b -> f a -> b<a href="src/Control-Lens-Representable.html#rfoldr" class="link">Source</a></p><div class="doc"><p>Fold over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.
</p></div></div><h1 id="g:7">Traversing with Representation
</h1><div class="top"><p class="src"><a name="v:rtraverse" class="def">rtraverse</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Applicative g) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> f a -> g (f b)<a href="src/Control-Lens-Representable.html#rtraverse" class="link">Source</a></p><div class="doc"><p>Traverse a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
</p></div></div><div class="top"><p class="src"><a name="v:rtraverse_" class="def">rtraverse_</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Applicative g) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> f a -> g ()<a href="src/Control-Lens-Representable.html#rtraverse_" class="link">Source</a></p><div class="doc"><p>Traverse a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>, discarding the result
</p></div></div><div class="top"><p class="src"><a name="v:rfor" class="def">rfor</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Applicative g) => f a -> (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> g b) -> g (f b)<a href="src/Control-Lens-Representable.html#rfor" class="link">Source</a></p><div class="doc"><p>Traverse a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
and a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> (and the arguments flipped)
</p></div></div><div class="top"><p class="src"><a name="v:rmapM" class="def">rmapM</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Monad m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> f a -> m (f b)<a href="src/Control-Lens-Representable.html#rmapM" class="link">Source</a></p><div class="doc"><p><code>mapM</code> over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:rmapM_" class="def">rmapM_</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f, Monad m) => (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> f a -> m ()<a href="src/Control-Lens-Representable.html#rmapM_" class="link">Source</a></p><div class="doc"><p><code>mapM</code> over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>, discarding the result
</p></div></div><div class="top"><p class="src"><a name="v:rforM" class="def">rforM</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f, Monad m) => f a -> (<a href="Control-Lens-Representable.html#t:Rep">Rep</a> f -> a -> m b) -> m (f b)<a href="src/Control-Lens-Representable.html#rforM" class="link">Source</a></p><div class="doc"><p><code>mapM</code> over a <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> functor with access to the current path
as a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> (with the arguments flipped)
</p></div></div><h1 id="g:8">Representable Setters, Folds and Traversals
</h1><div class="top"><p class="src"><a name="v:rmapped" class="def">rmapped</a> :: <a href="Control-Lens-Representable.html#t:Representable">Representable</a> f => <a href="Control-Lens-IndexedSetter.html#t:IndexedSetter">IndexedSetter</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) (f b) a b<a href="src/Control-Lens-Representable.html#rmapped" class="link">Source</a></p><div class="doc"><p>An <code><a href="Control-Lens-IndexedSetter.html#t:IndexedSetter">IndexedSetter</a></code> that walks an <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code> using a <code><a href="Control-Lens-Representable.html#t:Path">Path</a></code> for an index.
</p></div></div><div class="top"><p class="src"><a name="v:rfolded" class="def">rfolded</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, Foldable f) => <a href="Control-Lens-IndexedFold.html#t:IndexedFold">IndexedFold</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) a<a href="src/Control-Lens-Representable.html#rfolded" class="link">Source</a></p><div class="doc"><p>An <code><a href="Control-Lens-IndexedFold.html#t:IndexedFold">IndexedFold</a></code> that walks an <code>Foldable</code> <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code> using a <code><a href="Control-Lens-Representable.html#t:Path">Path</a></code> for an index.
</p></div></div><div class="top"><p class="src"><a name="v:rtraversed" class="def">rtraversed</a> :: (<a href="Control-Lens-Representable.html#t:Representable">Representable</a> f, <a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a> f) => <a href="Control-Lens-IndexedTraversal.html#t:IndexedTraversal">IndexedTraversal</a> (<a href="Control-Lens-Representable.html#t:Path">Path</a> f) (f a) (f b) a b<a href="src/Control-Lens-Representable.html#rtraversed" class="link">Source</a></p><div class="doc"><p>An <code><a href="Control-Lens-IndexedTraversal.html#t:IndexedTraversal">IndexedTraversal</a></code> for a <code><a href="Control-Lens-Traversal.html#t:Traversable">Traversable</a></code> <code><a href="Control-Lens-Representable.html#t:Representable">Representable</a></code> <code>Functor</code>.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.1</p></div></body></html>