Reorder modules alphabetically in imports
This commit is contained in:
parent
0778c4a675
commit
c21a8f6512
6 changed files with 32 additions and 32 deletions
|
@ -12,13 +12,13 @@ module App (
|
||||||
, update_
|
, update_
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Map ((!))
|
|
||||||
import Control.Concurrent (MVar, modifyMVar, putMVar, readMVar, takeMVar)
|
import Control.Concurrent (MVar, modifyMVar, putMVar, readMVar, takeMVar)
|
||||||
import Control.Monad.Reader (ReaderT(..), ask, asks, lift)
|
import Control.Monad.Reader (ReaderT(..), ask, asks, lift)
|
||||||
import Network.WebSockets (Connection)
|
import Data.Map ((!))
|
||||||
import Hanafuda.KoiKoi (PlayerID)
|
import Hanafuda.KoiKoi (PlayerID)
|
||||||
import qualified Session (T(..))
|
import Network.WebSockets (Connection)
|
||||||
import qualified Server (T(..))
|
import qualified Server (T(..))
|
||||||
|
import qualified Session (T(..))
|
||||||
|
|
||||||
data Context = Context {
|
data Context = Context {
|
||||||
mServer :: MVar Server.T
|
mServer :: MVar Server.T
|
||||||
|
|
|
@ -3,20 +3,20 @@ module Automaton (
|
||||||
start
|
start
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import qualified App (Context(..), T, current, debug, get, server, try, update_)
|
||||||
import Control.Monad.Reader (asks)
|
import Control.Monad.Reader (asks)
|
||||||
import qualified RW (RW(..))
|
|
||||||
import Data.Map (Map, (!?))
|
import Data.Map (Map, (!?))
|
||||||
import qualified Game (new, play)
|
import qualified Game (new, play)
|
||||||
import qualified Hanafuda.KoiKoi as KoiKoi (
|
import qualified Hanafuda.KoiKoi as KoiKoi (
|
||||||
Game, GameBlueprint(..), GameID, Step(..)
|
Game, GameBlueprint(..), GameID, Step(..)
|
||||||
)
|
)
|
||||||
import qualified Session (Status(..), T(..), Update)
|
|
||||||
import qualified Server (endGame, get, logIn, logOut, update, room)
|
|
||||||
import qualified App (Context(..), T, current, debug, get, server, try, update_)
|
|
||||||
import qualified Hanafuda.Message as Message (FromClient(..), T(..))
|
import qualified Hanafuda.Message as Message (FromClient(..), T(..))
|
||||||
import qualified Messaging (
|
import qualified Messaging (
|
||||||
broadcast, get, notifyPlayers, relay, send, sendTo, update
|
broadcast, get, notifyPlayers, relay, send, sendTo, update
|
||||||
)
|
)
|
||||||
|
import qualified RW (RW(..))
|
||||||
|
import qualified Server (endGame, get, logIn, logOut, update, room)
|
||||||
|
import qualified Session (Status(..), T(..), Update)
|
||||||
|
|
||||||
receive :: Session.Status -> Message.FromClient -> App.T ()
|
receive :: Session.Status -> Message.FromClient -> App.T ()
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@ import Control.Monad.Reader (lift)
|
||||||
import Control.Monad.Writer (runWriterT)
|
import Control.Monad.Writer (runWriterT)
|
||||||
import Data.Map (mapWithKey)
|
import Data.Map (mapWithKey)
|
||||||
import qualified Hanafuda (empty)
|
import qualified Hanafuda (empty)
|
||||||
|
import Hanafuda.KoiKoi (Game, GameBlueprint(..), GameID, Mode(..), PlayerID)
|
||||||
import qualified Hanafuda.KoiKoi as KoiKoi (
|
import qualified Hanafuda.KoiKoi as KoiKoi (
|
||||||
Action, Move(..), play, new
|
Action, Move(..), play, new
|
||||||
)
|
)
|
||||||
import Hanafuda.KoiKoi (Game, GameBlueprint(..), GameID, Mode(..), PlayerID)
|
|
||||||
import qualified Hanafuda.Player (Player(..), Players(..))
|
|
||||||
import Hanafuda.Message (PublicGame)
|
import Hanafuda.Message (PublicGame)
|
||||||
|
import qualified Hanafuda.Player (Player(..), Players(..))
|
||||||
import qualified Server (register)
|
import qualified Server (register)
|
||||||
|
|
||||||
new :: (PlayerID, PlayerID) -> App.T GameID
|
new :: (PlayerID, PlayerID) -> App.T GameID
|
||||||
|
|
22
src/Main.hs
22
src/Main.hs
|
@ -2,21 +2,21 @@
|
||||||
{-# LANGUAGE NamedFieldPuns #-}
|
{-# LANGUAGE NamedFieldPuns #-}
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Network.Wai.Handler.Warp (run)
|
import qualified App (Context(..), T, update_)
|
||||||
import Network.HTTP.Types.Status (badRequest400)
|
import qualified Automaton (start)
|
||||||
import Network.WebSockets (ServerApp, acceptRequest, defaultConnectionOptions)
|
import qualified Config (listenPort)
|
||||||
import Network.Wai.Handler.WebSockets (websocketsOr)
|
|
||||||
import Network.Wai (responseLBS)
|
|
||||||
import Control.Monad.Reader (ReaderT(..), asks)
|
|
||||||
import Control.Concurrent (newMVar, modifyMVar)
|
import Control.Concurrent (newMVar, modifyMVar)
|
||||||
import Control.Exception (finally)
|
import Control.Exception (finally)
|
||||||
import qualified Config (listenPort)
|
import Control.Monad.Reader (ReaderT(..), asks)
|
||||||
import qualified Session (open)
|
|
||||||
import qualified Server (disconnect, new, register)
|
|
||||||
import qualified App (Context(..), T, update_)
|
|
||||||
import qualified Hanafuda.Message as Message (FromClient(..))
|
import qualified Hanafuda.Message as Message (FromClient(..))
|
||||||
import Messaging (broadcast, relay)
|
import Messaging (broadcast, relay)
|
||||||
import qualified Automaton (start)
|
import Network.HTTP.Types.Status (badRequest400)
|
||||||
|
import Network.Wai (responseLBS)
|
||||||
|
import Network.Wai.Handler.Warp (run)
|
||||||
|
import Network.Wai.Handler.WebSockets (websocketsOr)
|
||||||
|
import Network.WebSockets (ServerApp, acceptRequest, defaultConnectionOptions)
|
||||||
|
import qualified Server (disconnect, new, register)
|
||||||
|
import qualified Session (open)
|
||||||
|
|
||||||
exit :: App.T ()
|
exit :: App.T ()
|
||||||
exit = do
|
exit = do
|
||||||
|
|
|
@ -13,20 +13,20 @@ module Messaging (
|
||||||
, update
|
, update
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.List (intercalate)
|
|
||||||
import Data.Foldable (forM_)
|
|
||||||
import Data.Map (keys)
|
|
||||||
import Data.Aeson (eitherDecode', encode)
|
|
||||||
import Network.WebSockets (receiveData, sendTextData)
|
|
||||||
import Data.ByteString.Lazy.Char8 (unpack)
|
|
||||||
import Control.Monad.Reader (asks, lift)
|
|
||||||
import qualified Game (export)
|
|
||||||
import qualified Session (T(..))
|
|
||||||
import qualified Server (T(..), get)
|
|
||||||
import qualified App (Context(..), T, connection, debug, server)
|
import qualified App (Context(..), T, connection, debug, server)
|
||||||
|
import Control.Monad.Reader (asks, lift)
|
||||||
|
import Data.Aeson (eitherDecode', encode)
|
||||||
|
import Data.ByteString.Lazy.Char8 (unpack)
|
||||||
|
import Data.Foldable (forM_)
|
||||||
|
import Data.List (intercalate)
|
||||||
|
import Data.Map (keys)
|
||||||
import qualified Hanafuda.KoiKoi as KoiKoi (Action, Game, GameBlueprint(..), PlayerID)
|
import qualified Hanafuda.KoiKoi as KoiKoi (Action, Game, GameBlueprint(..), PlayerID)
|
||||||
import qualified Hanafuda.Message as Message (T)
|
|
||||||
import Hanafuda.Message (FromClient(..), T(..))
|
import Hanafuda.Message (FromClient(..), T(..))
|
||||||
|
import qualified Hanafuda.Message as Message (T)
|
||||||
|
import Network.WebSockets (receiveData, sendTextData)
|
||||||
|
import qualified Game (export)
|
||||||
|
import qualified Server (T(..), get)
|
||||||
|
import qualified Session (T(..))
|
||||||
|
|
||||||
sendTo :: [KoiKoi.PlayerID] -> Message.T -> App.T ()
|
sendTo :: [KoiKoi.PlayerID] -> Message.T -> App.T ()
|
||||||
sendTo playerIDs obj = do
|
sendTo playerIDs obj = do
|
||||||
|
|
|
@ -7,8 +7,8 @@ module Session (
|
||||||
, open
|
, open
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Network.WebSockets (Connection)
|
|
||||||
import Hanafuda.KoiKoi (GameID, PlayerID)
|
import Hanafuda.KoiKoi (GameID, PlayerID)
|
||||||
|
import Network.WebSockets (Connection)
|
||||||
import qualified RW (RW(..))
|
import qualified RW (RW(..))
|
||||||
|
|
||||||
data Status =
|
data Status =
|
||||||
|
|
Loading…
Reference in a new issue