dist (x1 y1) (x2 y2) = sqrt (dx*dx + dy*dy) where dx = x1- x2 dy = y1 - y2 p1 = (1,1)p2 = (3,3)p3 = (7,7) main = do print $ (dist p1 p2) + (dist p2 p3) == (dist p1 p3)
Standard input is empty
[1 of 1] Compiling Main ( prog.hs, prog.o ) prog.hs:2:7: error: Parse error in pattern: x1
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!