packages feed

pong-server 0.0.1.0 → 0.0.2.0

raw patch · 2 files changed

+6/−6 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Axial.Pong: PongConfig :: Int -> (() -> IO String) -> PongConfig
+ Axial.Pong: PongConfig :: Int -> IO String -> PongConfig
- Axial.Pong: [pongMessage] :: PongConfig -> () -> IO String
+ Axial.Pong: [pongMessage] :: PongConfig -> IO String

Files

pong-server.cabal view
@@ -1,7 +1,7 @@ name:                pong-server-version:             0.0.1.0+version:             0.0.2.0 synopsis:            A simple embedded pingable server that runs in the background.-description:         Please see README.md+description:         Please see README.md on GitHub homepage:            http://github.com/RobertFischer/pong-server#readme license:             PublicDomain license-file:        UNLICENSE@@ -19,7 +19,7 @@   build-depends:       base >= 4.7 && < 5                      , network >= 2.6.2.1 && < 2.7   default-language:    Haskell2010-  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N+  ghc-options:         -Wall -rtsopts -with-rtsopts=-N   default-extensions:  OverloadedStrings                     ,  LambdaCase                     ,  MultiWayIf
src/Axial/Pong.hs view
@@ -12,13 +12,13 @@  data PongConfig = PongConfig {   pongPort :: Int,-  pongMessage :: () -> IO String+  pongMessage :: IO String }  newtype PongServer = PongServer ThreadId  defaultPongConfig :: PongConfig-defaultPongConfig = PongConfig 10411 $ const $ pure "pong"+defaultPongConfig = PongConfig 10411 $ pure "pong"  withPongServer :: PongConfig -> IO a -> IO a withPongServer cfg action = bracket (startServer cfg) stopServer $ const action@@ -35,7 +35,7 @@       _ <- forkFinally (body handle) (const $ hClose handle)       socketHandlerLoop sock     body handle = do-      msg <- (pongMessage cfg) ()+      msg <- (pongMessage cfg)       hSetBuffering handle NoBuffering       hPutStr handle msg     portNum = PortNumber $ fromIntegral pongPortNum