fork download
  1. main = do
  2. nombre <- getLine
  3. nota1 <- readNum
  4. nota2 <- readNum
  5. promedio <- (nota1 + nota2) / 2
  6. if promedio >= 60
  7. then
  8. putStr(nombre ++ " ha pasado el curso")
  9. else do
  10. putStr(nombre ++ " no ha pasado el curso")
  11. where
  12. readNum :: IO Float
  13. readNum = do
  14. line <- getLine
  15. readIO line
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Luis
80
90
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:5:14:
    Couldn't match expected type `IO t' against inferred type `Float'
    In a 'do' expression: promedio <- (nota1 + nota2) / 2
    In the expression:
        do nombre <- getLine
           nota1 <- readNum
           nota2 <- readNum
           promedio <- (nota1 + nota2) / 2
           ....
    In the definition of `main':
        main = do nombre <- getLine
                  nota1 <- readNum
                  nota2 <- readNum
                  ....
             where
                 readNum :: IO Float
                 readNum = do line <- getLine
                              ....
stdout
Standard output is empty