[Haskell-cafe] what did I do wrong
Osager Prairie
osagerprairie at gmail.com
Sat May 10 12:04:11 UTC 2014
you should do :
main = print $ center (1,2), (3, 4)
On Sat, May 10, 2014 at 1:51 PM, Roelof Wobben <r.wobben at 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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140510/0e45d127/attachment.html>
More information about the Haskell-Cafe
mailing list