From 6f87525d0b6c6ce3ae397b84bc237de92c805b33 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 17 Jun 2013 16:59:40 -0400 Subject: Switched to default putStrLn --- Presence/ByteStringOperators.hs | 2 ++ Presence/main.hs | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'Presence') diff --git a/Presence/ByteStringOperators.hs b/Presence/ByteStringOperators.hs index 8ecb214b..26b64bcf 100644 --- a/Presence/ByteStringOperators.hs +++ b/Presence/ByteStringOperators.hs @@ -16,3 +16,5 @@ infixr 5 <.++> infixr 5 <++> infixr 5 <++.> +bshow :: Show a => a -> ByteString +bshow = L.pack . show diff --git a/Presence/main.hs b/Presence/main.hs index f0bc39f5..dd6bfb2e 100644 --- a/Presence/main.hs +++ b/Presence/main.hs @@ -28,11 +28,15 @@ import Data.HList import Network.Socket (sClose) import Control.Exception import LocalPeerCred -import ByteStringOperators -import qualified Data.ByteString.Lazy.Char8 as L import System.Posix.User import qualified Data.Set as Set -import Data.Set (Set) +import Data.Set (Set) + +import ByteStringOperators +import qualified Data.ByteString.Lazy.Char8 as L +import Data.ByteString.Lazy.Char8 as L (putStrLn) +import qualified Prelude +import Prelude hiding (putStrLn) jid user host rsrc = user <++> "@" <++> host <++> "/" <++> rsrc @@ -63,7 +67,7 @@ instance XMPPSession UnixSession where data XMPPClass UnixSession = UnixSessions newSession _ sock handle = do muid <- getLocalPeerCred sock - putStrLn $ "SESSION: open " ++ show muid + L.putStrLn $ "SESSION: open " <++> bshow muid uid_ref <- newIORef muid res_ref <- newIORef Nothing return $ UnixSession uid_ref res_ref @@ -87,10 +91,10 @@ instance XMPPSession UnixSession where jid = user <++> "@" <++> L.pack host <++> suf L.putStrLn $ "SESSION: jid " <++> jid return jid - closeSession _ = putStrLn "SESSION: close" + closeSession _ = L.putStrLn "SESSION: close" on_chvt vtnum = do - putStrLn $ "changed vt to "++ show vtnum + L.putStrLn $ "changed vt to " <++> bshow vtnum start :: IO () start = do @@ -142,11 +146,11 @@ getStartupAction (p:ps) = do where onEr (SomeException _) = do pid <- getProcessID - putStrLn $ "starting pid = "++show pid + putStrLn $ "starting pid = " <++> bshow pid handle (\(SomeException _) -> getStartupAction ps) (do writeFile p (show pid) - putStrLn $ "writing "++show p + putStrLn $ "writing " <++> bshow p -- start daemon return (Right p) ) -- cgit v1.2.3