import System.IO
import System.Process
-class Flexprint a where
+class (Show a) =>
+ Flexprint a
+ where
flexprint :: a -> IO ()
- flexprint _ = return ()
+ flexprint = (hPutStrLn stderr) . show
printparam :: String -> a -> IO ()
printparam label x = do
mapM_ (hPutStr stderr) [" --- ", label, ": "]
instance Flexprint [String] where
flexprint = flexprint . unwords
-instance Flexprint Bool where
- flexprint = flexprint . show
-
-instance Flexprint Int where
- flexprint = flexprint . show
-
instance Flexprint T.Text where
flexprint = flexprint . T.unpack
instance Flexprint BL.ByteString where
flexprint x = hPutStrLn stderr "" >> BL.hPut stderr x >> hPutStrLn stderr ""
-instance Flexprint ExitCode where
- flexprint = flexprint . show
+instance Flexprint Bool
+
+instance Flexprint Int
+
+instance Flexprint ExitCode
-- | log marker
hr :: String -> IO ()