You can also mix in 'first' and 'second' arbitrarily and read them directly from the type as well, when there is (possibly nested) pair structure on the way to the value being modified. That's why I call fmap, first, and second "semantic editor combinators". Sometime soon I'm going to blog about these tricks.<br>
<br> - Conal<br><br><div class="gmail_quote">On Tue, Nov 18, 2008 at 10:20 AM, Creighton Hogg <span dir="ltr"><<a href="mailto:wchogg@gmail.com">wchogg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br><br><div class="gmail_quote">On Tue, Nov 18, 2008 at 12:15 PM, Conal Elliott <span dir="ltr"><<a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Also, a less forgetful version of subs might be useful:<br><br> withSubs xs e :: [a] -> Event b -> Event (b,a)<br><br>and then<br><br> subs xs e = snd <$> withSubs xs e<br><br>or, if you like,<br><br>
subs = (fmap.fmap.fmap) snd withSubs<br>
<br>Btw, you can read the three fmaps directly from the signature of withSubs (two arrows plus one Event on the way to the pair).<br><font color="#888888"><br> - Conal</font></blockquote></div><br></div>That's a cute trick with the number of fmap's required. Never thought of it that way.<br>
<br>Also, I'd like to apologize for not mentioning quicksilver from #haskell in my last e-mail. An honest slip-up, but an inappropriate one.<br>
</blockquote></div><br>