title: How to combine lenses in "parallel"
body: <p>I'm new to the excelent <code>Control.Lens</code> and I'm trying to combine 2 lens in "parallel" (not in sequence) like I would do with `Control.Arrow.&amp;&amp;&amp;).</p>
  
  <p>If I take the example from the <code>lens</code> documentation:</p>
  
  <pre><code>`data Foo a = Foo { _baz :: Int, _bar :: Int, a }
  </code></pre>
  
  <p>I would like to be able to do stuff like :</p>
  
  <pre><code>&gt;&gt; let foo = (bar &amp;&amp;&amp; baz) .~ (1, 20) $ Foo undefined undefined "FOO"
  &gt;&gt; foo ^. (bar &amp;&amp;&amp; baz) 
  (1, 20)
  </code></pre>
  
  <p>I've looked everywhere and I could not find a way to do so. Is that because :</p>
  
  <ul>
  <li>(&amp;&amp;&amp;) exist with another name and I missed it.</li>
  <li>It's useless. I should not need it, therefore nobody bothered implementing it.</li>
  <li>It's trivial to do in another way (using <code>both</code> or <code>&lt;*&gt;</code>)</li>
  </ul>
  
  <h2>Update</h2>
  
  <p><code>&amp;&amp;&amp;</code> can be implemented that way :</p>
  
  <pre><code>(/|\) :: Lens' f a -&gt; Lens' f b -&gt; Lens' f (a, b)
  a /|\ b = lens getBoth setBoth where
      getBoth f = (f ^. a, f ^. b)
      setBoth f (v, w) = a .~ v $ f' where
          f' = b .~ w $ f
  
  barz :: Lens' Foo (Int, Int)
  barz = bar /|\ baz
  </code></pre>
  
  <p>However, it needs a type signature which is a bit annoying.</p>