reflex-backend-socket 0.2.0.0 → 0.2.0.1
raw patch · 5 files changed
+46/−41 lines, 5 filesdep −reflex-basic-hostdep ~basedep ~bytestringdep ~lensnew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: reflex-basic-host
Dependency ranges changed: base, bytestring, lens, mtl, network, reflex, semialign, these, witherable
API changes (from Hackage documentation)
- Reflex.Backend.Socket: sClose :: forall t_attD. Lens' (Socket t_attD) (Event t_attD ())
+ Reflex.Backend.Socket: sClose :: forall t_aiHJ. Lens' (Socket t_aiHJ) (Event t_aiHJ ())
- Reflex.Backend.Socket: sError :: forall t_attD. Lens' (Socket t_attD) (Event t_attD IOException)
+ Reflex.Backend.Socket: sError :: forall t_aiHJ. Lens' (Socket t_aiHJ) (Event t_aiHJ IOException)
- Reflex.Backend.Socket: sOpen :: forall t_attD. Lens' (Socket t_attD) (Event t_attD ())
+ Reflex.Backend.Socket: sOpen :: forall t_aiHJ. Lens' (Socket t_aiHJ) (Event t_aiHJ ())
- Reflex.Backend.Socket: sReceive :: forall t_attD. Lens' (Socket t_attD) (Event t_attD ByteString)
+ Reflex.Backend.Socket: sReceive :: forall t_aiHJ. Lens' (Socket t_aiHJ) (Event t_aiHJ ByteString)
- Reflex.Backend.Socket: scClose :: forall t_atnW. Lens' (SocketConfig t_atnW) (Event t_atnW ())
+ Reflex.Backend.Socket: scClose :: forall t_aiEN. Lens' (SocketConfig t_aiEN) (Event t_aiEN ())
- Reflex.Backend.Socket: scInitSocket :: forall t_atnW. Lens' (SocketConfig t_atnW) Socket
+ Reflex.Backend.Socket: scInitSocket :: forall t_aiEN. Lens' (SocketConfig t_aiEN) Socket
- Reflex.Backend.Socket: scMaxRx :: forall t_atnW. Lens' (SocketConfig t_atnW) Int
+ Reflex.Backend.Socket: scMaxRx :: forall t_aiEN. Lens' (SocketConfig t_aiEN) Int
- Reflex.Backend.Socket: scSend :: forall t_atnW. Lens' (SocketConfig t_atnW) (Event t_atnW ByteString)
+ Reflex.Backend.Socket: scSend :: forall t_aiEN. Lens' (SocketConfig t_aiEN) (Event t_aiEN ByteString)
- Reflex.Backend.Socket.Accept: aAcceptSocket :: forall t_apPK. Lens' (Accept t_apPK) (Event t_apPK (Socket, SockAddr))
+ Reflex.Backend.Socket.Accept: aAcceptSocket :: forall t_agjO. Lens' (Accept t_agjO) (Event t_agjO (Socket, SockAddr))
- Reflex.Backend.Socket.Accept: aClose :: forall t_apPK. Lens' (Accept t_apPK) (Event t_apPK ())
+ Reflex.Backend.Socket.Accept: aClose :: forall t_agjO. Lens' (Accept t_agjO) (Event t_agjO ())
- Reflex.Backend.Socket.Accept: aError :: forall t_apPK. Lens' (Accept t_apPK) (Event t_apPK IOException)
+ Reflex.Backend.Socket.Accept: aError :: forall t_agjO. Lens' (Accept t_agjO) (Event t_agjO IOException)
- Reflex.Backend.Socket.Accept: acClose :: forall t_apLu t_apP0. Lens (AcceptConfig t_apLu) (AcceptConfig t_apP0) (Event t_apLu ()) (Event t_apP0 ())
+ Reflex.Backend.Socket.Accept: acClose :: forall t_agh1 t_agj4. Lens (AcceptConfig t_agh1) (AcceptConfig t_agj4) (Event t_agh1 ()) (Event t_agj4 ())
- Reflex.Backend.Socket.Accept: acHostname :: forall t_apLu. Lens' (AcceptConfig t_apLu) (Maybe HostName)
+ Reflex.Backend.Socket.Accept: acHostname :: forall t_agh1. Lens' (AcceptConfig t_agh1) (Maybe HostName)
- Reflex.Backend.Socket.Accept: acListenQueue :: forall t_apLu. Lens' (AcceptConfig t_apLu) Int
+ Reflex.Backend.Socket.Accept: acListenQueue :: forall t_agh1. Lens' (AcceptConfig t_agh1) Int
- Reflex.Backend.Socket.Accept: acService :: forall t_apLu. Lens' (AcceptConfig t_apLu) (Maybe ServiceName)
+ Reflex.Backend.Socket.Accept: acService :: forall t_agh1. Lens' (AcceptConfig t_agh1) (Maybe ServiceName)
- Reflex.Backend.Socket.Accept: acSocketOptions :: forall t_apLu. Lens' (AcceptConfig t_apLu) [(SocketOption, Int)]
+ Reflex.Backend.Socket.Accept: acSocketOptions :: forall t_agh1. Lens' (AcceptConfig t_agh1) [(SocketOption, Int)]
Files
- ChangeLog.md +6/−0
- example/Client.hs +3/−3
- example/Others.hs +7/−7
- example/Server.hs +4/−4
- reflex-backend-socket.cabal +26/−27
ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for reflex-backend-socket +## 0.2.0.1 -- 2022-05-21++* Raised some upper bounds+* Examples now use `Reflex.Host.Headless` from `reflex` instead of+ `reflex-basic-host`.+ ## 0.2.0.0 -- 2019-10-29 (first hackage release) * Decoupled reflex-binary from this library. If you want incremental
example/Client.hs view
@@ -5,7 +5,7 @@ {-| Copyright : (c) 2018-2019, Commonwealth Scientific and Industrial Research Organisation License : BSD3-Maintainer : dave.laing.80@gmail.com, jack.kelly@data61.csiro.au+Maintainer : dave.laing.80@gmail.com, jack@jackkelly.name Stability : experimental Portability : non-portable -}@@ -20,7 +20,7 @@ import qualified Network.Socket as NS import Reflex import Reflex.Backend.Socket-import Reflex.Host.Basic+import Reflex.Host.Headless import Reflex.Workflow type ClientCxt t m =@@ -54,6 +54,6 @@ pure (eQuit, unconnected <$ eQuit) main :: IO ()-main = basicHostWithQuit $ do+main = runHeadlessApp $ do deQuit <- workflow unconnected pure (switchDyn deQuit)
example/Others.hs view
@@ -8,7 +8,7 @@ {-| Copyright : (c) 2018-2019, Commonwealth Scientific and Industrial Research Organisation License : BSD3-Maintainer : dave.laing.80@gmail.com, jack.kelly@data61.csiro.au+Maintainer : dave.laing.80@gmail.com, jack@jackkelly.name Stability : experimental Portability : non-portable -}@@ -19,17 +19,17 @@ import qualified Data.ByteString.Char8 as BC import Data.Functor ((<&>), void) import Data.Maybe (isNothing)-import Data.Witherable (catMaybes) import qualified Network.Socket as NS import Reflex import Reflex.Backend.Socket-import Reflex.Host.Basic (basicHostForever, basicHostWithQuit)+import Reflex.Host.Headless import Reflex.Network (networkHold) import System.Environment (getArgs)+import Witherable (catMaybes) -- | Connect to a remote host, and quit as soon as something happens. connect1 :: IO ()-connect1 = basicHostWithQuit $ do+connect1 = runHeadlessApp $ do eQuit <- connect (Just "127.0.0.1") "9000" let (eError, eConnect) = fanEither eQuit @@ -41,7 +41,7 @@ -- | Listen for connections, and log them as they come in. Does -- nothing with arriving connections, so will leak FDs. accept1 :: IO ()-accept1 = basicHostForever $ do+accept1 = runHeadlessApp $ do (eListenError, eAccept) <- fanEither <$> accept (AcceptConfig (Just "127.0.0.1") (Just "9000") 1 [(NS.ReuseAddr, 1)] never) @@ -55,12 +55,12 @@ performEvent_ $ (liftIO . putStrLn $ "Connected") <$ eNewClient performEvent_ $ liftIO . print <$> eAcceptError - pure ()+ pure never -- | Connect to a remote host. When the connection succeeds, put the -- @'Socket' t@ into @dSocket@, send a message, then close. connect2 :: IO ()-connect2 = basicHostWithQuit $ mdo+connect2 = runHeadlessApp $ mdo (eConnError, eConnect) <- fanEither <$> connect (Just "127.0.0.1") "9000" performEvent_ $ (liftIO . putStrLn $ "Connected") <$ eConnect
example/Server.hs view
@@ -9,7 +9,7 @@ {-| Copyright : (c) 2018-2019, Commonwealth Scientific and Industrial Research Organisation License : BSD3-Maintainer : dave.laing.80@gmail.com, jack.kelly@data61.csiro.au+Maintainer : dave.laing.80@gmail.com, jack@jackkelly.name Stability : experimental Portability : non-portable -}@@ -30,7 +30,7 @@ import qualified Network.Socket as NS import Reflex import Reflex.Backend.Socket-import Reflex.Host.Basic+import Reflex.Host.Headless import System.IO.Error type ServerCxt t m =@@ -62,7 +62,7 @@ pure (eOut, eShutdown, _sClose so) -go :: forall t m. BasicGuestConstraints t m => BasicGuest t m (Event t ())+go :: forall t m. MonadHeadlessApp t m => m (Event t ()) go = mdo (eListenError, eAccept) <- fanEither <$> accept (AcceptConfig (Just "127.0.0.1") (Just "9000") 1 [(NS.ReuseAddr, 1)] eQuit)@@ -121,4 +121,4 @@ pure eQuit main :: IO ()-main = basicHostWithQuit go+main = runHeadlessApp go
reflex-backend-socket.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: reflex-backend-socket-version: 0.2.0.0+version: 0.2.0.1 synopsis: Reflex bindings for TCP sockets description: <<https://raw.githubusercontent.com/qfpl/assets/master/data61-transparent-bg.png>>@@ -23,9 +23,11 @@ license: BSD3 license-file: LICENSE author: Dave Laing-maintainer: dave.laing.80@gmail.com, jack.kelly@data61.csiro.au+maintainer: dave.laing.80@gmail.com, jack@jackkelly.name+homepage: https://github.com/qfpl/reflex-backend-socket/+bug-reports: https://github.com/qfpl/reflex-backend-socket/issues copyright: (c) 2018-2019, Commonwealth Scientific and Industrial Research Organisation-category: Network+category: FRP, Network build-type: Simple extra-source-files: ChangeLog.md cabal-version: >=1.10@@ -40,42 +42,40 @@ , Reflex.Backend.Socket.Accept , Reflex.Backend.Socket.Connect , Reflex.Backend.Socket.Error- build-depends: base >= 4.12 && < 4.13- , bytestring >= 0.10 && < 0.11- , lens >= 4.15.4 && < 4.19- , mtl >= 2.2 && < 2.3+ build-depends: base >= 4.12 && < 4.16+ , bytestring >= 0.10 && < 0.12+ , lens >= 4.15.4 && < 4.20 || >= 5 && <5.2+ , mtl >= 2.2 && < 2.4 , network >= 2.6 && < 3.2- , reflex >= 0.5 && < 0.7- , semialign >= 1 && < 1.2+ , reflex >= 0.7.1.0 && < 0.9+ , semialign >= 1 && < 1.3 , semigroupoids >= 5.2.2 && < 5.4 , stm >= 2.4 && < 2.6- , these >= 1 && < 1.1+ , these >= 1 && < 1.2 hs-source-dirs: src ghc-options: -Wall default-language: Haskell2010 executable example-server main-is: Server.hs- build-depends: base >= 4.12 && < 4.13- , bytestring >= 0.10 && < 0.11+ build-depends: base+ , bytestring , containers >= 0.5 && < 0.7- , lens >= 4.15.4 && < 4.19- , network >= 2.6 && < 3.2- , reflex >= 0.5 && < 0.7+ , lens+ , network+ , reflex , reflex-backend-socket- , reflex-basic-host >= 0.2 && < 0.3 hs-source-dirs: example ghc-options: -Wall -threaded default-language: Haskell2010 executable example-client main-is: Client.hs- build-depends: base >= 4.12 && < 4.13- , bytestring >= 0.10 && < 0.11- , network >= 2.6 && < 3.2- , reflex >= 0.5 && < 0.7+ build-depends: base+ , bytestring+ , network+ , reflex , reflex-backend-socket- , reflex-basic-host >= 0.2 && < 0.3 hs-source-dirs: example ghc-options: -Wall -threaded default-language: Haskell2010@@ -83,13 +83,12 @@ executable example-others main-is: Others.hs- build-depends: base >= 4.12 && < 4.13- , bytestring >= 0.10 && < 0.11- , network >= 2.6 && < 3.2- , reflex >= 0.5 && < 0.7+ build-depends: base+ , bytestring+ , network+ , reflex , reflex-backend-socket- , reflex-basic-host >= 0.2 && < 0.3- , witherable >= 0.2 && < 0.4+ , witherable >= 0.4 && < 0.5 hs-source-dirs: example ghc-options: -Wall -threaded default-language: Haskell2010