
9 Apr
2014
9 Apr
'14
2:20 a.m.
Hello Alexej
Il 09/apr/2014 08:03 "Alexej Magura"
K, so I have a function that I’m writing that takes a *string* and a
*count* and prints the *string* to STDOUT *count* times:
displayD :: IO () -> String -> Int displayD string count = do (count > 0) && hPutStr stdout string (count > 0) && displayD string (count - 1)
At glance at least one of your errors comes from your type signature being incorrect. Your function should takes first a String then an Int and should return an IO () because you're printing stuff. So: displayD :: IO () -> String -> Int should become: displayD :: String -> Int -> IO () Regards, Nadir