Browse Source

fix indentation

master
opfez 9 months ago
parent
commit
00c8f6d5d9
  1. 10
      Anna.hs

10
Anna.hs

@ -13,7 +13,7 @@ import Control.Monad.Trans.Reader @@ -13,7 +13,7 @@ import Control.Monad.Trans.Reader
hostname = "127.0.0.1"
port = 6667
name = "anna"
channels = ["#foo", "#bots"]
channels = ["#tildetown", "#bots"]
data Bot = Bot { socket :: Handle }
type Net = ReaderT Bot IO
@ -142,7 +142,7 @@ pong = write "PONG" $ ":" ++ name ++ "\r\n" @@ -142,7 +142,7 @@ pong = write "PONG" $ ":" ++ name ++ "\r\n"
-- Connect to a server given its name and port number
connectTo :: N.HostName -> N.PortNumber -> IO Handle
connectTo host port = do
addr : _ <- N.getAddrInfo Nothing (Just host) (Just (show port))
sock <- N.socket (N.addrFamily addr) (N.addrSocketType addr) (N.addrProtocol addr)
N.connect sock (N.addrAddress addr)
N.socketToHandle sock ReadWriteMode
addr : _ <- N.getAddrInfo Nothing (Just host) (Just (show port))
sock <- N.socket (N.addrFamily addr) (N.addrSocketType addr) (N.addrProtocol addr)
N.connect sock (N.addrAddress addr)
N.socketToHandle sock ReadWriteMode

Loading…
Cancel
Save