<br><br><div><span class="gmail_quote">On 2/21/07, <b class="gmail_sendername">Henning Thielemann</b> <<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Tue, 20 Feb 2007 <a href="mailto:apfelmus@quantentunnel.de">apfelmus@quantentunnel.de</a> wrote:<br><br>> Paul Moore wrote:<br>> > I'm after a function, sort of equivalent to map, but rather than<br>> > mapping a function over a list of arguments, I want to map a list of
<br>> > functions over the same argument. </blockquote></div><br>
Well this is not very sexy, no monads or anything, but I kinda believe in Keep It Simple:<br>
<br>
Prelude> let revApply a f = f a<br>
Prelude> let rMap a fs = map (revApply a) fs<br>
Prelude> rMap 2 [(*4),(^2),(+12),(**0.5)]<br>
[8.0,4.0,14.0,1.4142135623730951]<br>
<br>
oh and I REALLY enjoyed the discussions that this spawned about things
monadic, as there was some really slick stuff in there... The little
thing about 'join' and etcetera... really good stuff.<br>
cheers... <br>
gene<br>