From e3ea039428545e185b38c5633fe3576ab32f1f8e Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 16 Jan 2025 19:22:18 -0800 Subject: Cleans excessive type annotations --- hsm-core/Hsm/Core/Zmq/Server.hs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'hsm-core/Hsm/Core/Zmq/Server.hs') diff --git a/hsm-core/Hsm/Core/Zmq/Server.hs b/hsm-core/Hsm/Core/Zmq/Server.hs index 5663cd8..2e9217b 100644 --- a/hsm-core/Hsm/Core/Zmq/Server.hs +++ b/hsm-core/Hsm/Core/Zmq/Server.hs @@ -47,7 +47,6 @@ send :: -> Eff es () send = S.fold S.drain . S.mapM sender where - sender :: a -> Eff es () sender payload = do Server sock <- E.getStaticRep env <- ask @env @@ -64,18 +63,12 @@ runServer :: ) => Eff (Server : es) a -> Eff es a -runServer action = withSocket Z.Pub >>= run - where - run :: Z.Socket Z.Pub -> Eff es a - run sock = E.evalStaticRep (Server sock) $ initialize >> action - where - bind :: Text -> Eff (Server : es) () - bind = E.unsafeEff_ . Z.bind sock . unpack - -- - initialize :: Eff (Server : es) () - initialize = - localDomain domain $ do - logInfo_ "Initializing ZMQ server" - env <- ask @env - bind env.pubEp - logTrace_ $ "Publishing to " <> env.pubEp +runServer action = + withSocket Z.Pub >>= \sock -> + E.evalStaticRep (Server sock) $ do + localDomain domain $ do + logInfo_ "Initializing ZMQ server" + env <- ask @env + E.unsafeEff_ $ Z.bind sock $ unpack env.pubEp + logTrace_ $ "Publishing to " <> env.pubEp + action -- cgit v1.2.1