Skip to content
This repository
Newer
Older
100644 423 lines (350 sloc) 20.525 kb
1ca949a2 »
2012-08-09 oxford ,
1 Lens: Lenses, Folds, and Traversals
5e9c11bc »
2012-08-09 better title
2 ==================================
c5c8e5ff »
2012-07-25 repository initialized
3
4 [![Build Status](https://secure.travis-ci.org/ekmett/lens.png?branch=master)](http://travis-ci.org/ekmett/lens)
5
2f342e40 »
2012-08-09 ,
6 This package provides families of [lenses](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Type.hs), [isomorphisms](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Iso.hs), [folds](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Fold.hs), [traversals](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Traversal.hs), [getters](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Getter.hs) and [setters](https://github.com/ekmett/lens/blob/master/src/Control/Lens/Setter.hs).
9af3f66e »
2012-07-31 metadata
7
27a1efdf »
2012-09-12 Overview
8 An overview of the [derivation](https://github.com/ekmett/lens/wiki/Derivation) of these types can be found on the [Lens Wiki](https://github.com/ekmett/lens/wiki) along with a brief [Overview](https://github.com/ekmett/lens/wiki/Overview).
b65890a3 »
2012-08-08 tutorial link
9
0f5267f8 »
2012-09-12 use frames for github docs
10 Documentation is available through [github](http://ekmett.github.com/lens/frames.html) or [hackage](http://hackage.haskell.org/package/lens).
0c4742e6 »
2012-08-09 added the big uml diagram to the readme
11
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
12 Field Guide
13 -----------
a23571cf »
2012-08-26 Refactored 'at' and 'contains' into 'Control.Lens.IndexedLens'
14
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
15 [![Lens Hierarchy](https://s3.amazonaws.com/creately-published/h5nyo9ne1)](https://creately.com/diagram/h5nyo9ne1/LBbRz63yg4yQsTXGLtub1bQU4%3D)
a23571cf »
2012-08-26 Refactored 'at' and 'contains' into 'Control.Lens.IndexedLens'
16
e409f0e8 »
2012-08-09 lots of examples
17 Examples
18 --------
9af3f66e »
2012-07-31 metadata
19
4899c604 »
2012-09-12 see wiki
20 (See [`wiki/Examples`](https://github.com/ekmett/lens/wiki/Examples))
21
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
22 First, import `Control.Lens`.
23
24 ```haskell
25 ghci> import Control.Lens
26 ```
27
28 Now, you can read from lenses
29
30 ```haskell
31 ghci> ("hello","world")^._2
32 "world"
33 ```
34
35 and you can write to lenses.
36
37 ```haskell
38 ghci> set _2 42 ("hello","world")
39 ("hello",42)
40 ```
41
42 Composing lenses for reading (or writing) goes in the order an imperative programmer would expect, and just uses `(.)` from the `Prelude`.
e409f0e8 »
2012-08-09 lots of examples
43
44 ```haskell
45 ghci> ("hello",("world","!!!"))^._2._1
46 "world"
47 ```
48
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
49 ```haskell
f9901b52 »
2012-09-26 fixed set example (copied from @emwap's edit to the wiki)
50 ghci> set (_2._1) 42 ("hello",("world","!!!"))
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
51 ("hello",(42,"!!!"))
52 ```
e409f0e8 »
2012-08-09 lots of examples
53
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
54 You can make a `Getter` out of a pure functions with `to`.
e409f0e8 »
2012-08-09 lots of examples
55
56 ```haskell
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
57 ghci> "hello"^.to length
e409f0e8 »
2012-08-09 lots of examples
58 5
59 ```
60
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
61 You can easily compose a `Getter` with a `Lens` just using `(.)`. No explicit coercion is necessary.
62
63 ```haskell
64 ghci> ("hello",("world","!!!"))^._2._2.to length
65 3
66 ```
67
68 As we saw above, you can write to lenses and these writes can change the type of the container. `(.~)` is an infix alias for `set`.
e409f0e8 »
2012-08-09 lots of examples
69
70 ```haskell
71 ghci> _1 .~ "hello" $ ((),"world")
72 ("hello","world)
73 ```
74
34036bce »
2012-09-26 prefix, not infix
75 Conversely `view`, can be used as a prefix alias for `(^.)`.
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
76
77 ```haskell
78 ghci> view _2 (10,20)
79 20
80 ```
81
82 There are a large number of other lens variants provided by the library, in particular a `Traversal` generalizes `traverse` from `Data.Traversable`.
83
819ec495 »
2012-09-11 :
84 We'll come back to those later, but continuing with just lenses:
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
85
42550937 »
2012-08-09 moar examples
86 You can let the library automatically derive lenses for fields of your data type
87
88 ```haskell
89 import Control.Lens
90
91 data Foo a = Foo { _bar :: Int, _baz :: Int, _quux :: a }
92 makeLenses ''Foo
93 ```
94
95 This will automatically generate the following lenses:
96
97 ```haskell
98 bar, baz :: Simple Lens (Foo a) Int
99 quux :: Lens (Foo a) (Foo b) a b
100 ```
101
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
102 A `Lens` takes 4 parameters because it can change the types of the whole when you change the type of the part.
103
104 Often you won't need this flexibility, a `Simple Lens` takes 2 parameters, and can be used directly as a `Lens`.
105
e409f0e8 »
2012-08-09 lots of examples
106 You can also write to setters that target multiple parts of a structure, or their composition with other
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
107 lenses or setters. The canonical example of a setter is 'mapped':
108
109 ```haskell
110 mapped :: Functor f => Setter (f a) (f b) a b
111 ```
112
113 `over` is then analogous to `fmap`, but parameterized on the Setter.
114
115 ```haskell
116 ghci> fmap succ [1,2,3]
117 [2,3,4]
118 ghci> over mapped succ [1,2,3]
119 [2,3,4]
120 ```
121
122 The benefit is that you can use any `Lens` as a `Setter`, and the composition of setters with other setters or lenses using `(.)` yields
123 a `Setter`.
124
125 ```haskell
126 ghci> over (mapped._2) succ [(1,2),(3,4)]
127 [(1,3),(3,5)]
128 ```
129
130 `(%~)` is an infix alias for 'over', and the precedence lets you avoid swimming in parentheses:
e409f0e8 »
2012-08-09 lots of examples
131
132 ```haskell
133 ghci> _1.mapped._2.mapped %~ succ $ ([(42, "hello")],"world")
134 ([(42, "ifmmp")],"world")
135 ```
136
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
137 There are a number of combinators that resemble the `+=`, `*=`, etc. operators from C/C++ for working with the monad transformers.
138
139 There are `+~`, `*~`, etc. analogues to those combinators that work functionally, returning the modified version of the structure.
140
e409f0e8 »
2012-08-09 lots of examples
141 ```haskell
142 ghci> both *~ 2 $ (1,2)
143 (2,4)
144 ```
145
146 There are combinators for manipulating the current state in a state monad as well
147
148 ```haskell
149 fresh :: MonadState Int m => m Int
150 fresh = id <+= 1
151 ```
152
153 Anything you know how to do with a `Foldable` container, you can do with a `Fold`
154
155 ```haskell
156 ghci> :m + Data.Char Data.Text.Lens
157 ghci> allOf (folded.text) isLower ["hello"^.packed, "goodbye"^.packed]
158 True
159 ```
160
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
161 You can also use this for generic programming. Combinators are included that are based on Neil Mitchell's `uniplate`, but which
162 have been generalized to work on or as lenses, folds, and traversals.
e409f0e8 »
2012-08-09 lots of examples
163
164 ```haskell
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
165 ghci> :m + Data.Data.Lens
166 ghci> anyOf biplate (=="world") ("hello",(),[(2::Int,"world")])
e409f0e8 »
2012-08-09 lots of examples
167 True
168 ```
169
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
170 As alluded to above, anything you know how to do with a `Traversable` you can do with a `Traversal`.
e409f0e8 »
2012-08-09 lots of examples
171
172 ```haskell
4ad5dda5 »
2012-08-09 ]
173 ghci> mapMOf (traverse._2) (\xs -> length xs <$ putStrLn xs) [(42,"hello"),(56,"world")]
e409f0e8 »
2012-08-09 lots of examples
174 "hello"
175 "world"
176 [(42,5),(56,5)]
177 ```
178
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
179 Moreover, many of the lenses supplied are actually isomorphisms, that means you can use them directly as a lens or getter:
e409f0e8 »
2012-08-09 lots of examples
180
181 ```haskell
182 ghci> let hello = "hello"^.packed
183 "hello"
184 ghci> :t hello
185 hello :: Text
186 ```
187
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
188 but you can also flip them around and use them as a lens the other way with `from`!
e409f0e8 »
2012-08-09 lots of examples
189
190 ```haskell
191 ghci> hello^.from packed.to length
192 5
193 ```
c5c8e5ff »
2012-07-25 repository initialized
194
42550937 »
2012-08-09 moar examples
195 You can automatically derive isomorphisms for your own newtypes with `makeIso`. e.g.
196
197 ```haskell
198 newtype Neither a b = Neither { _nor :: Either a b } deriving (Show)
199 makeIso ''Neither
200 ```
201
202 will automatically derive
203
204 ```haskell
205 neither :: Iso (Neither a b) (Neither c d) (Either a b) (Either c d)
206 nor :: Iso (Either a b) (Either c d) (Neither a b) (Neither c d)
207 ```
208
209 such that
210
211 ```haskell
212 from neither = nor
213 from nor = neither
214 neither.nor = id
215 nor.neither = id
216 ```
217
08d28010 »
2012-08-09 linking madness
218 There is also a fully operational, but simple game of [Pong](https://github.com/ekmett/lens/blob/master/examples/Pong.hs) in the [examples/](https://github.com/ekmett/lens/blob/master/examples/) folder.
219
f752511e »
2012-09-11 Gave the README examples a gentler learning curve.
220 There are also a couple of hundred examples distributed throughout the haddock documentation.
68b7e354 »
2012-08-09 shuffled docs
221
f149ab82 »
2012-09-12 Operators
222 Operators
223 =========
224
4899c604 »
2012-09-12 see wiki
225 (See [`wiki/Operators`](https://github.com/ekmett/lens/wiki/Operators))
f7858ae6 »
2012-09-12 maintenance notes
226
f149ab82 »
2012-09-12 Operators
227 <table>
228 <thead>
229 <tr>
230 <th>Combinator(s)</th>
231 <th>w/ Result</th>
232 <th>Stateful</th>
233 <th>w/ Result</th>
234 <th>Notes</th>
235 </tr>
236 </thead>
237 <tbody>
238 <tr><th colspan=5><a href="http://ekmett.github.com/lens/Control-Lens.html">Control.Lens</a></th></tr>
239 <tr>
240 <td><a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:view"><code>view</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:views"><code>views</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:-94-."><code>^.</code></a></td>
241 <td/>
242 <td><a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:use"><code>use</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:uses"><code>uses</code></a></td>
243 <td/>
244 <td>View target(s). <a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:query"><code>query</code></a> works like <a href="http://ekmett.github.com/lens/Control-Lens-Getter.html#v:use"><code>use</code></a> over a <code>MonadReader</code></td>
245 </tr>
246 <tr>
247 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:set"><code>set</code></a>, <a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:.-126-"><code>.~</code></a></td>
248 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-60-.-126-"><code>&lt;.~</code></a></td>
249 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:.-61-"><code>.=</code></a></td>
250 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:assign"><code>assign</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-60-.-61-"><code>&lt;.=</code></a></td>
251 <td>Replace target(s). <a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--60-.-126-"><code>&lt;&lt;.~</code> and
252 <a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--60-.-61-"><code>&lt;&lt;.=</code></a>
253 return the old value</td>
254 </tr>
255 <tr>
256 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:over"><code>over</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:mapOf"><code>mapOf</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-37--126-"><code>%~</code></a></td>
257 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--37--126-"><code>&lt;%~</code></td>
258 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-37--61-"><code>%=</code></a></td>
259 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--37--61-"><code>&lt;%=</code></td>
260 <td>Update target(s). <a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--60--37--126-"><code>&lt;&lt;%~</code> and
261 <a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--60--37--61-"><code>&lt;&lt;%=</code></a>
262 return the old value</td>
263 </tr>
264 <tr>
265 <td><code>id</code>,<a href="http://ekmett.github.com/lens/Control-Lens-Traversal.html#v:traverseOf"><code>traverseOf</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-37--37--126-"><code>%%~</code></a></td>
266 <td/>
267 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-37--37--61-"><code>%%=</code></a></td>
268 <td/>
269 <td>Update target(s) with an <code>Applicative</code> or auxillary result</td>
270 </tr>
271 <tr>
272 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-43--126-"><code>+~</code></a></td>
273 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--43--126-"><code>&lt;+~</code></td>
274 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-43--61-"><code>+=</code></a></td>
275 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--43--61-"><code>&lt;+=</code></td>
276 <td>Add to target(s)</td>
277 </tr>
278 <tr>
279 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-45--126-"><code>-~</code></a></td>
280 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--45--126-"><code>&lt;-~</code></td>
281 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-45--61-"><code>-=</code></a></td>
282 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--45--61-"><code>&lt;-=</code></td>
283 <td>Subtract from target(s)</td>
284 </tr>
285 <tr>
286 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-42--126-"><code>*~</code></a></td>
287 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--42--126-"><code>&lt;*~</code></td>
288 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-42--61-"><code>*=</code></a></td>
289 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--42--61-"><code>&lt;*=</code></td>
290 <td>Multiply target(s)</td>
291 </tr>
292 <tr>
293 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-47--47--126-"><code>//~</code></a></td>
294 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--47--47--126-"><code>&lt;//~</code></td>
295 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-47--47--61-"><code>//=</code></a></td>
296 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--47--47--61-"><code>&lt;//=</code></td>
297 <td>Divide target(s)</td>
298 </tr>
299 <tr>
300 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-94--126-"><code>^~</code></a></td>
301 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--94--126-"><code>&lt;^~</code></td>
302 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-94--61-"><code>^=</code></a></td>
303 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--94--61-"><code>&lt;^=</code></td>
304 <td>Raise target(s) to a non-negative <code>Integral</code> power</td>
305 </tr>
306 <tr>
307 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-94--94--126-"><code>^^~</code></a></td>
308 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--94--94--126-"><code>&lt;^^~</code></td>
309 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-94--94--61-"><code>^^=</code></a></td>
310 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--94--94--61-"><code>&lt;^^=</code></td>
311 <td>Raise target(s) to an <code>Integral</code> power</td>
312 </tr>
313 <tr>
314 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-42--42--126-"><code>**~</code></a></td>
315 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--42--42--126-"><code>&lt;**~</code></td>
316 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-42--42--61-"><code>**=</code></a></td>
317 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--42--42--61-"><code>&lt;**=</code></td>
318 <td>Raise target(s) to an arbitrary power</td>
319 </tr>
320 <tr>
321 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-124--124--126-"><code>||~</code></a></td>
322 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--124--124--126-"><code>&lt;||~</code></td>
323 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-124--124--61-"><code>||=</code></a></td>
324 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--124--124--61-"><code>&lt;||=</code></td>
325 <td>Logically or target(s)</td>
326 </tr>
327 <tr>
328 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-38--38--126-"><code>&amp;&amp;~</code></a></td>
329 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--38--38--126-"><code>&lt;&amp;&amp;~</code></td>
330 <td><a href="http://ekmett.github.com/lens/Control-Lens-Setter.html#v:-38--38--61-"><code>&amp;&amp;=</code></a></td>
331 <td><a href="http://ekmett.github.com/lens/Control-Lens-Type.html#v:-60--38--38--61-"><code>&lt;&amp;&amp;=</code></td>
332 <td>Logically and target(s)</td>
333 </tr>
334 <tr>
335 <td><a href="http://ekmett.github.com/lens/Control-Lens-Fold.html#v:headOf"><code>headOf</code>,<a href="http://ekmett.github.com/lens/Control-Lens-Fold.html#v:-94--63-"><code>^?</code></a></td>
336 <td/><td/><td/>
337 <td>Return <code>Just</code> the first target or <code>Nothing</code></td>
338 </tr>
339 <tr>
340 <td><a href="http://ekmett.github.com/lens/Control-Lens-Fold.html#v:toListOf"><code>toListOf</code>,<a href="http://ekmett.github.com/lens/Control-Lens-Fold.html#v:-94-.."><code>^..</code></a></td>
341 <td/><td/><td/>
342 <td>Return a list of the target(s)</td>
343 </tr>
344 <tr>
345 <td><a href="http://ekmett.github.com/lens/Control-Lens-Action.html#v:perform"><code>perform</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-Action.html#v:performs"><code>performs</code></a><a href="http://ekmett.github.com/lens/Control-Lens-Action.html#v:-94-!"><code>^!</code></a></td>
346 <td/>
347 <td/>
348 <td/>
349 <td>Perform monadic action(s)</td>
350 </tr>
351 <tr><th colspan=5><a href="http://ekmett.github.com/lens/Control-Lens.html">Control.Lens</a> (Indexed)</th></tr>
352 <tr>
353 <td><a href="http://ekmett.github.com/lens/Control-Lens-IndexedSetter.html#v:iover"><code>iover</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-IndexedSetter.html#v:imapOf"><code>imapOf</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-IndexedSetter.html#v:-37--64--126-"><code>%@~</code></a></td>
354 <td><a href="http://ekmett.github.com/lens/Control-Lens-IndexedLens.html#v:-60--37--64--126-"><code>&lt;%@~</code></td>
355 <td><a href=http://ekmett.github.com/lens/Control-Lens-IndexedSetter.html#v:-37--64--126-"><code>%@=</code></a></td>
356 <td><a href="http://ekmett.github.com/lens/Control-Lens-IndexedLens.html#v:-60--37--64--61-"><code>&lt;%@=</code></td>
357 <td>Update target(s) with access to the index.</td>
358 </tr>
359 <tr>
360 <td><a href="http://ekmett.github.com/lens/Control-Lens-Indexed.html#v:withIndex"><code>withIndex</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-IndexedTraversal.html#v:itraverseOf"><code>itraverseOf</code></a>,<a href="http://ekmett.github.com/lens/Control-Lens-IndexedLens.html#v:-37--37--64--126-"><code>%%@~</code></a></td>
361 <td/>
362 <td><a href="http://ekmett.github.com/lens/Control-Lens-IndexedLens.html#v:-37--37--64--61-"><code>%%@=</code></a></td>
363 <td/>
364 <td>Update target(s) with an <code>Applicative</code> or auxillary result with access to the index.</td>
365 </tr>
366 <tr><th colspan=5><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html">Data.Bits.Lens</a></th></tr>
367 <tr>
368 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-124--126-"><code>|~</code></a></td>
369 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-60--124--126-"><code>&lt;|~</code></td>
370 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-124--61-"><code>|=</code></a></td>
371 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-60--124--61-"><code>&lt;|=</code></td>
372 <td>Bitwise or target(s)</td>
373 </tr>
374 <tr>
375 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-38--126-"><code>&amp;~</code></a></td>
376 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-60--38--126-"><code>&lt;&amp;~</code></td>
377 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-38--61-"><code>&amp;=</code></a></td>
378 <td><a href="http://ekmett.github.com/lens/Data-Bits-Lens.html#v:-60--38--61-"><code>&lt;&amp;=</code></td>
379 <td>Bitwise and target(s)</td>
380 </tr>
381 <tr><th colspan=5><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html">Data.List.Lens</a></th></tr>
382 <tr>
383 <td><a href="http://ekmett.github.com/lens/Data-List-Lens.html#v:-43--43--126-"><code>++~</code></a></td>
384 <td><a href="http://ekmett.github.com/lens/Data-List-Lens.html#v:-60--43--43--126-"><code>&lt;++~</code></td>
385 <td><a href="http://ekmett.github.com/lens/Data-List-Lens.html#v:-43--43--61-"><code>++=</code></a></td>
386 <td><a href="http://ekmett.github.com/lens/Data-List-Lens.html#v:-60--43--43--61-"><code>&lt;++=</code></td>
387 <td>Append to target list(s)</td>
388 </tr>
389 <tr><th colspan=5><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html">Data.Monoid.Lens</a></th></tr>
390 <tr>
391 <td><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html#v:-60--62--126-"><code>&lt;&gt;~</code></a></td>
392 <td><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html#v:-60--60--62--126-"><code>&lt;&lt;&gt;~</code></td>
393 <td><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html#v:-60--62--61-"><code>&lt;&gt;=</code></a></td>
394 <td><a href="http://ekmett.github.com/lens/Data-Monoid-Lens.html#v:-60--60--62--61-"><code>&lt;&lt;&gt;=</code></td>
395 <td><code>mappend</code> to the target monoidal value(s)</td>
396 </tr>
397 <tr><th colspan=5><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html">System.FilePath.Lens</a></th></tr>
398 <tr>
399 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--47--62--126-"><code>&lt;/&gt;~</code></a></td>
400 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--60--47--62--126-"><code>&lt;&lt;/&gt;~</code></td>
401 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--47--62--61-"><code>&lt;/&gt;=</code></a></td>
402 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--60--47--62--61-"><code>&lt;&lt;/&gt;=</code></td>
403 <td>Append a relative path to a <code>FilePath</code></td>
404 </tr>
405 <tr>
406 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60-.-62--126-"><code>&lt;.&gt;~</code></a></td>
407 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--60-.-62--126-"><code>&lt;&lt;.&gt;~</code></td>
408 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60-.-62--61-"><code>&lt;.&gt;=</code></a></td>
409 <td><a href="http://ekmett.github.com/lens/System-FilePath-Lens.html#v:-60--60-.-62--61-"><code>&lt;&lt;.&gt;=</code></td>
410 <td>Append a file extension to a <code>FilePath</code></td>
411 </tr>
412 </tbody>
413 </table>
414
c5c8e5ff »
2012-07-25 repository initialized
415 Contact Information
416 -------------------
417
418 Contributions and bug reports are welcome!
419
420 Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.
421
422 -Edward Kmett
Something went wrong with that request. Please try again.