import System.IO
import System.Process
--- | log cmdline options
-listToMaybeUnwords :: [String] -> Maybe String
-listToMaybeUnwords [] = Nothing
-listToMaybeUnwords x = Just $ unwords x
-
-- | Strings or ByteStrings with label, oder nothing at all
printwithlabel :: String -> Maybe (IO ()) -> IO ()
printwithlabel _ Nothing = return ()
flexprint = fmap (hPutStrLn stderr)
instance Flexprint (Maybe Int) where
- flexprint = fmap (hPutStrLn stderr . show)
+ flexprint x = flexprint (fmap show x)
instance Flexprint String where
flexprint x = flexprint (Just x)