title: How do I combine lenses and functors?
body: <p>I'm trying to get used to the <code>lens</code> library for Haskell, and find myself struggling at some simple problems. For instance, let's say (for convenience) that <code>at</code> and <code>_1</code> have the following types (this is how I understand them, at least):</p>
  
  <pre><code>at :: Ord k =&gt; k -&gt; Lens' (Map k v) (Maybe v)
  
  _1 :: Lens' (a, b) a
  </code></pre>
  
  <p>How do I combine these lenses into a lens with the following type:</p>
  
  <pre><code>maybeFst :: Ord k =&gt; k -&gt; Lens' (Map k (a, b)) (Maybe a)
  </code></pre>