<div dir="ltr">Thanks a lot guys you were really helpful<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">func f1 f2 x = (f1 x) || (f2 x) is working for me</span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><div><br><br><div class="gmail_quote">On Sun, Apr 18, 2010 at 6:27 PM, Thomas Davie <span dir="ltr">&lt;<a href="mailto:tom.davie@gmail.com">tom.davie@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">To do this, you need not just fmap (composition), but also ap, or the combined form, liftA2:<br>
<br>
func = liftA2 (||)<br>
<br>
Bob<br>
<div><div></div><div class="h5"><br>
On 18 Apr 2010, at 18:21, Keith Sheppard wrote:<br>
<br>
&gt; Using composition can be tricky with more than one arg. I just want to<br>
&gt; be sure you&#39;re not really looking for something like:<br>
&gt;<br>
&gt;&gt; func :: (a -&gt; Bool) -&gt; (b -&gt; Bool) -&gt; (a -&gt; b -&gt; Bool)<br>
&gt;<br>
&gt; keeping with your given type I think you&#39;re looking for something like:<br>
&gt;<br>
&gt;&gt; func f1 f2 x = (f1 x) || (f2 x)<br>
&gt;<br>
&gt; I&#39;m sure there is a nice way to do this with function composition but<br>
&gt; I still find composition less intuitive than explicit args in cases<br>
&gt; like this.<br>
&gt;<br>
&gt; On Sun, Apr 18, 2010 at 1:00 PM, Mujtaba Boori &lt;<a href="mailto:mujtaba.boori@gmail.com">mujtaba.boori@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Thanks for helping me but I have another problem (sorry for asking) . I<br>
&gt;&gt; tried to figure it out .<br>
&gt;&gt; how about if I want to compare two kind with (&amp;&amp;) (||)  for<br>
&gt;&gt; func :: (a -&gt; Bool) -&gt; (a -&gt; Bool) -&gt; (a -&gt; Bool)<br>
&gt;&gt;<br>
&gt;&gt; I tried some thing like<br>
&gt;&gt; func = ((||) .)<br>
&gt;&gt; This is the annoying part about Haskell . I can not understand composition .<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Apr 18, 2010 at 4:35 PM, Mujtaba Boori &lt;<a href="mailto:mujtaba.boori@gmail.com">mujtaba.boori@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hello I am kinda newbie in Haskell you can help help me with some<br>
&gt;&gt;&gt; programming<br>
&gt;&gt;&gt; I am trying to make function like for example<br>
&gt;&gt;&gt; func :: (a -&gt; Bool) -&gt; (a -&gt; Bool)<br>
&gt;&gt;&gt; this function make calculation  and return bool . I want to be able to<br>
&gt;&gt;&gt; make bool True when It is False and False when it is True while returning<br>
&gt;&gt;&gt; the a.<br>
&gt;&gt;&gt; Thank you<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Mujtaba Ali Alboori<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Mujtaba Ali Alboori<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Haskell-Cafe mailing list<br>
&gt;&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; <a href="http://keithsheppard.name" target="_blank">keithsheppard.name</a><br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mujtaba Ali Alboori<br>
</div></div></div>