fork download
  1. floatIO :: Float -> IO Float
  2. floatIO x = x
  3.  
  4. insideSum :: (Float, Float) -> Float
  5. insideSum (a,b) = a + b
  6.  
  7. sumTuple :: [(Float, Float)] -> Float
  8. sumTuple [] = 0
  9. sumTuple (x:xs) = insideSum x + sumTuple xs
  10.  
  11. main = print floatIO insideSum (2.0,1.1)
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:2:12:
    Couldn't match expected type `IO Float'
           against inferred type `Float'
    In the expression: x
    In the definition of `floatIO': floatIO x = x

prog.hs:11:7:
    Couldn't match expected type `((Float, Float) -> Float)
                                  -> (t1, t2)
                                  -> t'
           against inferred type `IO ()'
    In the expression: print floatIO insideSum (2.0, 1.1)
    In the definition of `main':
        main = print floatIO insideSum (2.0, 1.1)
stdout
Standard output is empty