Haskell : concat two IO Strings

Viewed 3785

Today I have tried to concat two IO Strings and couldn't get it work.

So, the problem is: suppose we have s1 :: IO String and s2 :: IO String. How to implement function (+++) :: IO String -> IO String -> IO String, which works exactly as (++) :: [a] -> [a] -> [a] but for IO String?

And more general question is how to implement more general function (+++) :: IO a -> IO a -> IO a? Or maybe even more general?

4 Answers
Related