<div dir="ltr">Thanks Dan. Great help <div><br></div><div>but my problem has not solved yet</div><div>This doesn&#39;t work for type (<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">(Float -&gt; Float)-&gt;Bool)</span></div>
<div><br></div><div>to make it easier ignore the rotation and suppose I want just multiplay with whatever (x ,y) and return the result to this type (<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">(Float -&gt; Float)-&gt;Bool)</span></div>
<div><br></div><div><div>note this type is shorten and replace by t</div><div>Type Point = (Float, Float)</div><div>Type Bitmap = Point -&gt; Bool</div><div><br></div><div>so the function type actually</div><div>func :: Bitmap -&gt; Float -&gt; Bitmap</div>
<div><br></div><div>I want to take Bitmap do some calculation on Bitmap  the return it as Bitmap.</div><div><br></div><div>GHCi response for Dan method is this </div><div><div>    Couldn&#39;t match expected type `Bitmap&#39;</div>
<div>           against inferred type `(a, b)&#39;</div><div>so it is missing a Bool.</div></div><div><br></div><div>hopefully it is clear .</div></div><div><br></div><div>On Mon, Apr 19, 2010 at 7:02 PM, Dan Weston <span dir="ltr">&lt;<a href="mailto:westondan@imageworks.com">westondan@imageworks.com</a>&gt;</span> wrote:</div>
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">First of all, your function </blockquote><div><br></div><div><br></div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
func  (x,y) s dg  =((x*(cos dg) - y*(sin dg)),(x*(sin dg) - y*(cos dg)))<br></div>
does NOT work for type (Float -&gt; Float), unless you mean that that is the type of the unused parameter s. Also, your desired type ((Float -&gt; Float) -&gt; Bool) itself looks suspicious. It must accept any function (without something to apply it to) and arbitrarily return True or False. How will you decide which? I suspect you need another parameter for this function.<br>

<br>
Second, on the off chance you are trying to calculate the position on a circle scaled then rotated an angle dg from (x,y), that new position is<br>
<br>
f (x,y) s dg = (s*(x*(cos dg) - y*(sin dg)),s*(x*(sin dg) + y*(cos dg)))<br>
<br>
in which case you are missing the s and the last minus sign in your formula should be a plus sign.<br>
If so, this can be evaluated with greater clarity (and probably accuracy) in polar coordinates:<br>
<br>
g (x,y) s dg = (r * cos a, r * sin a)<br>
  where r  = s * sqrt (x^2 + y^2)<br>
           a  = atan2 y x + dg<br>
<br>
Third, if you did not need the scale, I would use an underscore to make that clear:<br>
<br>
h (x,y) _ dg = (r * cos a, r * sin a)<br>
  where r  = sqrt (x^2 + y^2)<br>
           a  = atan2 y x + dg<br>
<br>
That&#39;s all the observations I can make unless you describe the problem more clearly. Sorry.<br>
<br>
Dan<br>
<br>
Mujtaba Boori wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
sorry <br>
ok I am trying to make these calculation <br>
func  (x,y) s dg  =((x*(cos dg) - y*(sin dg)),(x*(sin dg) - y*(cos dg)))<br>
<br>
This work for type (Float -&gt; Float)<br>
<br>
but how can make it work with ((Float -&gt; Float) -&gt; Bool)<br>
<br>
because my main function that I want use with.  it takes (Float,Float) -&gt;Bool)  I need to return the same type ((Float,Float) -&gt;Bool)  so it could be used with other function. <br>
<br></div><div class="im">
On Mon, Apr 19, 2010 at 5:54 PM, Ozgur Akgun &lt;<a href="mailto:ozgurakgun@gmail.com" target="_blank">ozgurakgun@gmail.com</a> &lt;mailto:<a href="mailto:ozgurakgun@gmail.com" target="_blank">ozgurakgun@gmail.com</a>&gt;&gt; wrote:<br>

<br>
    Can you at least give an example of how you intend to use this &quot;func&quot;?<br>
    Since you do not describe it&#39;s behaviour, it is very hard to make a<br>
    useful<br>
    comment (at least for me)<br>
<br>
    Best,<br>
<br>
    On 19 April 2010 16:54, Mujtaba Boori &lt;<a href="mailto:mujtaba.boori@gmail.com" target="_blank">mujtaba.boori@gmail.com</a><br></div><div class="im">
    &lt;mailto:<a href="mailto:mujtaba.boori@gmail.com" target="_blank">mujtaba.boori@gmail.com</a>&gt;&gt; wrote:<br>
     &gt;<br>
     &gt; Hello<br>
     &gt; I am sorry for the silly question.<br>
     &gt;<br>
     &gt; I have a function as the following<br>
     &gt; func:: ((Float,Float) -&gt;Bool) -&gt; Float -&gt; ((Float,Float) -&gt; Bool)<br>
     &gt; I am trying to make calculation in this type ((Float,Float)<br>
    -&gt;Bool)  with Float and then pass the information to ((Float,Float)<br>
    -&gt; Bool)<br>
     &gt;<br>
     &gt; Thank again appreciated.<br>
     &gt; _______________________________________________<br>
     &gt; Haskell-Cafe mailing list<br></div>
     &gt; <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a> &lt;mailto:<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a>&gt;<div class="im"><br>
     &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
     &gt;<br>
<br>
<br>
<br>
    --<br>
    Ozgur Akgun<br>
<br>
<br>
<br>
<br>
-- <br>
Mujtaba Ali Alboori<br>
<br>
</div></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Mujtaba Ali Alboori<br>
</div></div>