]> woffs.de Git - fd/haskell-amqp-utils.git/commitdiff
flexprint default
authorFrank Doepper <[email protected]>
Sat, 7 Dec 2019 16:07:33 +0000 (17:07 +0100)
committerFrank Doepper <[email protected]>
Sat, 7 Dec 2019 16:07:33 +0000 (17:07 +0100)
Network/AMQP/Utils/Helpers.hs

index 66729babfe83f45f097fb8d63aff61be91250ae5..de07d1002360db3691b693a786c8d5bfe0db8341 100644 (file)
@@ -19,15 +19,14 @@ import System.Process
 
 class Flexprint a where
   flexprint :: a -> IO ()
+  flexprint _ = return ()
   printparam :: String -> a -> IO ()
-  printparam labl x = do
-    mapM_ (hPutStr stderr) [" --- ", labl, ": "]
+  printparam label x = do
+    mapM_ (hPutStr stderr) [" --- ", label, ": "]
     flexprint x
     hFlush stderr
 
 instance (Flexprint a) => Flexprint (Maybe a) where
-  flexprint Nothing = return ()
-  flexprint (Just x) = flexprint x
   printparam _ Nothing = return ()
   printparam x (Just y) = printparam x y
 
@@ -40,7 +39,7 @@ instance Flexprint [String] where
 instance Flexprint Bool where
   flexprint = flexprint . show
 
-instance  Flexprint Int where
+instance Flexprint Int where
   flexprint = flexprint . show
 
 instance Flexprint T.Text where
@@ -218,7 +217,7 @@ optionalFileStuff (msg, envi) callbackoptions addi numstring a tid action = do
           (constructCallbackCmdLine callbackoptions addi numstring)
           (fileProcess a)
           path
-  printparam "calling" $ fmap unwords callbackcmdline
+  printparam "calling" callbackcmdline
   maybe
     (acke envi a)
     (\c ->
don't click here