I wrote a function returning the current screen width as IO Integer (working so far).
getScreenWidth:: IO Integer
getScreenWidth = do
(sx, sy, w, h) <- getScreenDim 0
return $ sx
Now I would like to add the screen width to a string:
> magic_function :: IO Integer -> String -> ... magic output type
> magic_function = ... ? this is where i am stack at ? ...
I would like to pass the magic function to a string, something like "Screen Width: " and i want it to add the current screen width, so that i get "Screen Width: 1680". How can i concat an IO Integer and a common String? Does it work with show
?
Could anyone help me with that?