Compare commits

..

1 commit

3 changed files with 10 additions and 5 deletions

View file

@ -29,7 +29,9 @@ executable hannah
, hanafuda , hanafuda
, hanafuda-APILanguage , hanafuda-APILanguage
, mtl , mtl
, network
, text , text
, websockets , websockets
, wuss
hs-source-dirs: src hs-source-dirs: src
default-language: Haskell2010 default-language: Haskell2010

View file

@ -4,11 +4,13 @@ module Config (
, port , port
) where ) where
import Network.Socket (PortNumber)
host :: String host :: String
host = "koikoi.menf.in" host = "koikoi.menf.in"
path :: String path :: String
path = "/play/" path = "/play/"
port :: Int port :: PortNumber
port = 80 port = 443

View file

@ -1,14 +1,15 @@
module Main where module Main where
import Network.WebSockets (ClientApp, runClient) import Automaton (start)
import Control.Monad.Reader (runReaderT) import Control.Monad.Reader (runReaderT)
import Control.Monad.State (runStateT) import Control.Monad.State (runStateT)
import Config (host, port, path) import Config (host, port, path)
import Automaton (start) import Network.WebSockets (ClientApp)
import Wuss (runSecureClient)
bot :: ClientApp () bot :: ClientApp ()
bot connection = runReaderT Automaton.start connection bot connection = runReaderT Automaton.start connection
main :: IO () main :: IO ()
main = main =
runClient host port path bot runSecureClient host port path bot