out :: (MonadIO m) => String -> m ()
out string =
    liftIO $ hPutStrLn stdout string'
  where
    string' =
        if not (null string) && last string == '\n' then init string else string
out :: (MonadIO m) => String -> m ()
out string =
    liftIO $ hPutStrLn stdout string'
  where
    string' =
        if not (null string) && last string == '\n' then init string else string
out string =
    liftIO $ hPutStrLn stdout string'
  where
    string' =
        if not (null string) && last string == '\n' then init string else string