From 1abd79eb6d81482bec63c55994be70ed8188c965 Mon Sep 17 00:00:00 2001 From: Frank Doepper Date: Sat, 7 Dec 2019 17:07:33 +0100 Subject: [PATCH] flexprint default --- Network/AMQP/Utils/Helpers.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Network/AMQP/Utils/Helpers.hs b/Network/AMQP/Utils/Helpers.hs index 66729ba..de07d10 100644 --- a/Network/AMQP/Utils/Helpers.hs +++ b/Network/AMQP/Utils/Helpers.hs @@ -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 -> -- 2.39.5