fork download
  1. sumTuple :: [(Float, Float)] -> Float
  2. sumTuple [] = 0
  3. sumTuple x = insideSum head x + sumTuple tail x
  4.  
  5. insideSum :: (Float, Float) -> Float
  6. insideSum x = head x + tail x
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
sumTuple [(1.7,6.0),(4.3,-1.0),(9.1, 0.0)]
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:1:0: The function `main' is not defined in module `Main'

prog.hs:3:23:
    Couldn't match expected type `(Float, Float)'
           against inferred type `[a] -> a'
    In the first argument of `insideSum', namely `head'
    In the first argument of `(+)', namely `insideSum head x'
    In the expression: insideSum head x + sumTuple tail x

prog.hs:6:19:
    Couldn't match expected type `[a]'
           against inferred type `(Float, Float)'
    In the first argument of `head', namely `x'
    In the first argument of `(+)', namely `head x'
    In the expression: head x + tail x
stdout
Standard output is empty