websockets-simple-extra (empty) → 0.0.0
raw patch · 6 files changed
+106/−0 lines, 6 filesdep +basedep +mtldep +websockets-simplesetup-changed
Dependencies added: base, mtl, websockets-simple
Files
- ChangeLog.md +3/−0
- LICENSE +30/−0
- README.md +1/−0
- Setup.hs +2/−0
- src/Network/WebSockets/Simple/Logger.hs +31/−0
- websockets-simple-extra.cabal +39/−0
+ ChangeLog.md view
@@ -0,0 +1,3 @@+# Changelog for websockets-simple-extra++## Unreleased changes
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Author name here (c) 2019++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Author name here nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,1 @@+# websockets-simple-extra
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ src/Network/WebSockets/Simple/Logger.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE+ NamedFieldPuns+ #-}++module Network.WebSockets.Simple.Logger where++import Network.WebSockets.Simple (WebSocketsApp (..), WebSocketsAppParams (..))+import Control.Monad.IO.Class (MonadIO, liftIO)+++logStdout :: MonadIO m+ => Show receive+ => Show send+ => WebSocketsApp m receive send+ -> WebSocketsApp m receive send+logStdout WebSocketsApp{onOpen,onReceive,onClose} =+ WebSocketsApp+ { onOpen = onOpen . newParams+ , onReceive = \params x -> do+ liftIO $ putStrLn $ "Received: " ++ show x+ onReceive (newParams params) x+ , onClose+ }+ where+ newParams WebSocketsAppParams{send,close} =+ WebSocketsAppParams+ { send = \x -> do+ liftIO $ putStrLn $ "Sent: " ++ show x+ send x+ , close+ }
+ websockets-simple-extra.cabal view
@@ -0,0 +1,39 @@+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: b4e5379c42b3dd0188665f3921ea698e16ea0c6e797221258ceb09443fd8035e++name: websockets-simple-extra+version: 0.0.0+description: Please see the README on GitHub at <https://github.com/athanclark/websockets-simple-extra#readme>+homepage: https://github.com/athanclark/websockets-simple-extra#readme+bug-reports: https://github.com/athanclark/websockets-simple-extra/issues+author: Athan Clark+maintainer: athan.clark@gmail.com+copyright: 2019 Athan Clark+license: BSD3+license-file: LICENSE+build-type: Simple+extra-source-files:+ README.md+ ChangeLog.md++source-repository head+ type: git+ location: https://github.com/athanclark/websockets-simple-extra++library+ exposed-modules:+ Network.WebSockets.Simple.Logger+ other-modules:+ Paths_websockets_simple_extra+ hs-source-dirs:+ src+ build-depends:+ base >=4.7 && <5+ , mtl+ , websockets-simple+ default-language: Haskell2010