Answering my own question, one can achieve the goal via doing a lookup, if the number of possible parameters is limited.<br>eg. assume add is a function which can only take Int&#39;s from [0..9].<br><br>Interestingly, my situation is exactly like this. I think I&#39;ll implement such a lookup.<br>
<br>The question is still open though, if somebody has some magic to extract the prameter from an applied function...<br><br><div class="gmail_quote">2009/11/28 Ozgur Akgun <span dir="ltr">&lt;<a href="mailto:ozgurakgun@gmail.com">ozgurakgun@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry, no good.<br><br>I don&#39;t want to guess the first paramater, I really want to access it. <br>
<br><div class="gmail_quote">2009/11/28 Steffen Schuldenzucker <span dir="ltr">&lt;<a href="mailto:sschuldenzucker@uni-bonn.de" target="_blank">sschuldenzucker@uni-bonn.de</a>&gt;</span><div><div></div><div class="h5"><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Ozgur Akgun wrote:<br>
&gt; Hi cafe,<br>
&gt;<br>
&gt; Is such a thing possible,<br>
&gt;<br>
&gt;<br>
&gt; add :: Int -&gt; Int -&gt; Int<br>
&gt; add x y = x + y<br>
&gt;<br>
&gt; -- a list of partially applied functions<br>
&gt; adds = [add 3, add 5, add 7, add 3, add 5, add 8]<br>
&gt;<br>
&gt; -- an example usage of the list<br>
&gt; k = map (\ f -&gt; f 10 ) adds<br>
&gt;<br>
&gt; add3s = filter (?) adds -- add3s = [add 3, add 3]<br>
&gt; addEvens = filter (?) adds --addEvens = [add 8]<br>
&gt;<br>
&gt;<br>
&gt; I want to have functions in place of the ? signs. I guess one would need<br>
&gt; a way of extracting the applied value from a partially applied function<br>
&gt; (or totally, doesn&#39;t matter)<br>
<br>
</div>Well, sure you can:<br>
<br>
add3s = filter (\f -&gt; f 0 == 3) adds<br>
addEvens = filter (\f -&gt; isEven $ f 0) adds<br>
<br>
This is only possible since there is that special property of the<br>
addition that (add a) 0 == a forall a, i.e. you can extract the first<br>
parameter back out of the partial applied function by passing 0 as a<br>
second parameter.<br>
<br>
It clearly depends on the function how much information about the<br>
parameters can be read from the result.<br>
<font color="#888888"><br>
<br>
-- Steffen<br>
</font><div><div></div><div><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">Ozgur Akgun<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>