fork(1) download
  1. {-# LANGUAGE FlexibleContexts #-}
  2.  
  3. dist p1 p2 = sqrt (dx*dx + dy*dy)
  4. where
  5. dx = (p1.fst) - (p2.fst)
  6. dy = (p1.snd) - (p2.snd)
  7.  
  8.  
  9. p1 = (1.0,1.0)
  10. p2 = (3.0,3.0)
  11. p3 = (7.0,7.0)
  12.  
  13.  
  14. main = do
  15. print $ (dist p1 p2) + (dist p2 p3) == (dist p1 p3)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:15:17: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the first argument of ‘dist’, namely ‘p1’
      In the first argument of ‘(+)’, namely ‘(dist p1 p2)’
      In the first argument of ‘(==)’, namely
        ‘(dist p1 p2) + (dist p2 p3)’

prog.hs:15:20: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the second argument of ‘dist’, namely ‘p2’
      In the first argument of ‘(+)’, namely ‘(dist p1 p2)’
      In the first argument of ‘(==)’, namely
        ‘(dist p1 p2) + (dist p2 p3)’

prog.hs:15:32: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the first argument of ‘dist’, namely ‘p2’
      In the second argument of ‘(+)’, namely ‘(dist p2 p3)’
      In the first argument of ‘(==)’, namely
        ‘(dist p1 p2) + (dist p2 p3)’

prog.hs:15:35: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the second argument of ‘dist’, namely ‘p3’
      In the second argument of ‘(+)’, namely ‘(dist p2 p3)’
      In the first argument of ‘(==)’, namely
        ‘(dist p1 p2) + (dist p2 p3)’

prog.hs:15:48: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the first argument of ‘dist’, namely ‘p1’
      In the second argument of ‘(==)’, namely ‘(dist p1 p3)’
      In the second argument of ‘($)’, namely
        ‘(dist p1 p2) + (dist p2 p3) == (dist p1 p3)’

prog.hs:15:51: error:
    • Couldn't match expected type ‘a0 -> c0’
                  with actual type ‘(Double, Double)’
    • In the second argument of ‘dist’, namely ‘p3’
      In the second argument of ‘(==)’, namely ‘(dist p1 p3)’
      In the second argument of ‘($)’, namely
        ‘(dist p1 p2) + (dist p2 p3) == (dist p1 p3)’
stdout
Standard output is empty