This is a follow up question to this. I'm using a graphic library in Haskell called Threepenny-GUI. In this library the main function returns a UI monad object. I'm trying to execute a simple print command with no success. What is a right work around to enable printing for debugging purposes.
Code:
main :: IO ()
main = startGUI defaultConfig setup
setup :: Window -> UI ()
setup w = do
print "debug message 1 "
Error:
Couldn't match type ‘IO’ with ‘UI’
Expected type: UI ()
  Actual type: IO ()
In a stmt of a 'do' block: print "labels and values "
				
                        
Based on the types, this is a good application of
liftIO.liftIOhas a typeMonadIO m => IO a -> m aso it can be used like this:The type of that expression can be
UI ()sinceUIis an instance ofMonadIOandprint "debug message 1"has the typeIO ().