Difference between print and putStrLn in Haskell
问题 I am confused. I tried to use print , but I know people apply putStrLn . What are the real differences between them? print $ function putStrLn $ function 回答1: The function putStrLn takes a String and displays it to the screen, followed by a newline character ( put a Str ing followed by a new L i n e). Because it only works with String s, a common idiom is to take any object, convert it to a String , and then apply putStrLn to display it. The generic way to convert an object to a String is