you should do :

main = print $ center (1,2), (3, 4)


On Sat, May 10, 2014 at 1:51 PM, Roelof Wobben <r.wobben@home.nl> wrote:
Hello,

I have to find the center of 2 points as a assigment for a course on fpcomplete. This is no homework because I do a self-study. 

So I did  this:

center (x1,y1) (x2,y2) = ( ((x1+x2)/2),((y1+y2)/2) )
main = print $ center ((1,2), (3, 4))

but now I see this error message :
 
Main.hs@2:8-2:13
  • No instance for (Show (((t0, t1), (t2, t3)) -> ((t0, t1), (t2, t3)))) arising from a use of `print' Possible fix: add an instance declaration for (Show (((t0, t1), (t2, t3)) -> ((t0, t1), (t2, t3)))) In the expression: print In the expression: print $ center ((1, 2), (3, 4)) In an equation for `main': main = print $ center ((1, 2), (3, 4))
Roelof


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe