packages feed

pipes-cacophony 0.3.0 → 0.4.0

raw patch · 5 files changed

+22/−14 lines, 5 filesdep ~cacophony

Dependency ranges changed: cacophony

Files

.travis.yml view
@@ -14,7 +14,7 @@ matrix:   include:     - env: CABALVER=1.22 GHCVER=7.10.3-      compiler: ": #GHC 7.10.2"+      compiler: ": #GHC 7.10.3"       addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,alex-3.1.7,happy-1.19.5], sources: [hvr-ghc]}}     - env: CABALVER=1.24 GHCVER=8.0.2       compiler: ": #GHC 8.0.2"@@ -42,7 +42,7 @@     fi   - travis_retry cabal update   - "sed -i  's/^jobs:.*$/jobs: 2/' $HOME/.cabal/config"-  - cabal install --only-dependencies --enable-tests --dry -v pipes-cacophony.cabal > installplan.txt+  - cabal install --only-dependencies --enable-tests -fbuild-examples --dry -v pipes-cacophony.cabal > installplan.txt   - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt    # check whether current requested install-plan matches cached package-db snapshot@@ -56,8 +56,7 @@       echo "cabal build-cache MISS";       rm -rf $HOME/.cabsnap;       mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;-      cabal install --only-dependencies --enable-tests pipes-cacophony.cabal;-      if [ "$GHCVER" = "7.10.1" ]; then cabal install Cabal-1.22.4.0; fi;+      cabal install --only-dependencies --enable-tests -fbuild-examples pipes-cacophony.cabal;     fi    # snapshot package-db on cache miss@@ -70,7 +69,7 @@     fi  script:-  - cabal configure --enable-tests -v2  # -v2 provides useful information for debugging+  - cabal configure --enable-tests -fbuild-examples -v2  # -v2 provides useful information for debugging   - cabal build   # this builds all libraries and executables (including tests)   - cabal test   - cabal sdist   # tests that a source-distribution can be generated@@ -79,4 +78,4 @@   # If there are no other `.tar.gz` files in `dist`, this can be even simpler:   # `cabal install --force-reinstalls dist/*-*.tar.gz`   - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&-    (cd dist && cabal install --enable-tests -fbuild-examples --run-tests --force-reinstalls "$SRC_TGZ")+    (cd dist && cabal install --enable-tests --run-tests -fbuild-examples --force-reinstalls "$SRC_TGZ")
changelog.md view
@@ -1,3 +1,9 @@+# 0.4.0++* Brought up to date with cacophony API changes++* Updated travis configuration+ # 0.3.0  * Brought up to date with cacophony API changes
examples/loopback/Main.hs view
@@ -1,7 +1,8 @@ module Main where +import Control.Exception     (SomeException) import Control.Lens-import Control.Monad (forever)+import Control.Monad         (forever) import Data.ByteString.Char8 (unpack, pack) import Pipes import qualified Pipes.Prelude as P@@ -16,10 +17,10 @@  import Pipes.Noise -strToSB :: Pipe String ScrubbedBytes IO (Either NoiseException ())+strToSB :: Pipe String ScrubbedBytes IO (Either SomeException ()) strToSB = forever $ await >>= yield . convert . pack -sbToStr :: Pipe ScrubbedBytes String IO (Either NoiseException ())+sbToStr :: Pipe ScrubbedBytes String IO (Either SomeException ()) sbToStr = forever $ await >>= yield . unpack . convert  main :: IO ()
pipes-cacophony.cabal view
@@ -1,5 +1,5 @@ name:          pipes-cacophony-version:       0.3.0+version:       0.4.0 synopsis:      Pipes for Noise-secured network connections. license:       PublicDomain license-file:  LICENSE@@ -48,7 +48,7 @@   build-depends:     base       >=4.8 && <5,     bytestring,-    cacophony  >=0.7,+    cacophony  >=0.8,     pipes   hs-source-dirs:   src   default-language: Haskell2010
src/Pipes/Noise.hs view
@@ -15,6 +15,7 @@   ) where  import Control.Concurrent.MVar (MVar, newMVar, putMVar, takeMVar)+import Control.Exception       (SomeException) import Data.ByteString         (ByteString) import Pipes                   (Pipe, MonadIO, await, yield, liftIO) @@ -34,14 +35,15 @@ --   second used for outbound messages. mkNoisePipes :: (MonadIO m, Cipher c, DH d, Hash h)              => NoiseState c d h-             -> IO (InboundNoisePipe m (Either NoiseException ()), OutboundNoisePipe m (Either NoiseException ()))+             -> IO (InboundNoisePipe  m (Either SomeException ()),+                    OutboundNoisePipe m (Either SomeException ())) mkNoisePipes ns = do   nsmv <- liftIO . newMVar $ ns   return (inboundPipe nsmv, outboundPipe nsmv)  inboundPipe :: (MonadIO m, Cipher c, DH d, Hash h)             => MVar (NoiseState c d h)-            -> InboundNoisePipe m (Either NoiseException ())+            -> InboundNoisePipe m (Either SomeException ()) inboundPipe nsmv = do   msg <- await @@ -55,7 +57,7 @@  outboundPipe :: (MonadIO m, Cipher c, DH d, Hash h)              => MVar (NoiseState c d h)-             -> OutboundNoisePipe m (Either NoiseException ())+             -> OutboundNoisePipe m (Either SomeException ()) outboundPipe nsmv = do   msg <- await