From c3222acc2a404f5f0b77fde7e1c7bceb133e4080 Mon Sep 17 00:00:00 2001 From: Philipp Balzarek Date: Mon, 18 Feb 2013 18:04:28 +0100 Subject: [PATCH] replace isJust / fromJust with case --- source/Network/Xmpp/Session.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/Network/Xmpp/Session.hs b/source/Network/Xmpp/Session.hs index 3b491fe..3378468 100644 --- a/source/Network/Xmpp/Session.hs +++ b/source/Network/Xmpp/Session.hs @@ -43,12 +43,12 @@ session :: HostName -- ^ Host to connect to -> IO (Either XmppFailure (Session, Maybe AuthFailure)) session hostname realm port tls sasl = runErrorT $ do con <- ErrorT $ connect hostname port realm - if isJust tls - then ErrorT $ startTls (fromJust tls) con - else return () - aut <- if isJust sasl - then ErrorT $ auth (fst $ fromJust sasl) (snd $ fromJust sasl) con - else return Nothing + case tls of + Just tls' -> ErrorT $ startTls tls' con + Nothing -> return () + aut <- case sasl of + Just sasl' -> ErrorT $ auth (fst sasl) (snd sasl) con + Nothing -> return Nothing ses <- ErrorT $ newSession con return (ses, aut)