Re: [Haskell-cafe] newbie question how to pass data

2010-04-20 Thread Stephen Tetley
Hi If you are working with characteristic functions (Point - Bool or Point - Colour...) the common way to do this is to manufacture a Num instance for functions. This gives you syntax overloading of the (+, -, *) operators. Similarly you might want to overload (or have to overload) Floating,

Re: [Haskell-cafe] newbie question how to pass data

2010-04-20 Thread Mujtaba Boori
Great job Stephen. Thank for explaining . I got it to work. On Tue, Apr 20, 2010 at 9:21 AM, Stephen Tetley stephen.tet...@gmail.comwrote: Hi If you are working with characteristic functions (Point - Bool or Point - Colour...) the common way to do this is to manufacture a Num instance for

[Haskell-cafe] newbie question how to pass data

2010-04-19 Thread Mujtaba Boori
Hello I am sorry for the silly question. I have a function as the following func:: ((Float,Float) -Bool) - Float - ((Float,Float) - Bool) I am trying to make calculation in this type ((Float,Float) -Bool) with Float and then pass the information to ((Float,Float) - Bool) Thank again

Re: [Haskell-cafe] newbie question how to pass data

2010-04-19 Thread Ozgur Akgun
Can you at least give an example of how you intend to use this func? Since you do not describe it's behaviour, it is very hard to make a useful comment (at least for me) Best, On 19 April 2010 16:54, Mujtaba Boori mujtaba.bo...@gmail.com wrote: Hello I am sorry for the silly question. I

Re: [Haskell-cafe] newbie question how to pass data

2010-04-19 Thread Mujtaba Boori
sorry ok I am trying to make these calculation func (x,y) s dg =((x*(cos dg) - y*(sin dg)),(x*(sin dg) - y*(cos dg))) This work for type (Float - Float) but how can make it work with ((Float - Float) - Bool) because my main function that I want use with. it takes (Float,Float) -Bool) I

Re: [Haskell-cafe] newbie question how to pass data

2010-04-19 Thread Dan Weston
First of all, your function func (x,y) s dg =((x*(cos dg) - y*(sin dg)),(x*(sin dg) - y*(cos dg))) does NOT work for type (Float - Float), unless you mean that that is the type of the unused parameter s. Also, your desired type ((Float - Float) - Bool) itself looks suspicious. It must accept

Re: [Haskell-cafe] newbie question how to pass data

2010-04-19 Thread Mujtaba Boori
Thanks Dan. Great help but my problem has not solved yet This doesn't work for type ((Float - Float)-Bool) to make it easier ignore the rotation and suppose I want just multiplay with whatever (x ,y) and return the result to this type ((Float - Float)-Bool) note this type is shorten and replace