bytes 0.15.5 → 0.17.5
raw patch · 14 files changed
Files
- .ghci +0/−2
- .hlint.yaml +3/−0
- .travis.yml +0/−151
- CHANGELOG.markdown +40/−0
- README.markdown +1/−1
- Setup.lhs +5/−32
- Warning.hs +0/−5
- bytes.cabal +32/−65
- src/Data/Bytes/Get.hs +31/−13
- src/Data/Bytes/Put.hs +8/−10
- src/Data/Bytes/Serial.hs +35/−21
- tests/doctests.hs +0/−25
- travis/cabal-apt-install +0/−27
- travis/config +0/−16
− .ghci
@@ -1,2 +0,0 @@-:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h -optP-Iincludes-:set -v0
+ .hlint.yaml view
@@ -0,0 +1,3 @@+- arguments: [--cpp-define=HLINT, --cpp-ansi]++- ignore: {name: Use uncurry}
− .travis.yml
@@ -1,151 +0,0 @@-# This Travis job script has been generated by a script via-#-# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--ghc-head' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-unconstrained' 'cabal.project'-#-# For more information, see https://github.com/hvr/multi-ghc-travis-#-language: c-sudo: false--git:- submodules: false # whether to recursively clone submodules--notifications:- irc:- channels:- - "irc.freenode.org#haskell-lens"- skip_join: true- template:- - "\x0313bytes\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"--cache:- directories:- - $HOME/.cabal/packages- - $HOME/.cabal/store--before_cache:- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log- # remove files that are regenerated by 'cabal update'- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx-- - rm -rfv $HOME/.cabal/packages/head.hackage--matrix:- include:- - compiler: "ghc-8.6.1"- env: GHCHEAD=true- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1], sources: [hvr-ghc]}}- - compiler: "ghc-8.4.3"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}- - compiler: "ghc-8.2.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.0.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}- - compiler: "ghc-7.10.3"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], sources: [hvr-ghc]}}- - compiler: "ghc-7.8.4"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}- - compiler: "ghc-7.6.3"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3], sources: [hvr-ghc]}}- - compiler: "ghc-7.4.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.2], sources: [hvr-ghc]}}- - compiler: "ghc-head"- env: GHCHEAD=true- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}-- allow_failures:- - compiler: "ghc-head"- - compiler: "ghc-8.6.1"--before_install:- - HC=${CC}- - HCPKG=${HC/ghc/ghc-pkg}- - unset CC- - ROOTDIR=$(pwd)- - mkdir -p $HOME/.local/bin- - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"- - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))- - echo $HCNUMVER--install:- - cabal --version- - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"- - BENCH=${BENCH---enable-benchmarks}- - TEST=${TEST---enable-tests}- - HADDOCK=${HADDOCK-true}- - UNCONSTRAINED=${UNCONSTRAINED-true}- - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}- - GHCHEAD=${GHCHEAD-false}- - travis_retry cabal update -v- - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"- - rm -fv cabal.project cabal.project.local- # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage- - |- if $GHCHEAD; then- sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config- for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done-- echo 'repository head.hackage' >> ${HOME}/.cabal/config- echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config- echo ' secure: True' >> ${HOME}/.cabal/config- echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config- echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config- echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config- echo ' key-threshold: 3' >> ${HOME}/.cabal.config-- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'-- cabal new-update head.hackage -v- fi- - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'- - "printf 'packages: \".\"\\n' > cabal.project"- - touch cabal.project.local- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"- - cat cabal.project || true- - cat cabal.project.local || true- - if [ -f "./configure.ac" ]; then- (cd "." && autoreconf -i);- fi- - rm -f cabal.project.freeze- - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all- - rm -rf .ghc.environment.* "."/dist- - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)--# Here starts the actual work to be performed for the package under test;-# any command which exits with a non-zero exit code causes the build to fail.-script:- # test that source-distributions can be generated- - (cd "." && cabal sdist)- - mv "."/dist/bytes-*.tar.gz ${DISTDIR}/- - cd ${DISTDIR} || false- - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;- - "printf 'packages: bytes-*/*.cabal\\n' > cabal.project"- - touch cabal.project.local- - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"- - cat cabal.project || true- - cat cabal.project.local || true-- # build & run tests, build benchmarks- - cabal new-build -w ${HC} ${TEST} ${BENCH} all- - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi-- # cabal check- - (cd bytes-* && cabal check)-- # haddock- - rm -rf ./dist-newstyle- - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi--# REGENDATA ["-o",".travis.yml","--ghc-head","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-unconstrained","cabal.project"]-# EOF
CHANGELOG.markdown view
@@ -1,3 +1,43 @@+0.17.5 [2026.01.10]+-------------------+* Allow building with `time-1.15.*` (GHC 9.14).+* Remove unused `void` dependency.++0.17.4 [2024.12.04]+-------------------+* Require building with GHC 8.0 or later.++0.17.3 [2023.08.06]+-------------------+* Remove `mtl` dependency in favor `transformers`, as `bytes` was only using+ `mtl` for its `transformers` re-exports.++0.17.2 [2022.05.07]+-------------------+* Allow building with `mtl-2.3.*` and `transformers-0.6.*`.++0.17.1 [2021.02.17]+-------------------+* The build-type has been changed from `Custom` to `Simple`.+ To achieve this, the `doctests` test suite has been removed in favor of using+ [`cabal-docspec`](https://github.com/phadej/cabal-extras/tree/master/cabal-docspec)+ to run the doctests.+* Provide the `Serial Natural` instance unconditionally.+* Allow building with `bytestring-0.11.*`.++0.17 [2020.02.03]+-----------------+* Give `MonadGet m` a superclass of+ `forall a b. Coercible a b => Coercible (m a) (m b)` when built against+ GHC 8.6 or later. This allows `Serial` instances to be derived using+ `GeneralizedNewtypeDeriving` or `DerivingVia` when using in tandem with+ `StandaloneDeriving`.++0.16 [2019.08.27]+-----------------+* Support GHC-8.8.+* `MonadGet` now requires `MonadFail` as a superclass.+ 0.15.5 [2018.07.03] ------------------- * Add `Serial(1)` instances for `NonEmpty`.
README.markdown view
@@ -1,7 +1,7 @@ bytes ===== -[](https://hackage.haskell.org/package/bytes) [](http://travis-ci.org/ekmett/bytes)+[](https://hackage.haskell.org/package/bytes) [](https://github.com/ekmett/bytes/actions?query=workflow%3AHaskell-CI) This package provides a simple compatibility shim that lets you work with both `binary` and `cereal` with one chunk of serialization code.
Setup.lhs view
@@ -1,34 +1,7 @@-\begin{code}-{-# LANGUAGE CPP #-}-{-# OPTIONS_GHC -Wall #-}-module Main (main) where--#ifndef MIN_VERSION_cabal_doctest-#define MIN_VERSION_cabal_doctest(x,y,z) 0-#endif--#if MIN_VERSION_cabal_doctest(1,0,0)--import Distribution.Extra.Doctest ( defaultMainWithDoctests )-main :: IO ()-main = defaultMainWithDoctests "doctests"--#else--#ifdef MIN_VERSION_Cabal--- If the macro is defined, we have new cabal-install,--- but for some reason we don't have cabal-doctest in package-db------ Probably we are running cabal sdist, when otherwise using new-build--- workflow-import Warning ()-#endif--import Distribution.Simple--main :: IO ()-main = defaultMain+#!/usr/bin/runhaskell+> module Main (main) where -#endif+> import Distribution.Simple -\end{code}+> main :: IO ()+> main = defaultMain
− Warning.hs
@@ -1,5 +0,0 @@-module Warning- {-# WARNING ["You are configuring this package without cabal-doctest installed.",- "The doctests test-suite will not work as a result.",- "To fix this, install cabal-doctest before configuring."] #-}- () where
bytes.cabal view
@@ -1,8 +1,8 @@ name: bytes category: Data, Serialization-version: 0.15.5+version: 0.17.5 license: BSD3-cabal-version: >= 1.8+cabal-version: >= 1.10 license-file: LICENSE author: Edward A. Kmett maintainer: Edward A. Kmett <ekmett@gmail.com>@@ -10,71 +10,51 @@ homepage: https://github.com/ekmett/bytes bug-reports: https://github.com/ekmett/bytes/issues copyright: Copyright (C) 2013-2015 Edward A. Kmett-build-type: Custom-tested-with: GHC == 7.4.2- , GHC == 7.6.3- , GHC == 7.8.4- , GHC == 7.10.3- , GHC == 8.0.2+build-type: Simple+tested-with: GHC == 8.0.2 , GHC == 8.2.2- , GHC == 8.4.3- , GHC == 8.6.1+ , GHC == 8.4.4+ , GHC == 8.6.5+ , GHC == 8.8.4+ , GHC == 8.10.7+ , GHC == 9.0.2+ , GHC == 9.2.8+ , GHC == 9.4.8+ , GHC == 9.6.7+ , GHC == 9.8.4+ , GHC == 9.10.3+ , GHC == 9.12.2+ , GHC == 9.14.1 synopsis: Sharing code for serialization between binary and cereal description: Sharing code for serialization between binary and cereal. extra-source-files:- .travis.yml- .ghci .gitignore+ .hlint.yaml .vim.custom- travis/cabal-apt-install- travis/config AUTHORS.markdown README.markdown CHANGELOG.markdown- Warning.hs source-repository head type: git- location: git://github.com/ekmett/bytes.git---- You can disable the doctests test suite with -f-test-doctests-flag test-doctests- description: Enable (or disable via f-test-doctests) the doctest suite when- using the enable-tests option for cabal.- default: True- manual: True--custom-setup- -- any should do- setup-depends:- base >= 4.5 && <5,- Cabal >= 1.14,- cabal-doctest >= 1 && <1.1-+ location: https://github.com/ekmett/bytes.git library build-depends:- base >= 4.5 && < 5,+ base >= 4.9 && < 5, binary >= 0.5.1 && < 0.9,- bytestring >= 0.9 && < 0.11,- cereal >= 0.3.5 && < 0.6,+ binary-orphans >= 1.0.1 && < 1.1,+ bytestring >= 0.9 && < 0.13,+ cereal >= 0.5.2 && < 0.6, containers >= 0.3 && < 1,- hashable >= 1.0.1.1 && < 1.4,- mtl >= 2.0 && < 2.3,- text >= 0.2 && < 1.3,- time >= 1.2 && < 1.9,- transformers >= 0.2 && < 0.6,- transformers-compat >= 0.3 && < 1,+ hashable >= 1.0.1.1 && < 1.6,+ text >= 0.2 && < 2.2,+ time >= 1.2 && < 1.16,+ transformers >= 0.2 && < 0.7,+ transformers-compat >= 0.6.5 && < 1, unordered-containers >= 0.2 && < 0.3,- scientific >= 0.0 && < 1,- void >= 0.6 && < 1-- if impl(ghc >= 7.4 && < 7.6)- build-depends: ghc-prim-- if impl(ghc < 8.0)- build-depends: semigroups >= 0.5 && < 1+ scientific >= 0.0 && < 1 exposed-modules: Data.Bytes.Get@@ -83,22 +63,9 @@ Data.Bytes.Signed Data.Bytes.VarInt - ghc-options: -Wall -fwarn-tabs -O2+ ghc-options: -Wall -Wtabs -O2+ if impl(ghc >= 8.6)+ ghc-options: -Wno-star-is-type c-sources: cbits/i2d.c hs-source-dirs: src--test-suite doctests- type: exitcode-stdio-1.0- main-is: doctests.hs- ghc-options: -Wall -threaded- hs-source-dirs: tests-- if !flag(test-doctests)- buildable: False- else- build-depends:- base,- bytes,- directory >= 1.0,- doctest >= 0.11.1 && <0.17,- filepath >= 1.2+ default-language: Haskell2010
src/Data/Bytes/Get.hs view
@@ -1,9 +1,14 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE Trustworthy #-}-{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}+#if __GLASGOW_HASKELL__ >= 806+{-# LANGUAGE QuantifiedConstraints #-}+#endif++{-# OPTIONS_GHC -Wno-warnings-deprecations #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett 2013-2015@@ -25,17 +30,16 @@ , runGetS ) where -#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif-import Control.Monad.Reader+import Control.Monad (liftM, unless)+import Control.Monad.Trans.Class (MonadTrans(..)) import Control.Monad.Trans.Except as Except-import Control.Monad.RWS.Lazy as Lazy-import Control.Monad.RWS.Strict as Strict-import Control.Monad.State.Lazy as Lazy-import Control.Monad.State.Strict as Strict-import Control.Monad.Writer.Lazy as Lazy-import Control.Monad.Writer.Strict as Strict+import Control.Monad.Trans.Reader (ReaderT(..))+import Control.Monad.Trans.RWS.Lazy as Lazy+import Control.Monad.Trans.RWS.Strict as Strict+import Control.Monad.Trans.State.Lazy as Lazy+import Control.Monad.Trans.State.Strict as Strict+import Control.Monad.Trans.Writer.Lazy as Lazy+import Control.Monad.Trans.Writer.Strict as Strict import qualified Data.Binary.Get as B import qualified Data.ByteString.Lazy as Lazy import qualified Data.ByteString as Strict@@ -43,7 +47,21 @@ import qualified Data.Serialize.Get as S import Data.Word -class (Integral (Remaining m), Monad m, Applicative m) => MonadGet m where+import Control.Monad.Trans.Instances ()+import Data.Binary.Orphans ()+import qualified Control.Monad.Fail as Fail+#if __GLASGOW_HASKELL__ >= 806+import Data.Coerce (Coercible)+#endif++class (+#if __GLASGOW_HASKELL__ >= 806+ -- This superclass exists for the benefit of Serial, which uses MonadGet+ -- in one of its methods. Giving MonadGet this superclass allows Serial to+ -- be derived using GeneralizedNewtypeDeriving/DerivingVia.+ forall a b. Coercible a b => Coercible (m a) (m b),+#endif+ Integral (Remaining m), Fail.MonadFail m, Applicative m) => MonadGet m where -- | An 'Integral' number type used for unchecked skips and counting. type Remaining m :: * @@ -211,7 +229,7 @@ {-# INLINE lookAheadE #-} ensure n = do bs <- lookAhead $ getByteString n- unless (Strict.length bs >= n) $ fail "ensure: Required more bytes"+ unless (Strict.length bs >= n) $ Fail.fail "ensure: Required more bytes" return bs {-# INLINE ensure #-} getBytes = B.getByteString
src/Data/Bytes/Put.hs view
@@ -26,17 +26,15 @@ , runPutS ) where -#if __GLASGOW_HASKELL__ < 710-import Control.Applicative-#endif-import Control.Monad.Reader+import Control.Monad.Trans.Class (MonadTrans(..)) import Control.Monad.Trans.Except as Except-import Control.Monad.RWS.Lazy as Lazy-import Control.Monad.RWS.Strict as Strict-import Control.Monad.State.Lazy as Lazy-import Control.Monad.State.Strict as Strict-import Control.Monad.Writer.Lazy as Lazy-import Control.Monad.Writer.Strict as Strict+import Control.Monad.Trans.Reader (ReaderT(..))+import Control.Monad.Trans.RWS.Lazy as Lazy+import Control.Monad.Trans.RWS.Strict as Strict+import Control.Monad.Trans.State.Lazy as Lazy+import Control.Monad.Trans.State.Strict as Strict+import Control.Monad.Trans.Writer.Lazy as Lazy+import Control.Monad.Trans.Writer.Strict as Strict import qualified Data.Binary.Put as B import Data.ByteString as Strict import Data.ByteString.Lazy as Lazy
src/Data/Bytes/Serial.hs view
@@ -7,8 +7,13 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+#if defined(__GLASGOW_HASKELL__)+# if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Trustworthy #-}+# endif+# if __GLASGOW_HASKELL__ >= 708+{-# LANGUAGE EmptyCase #-}+# endif #endif #ifndef MIN_VERSION_base #define MIN_VERSION_base(x,y,z) 1@@ -50,6 +55,7 @@ import Control.Applicative import Control.Monad+import qualified Control.Monad.Fail as MonadFail import qualified Data.Foldable as F import Data.Bytes.Get import Data.Bytes.Put@@ -92,16 +98,25 @@ import GHC.Exts (Down(..)) import GHC.Generics import System.IO.Unsafe--#if MIN_VERSION_base(4,8,0) import Numeric.Natural-#endif foreign import ccall floatToWord32 :: Float -> Word32 foreign import ccall word32ToFloat :: Word32 -> Float foreign import ccall doubleToWord64 :: Double -> Word64 foreign import ccall word64ToDouble :: Word64 -> Double +-- $setup+-- >>> import Data.Bytes.Get+-- >>> import Data.Bytes.Put+-- >>> import Data.Bytes.VarInt+-- >>> import Data.Fixed+-- >>> import Data.Ratio (Ratio, (%))+-- >>> import Data.Time+-- >>> import Data.Time.Clock+-- >>> import Data.Time.Clock.TAI+-- >>> import Data.Word+-- >>> import Numeric.Natural+ ------------------------------------------------------------------------------ -- Endianness-Dependant Serialization ------------------------------------------------------------------------------@@ -273,8 +288,14 @@ restore :: forall m a. (MonadGet m, Storable a) => m a restore = do let required = sizeOf (undefined :: a)- PS fp o n <- getByteString required- unless (n >= required) $ fail "restore: Required more bytes"+#if MIN_VERSION_bytestring(0,11,0)+ let o = 0+ BS fp n+#else+ PS fp o n+#endif+ <- getByteString required+ unless (n >= required) $ MonadFail.fail "restore: Required more bytes" return $ unsafePerformIO $ withForeignPtr fp $ \p -> peekByteOff p o instance Serial Double where@@ -337,7 +358,7 @@ instance Serial Void where serialize = absurd- deserialize = fail "I looked into the void."+ deserialize = MonadFail.fail "I looked into the void." instance Serial ISet.IntSet where serialize = serialize . ISet.toAscList@@ -387,11 +408,6 @@ | otherwise = return $ fromIntegral n {-# INLINE getVarInt #-} --- |--- $setup--- >>> import Data.Word--- >>> import Data.Fixed--- >>> import Data.Bytes.Serial -- | Integer/Word types serialized to base-128 variable-width ints. --@@ -414,14 +430,12 @@ serialize = serialize . VarInt deserialize = unVarInt `liftM` deserialize -#if MIN_VERSION_base(4,8,0) -- | -- >>> runGetL deserialize (runPutL (serialize (10^10::Natural))) :: Natural -- 10000000000 instance Serial Natural where serialize = serialize . VarInt . toInteger deserialize = fromInteger . unVarInt <$> deserialize-#endif -- | -- >>> (runGetL deserialize $ runPutL $ serialize (1.82::Fixed E2))::Fixed E2@@ -594,8 +608,8 @@ gdeserialize = return U1 instance GSerial V1 where- gserialize _ = fail "I looked into the void."- gdeserialize = fail "I looked into the void."+ gserialize x = case x of {}+ gdeserialize = MonadFail.fail "I looked into the void." instance (GSerial f, GSerial g) => GSerial (f :*: g) where gserialize (f :*: g) = do@@ -609,7 +623,7 @@ gdeserialize = getWord8 >>= \a -> case a of 0 -> liftM L1 gdeserialize 1 -> liftM R1 gdeserialize- _ -> fail "Missing case"+ _ -> MonadFail.fail "Missing case" instance GSerial f => GSerial (M1 i c f) where gserialize (M1 x) = gserialize x@@ -772,8 +786,8 @@ gdeserializeWith _ = return U1 instance GSerial1 V1 where- gserializeWith _ = fail "I looked into the void."- gdeserializeWith _ = fail "I looked into the void."+ gserializeWith _ x = case x of {}+ gdeserializeWith _ = MonadFail.fail "I looked into the void." instance (GSerial1 f, GSerial1 g) => GSerial1 (f :*: g) where gserializeWith f (a :*: b) = gserializeWith f a >> gserializeWith f b@@ -785,7 +799,7 @@ gdeserializeWith m = getWord8 >>= \a -> case a of 0 -> liftM L1 (gdeserializeWith m) 1 -> liftM R1 (gdeserializeWith m)- _ -> fail "Missing case"+ _ -> MonadFail.fail "Missing case" instance (Serial1 f, GSerial1 g) => GSerial1 (f :.: g) where gserializeWith f (Comp1 m) = serializeWith (gserializeWith f) m@@ -821,7 +835,7 @@ deserializeWith2 m n = getWord8 >>= \a -> case a of 0 -> liftM Left m 1 -> liftM Right n- _ -> fail "Missing case"+ _ -> MonadFail.fail "Missing case" instance Serial2 (,) where serializeWith2 f g (a, b) = f a >> g b
− tests/doctests.hs
@@ -1,25 +0,0 @@--------------------------------------------------------------------------------- |--- Module : Main (doctests)--- Copyright : (C) 2012-14 Edward Kmett--- License : BSD-style (see the file LICENSE)--- Maintainer : Edward Kmett <ekmett@gmail.com>--- Stability : provisional--- Portability : portable------ This module provides doctests for a project based on the actual versions--- of the packages it was built with. It requires a corresponding Setup.lhs--- to be added to the project-------------------------------------------------------------------------------module Main where--import Build_doctests (flags, pkgs, module_sources)-import Data.Foldable (traverse_)-import Test.DocTest--main :: IO ()-main = do- traverse_ putStrLn args- doctest args- where- args = flags ++ pkgs ++ module_sources
− travis/cabal-apt-install
@@ -1,27 +0,0 @@-#! /bin/bash-set -eu--APT="sudo apt-get -q -y"-CABAL_INSTALL_DEPS="cabal install --only-dependencies --force-reinstall"--$APT update-$APT install dctrl-tools--# Find potential system packages to satisfy cabal dependencies-deps()-{- local M='^\([^ ]\+\)-[0-9.]\+ (.*$'- local G=' -o ( -FPackage -X libghc-\L\1\E-dev )'- local E="$($CABAL_INSTALL_DEPS "$@" --dry-run -v 2> /dev/null \- | sed -ne "s/$M/$G/p" | sort -u)"- grep-aptavail -n -sPackage \( -FNone -X None \) $E | sort -u-}--$APT install $(deps "$@") libghc-quickcheck2-dev # QuickCheck is special-$CABAL_INSTALL_DEPS "$@" # Install the rest via Hackage--if ! $APT install hlint ; then- $APT install $(deps hlint)- cabal install hlint-fi-
− travis/config
@@ -1,16 +0,0 @@--- This provides a custom ~/.cabal/config file for use when hackage is down that should work on unix------ This is particularly useful for travis-ci to get it to stop complaining--- about a broken build when everything is still correct on our end.------ This uses Luite Stegeman's mirror of hackage provided by his 'hdiff' site instead------ To enable this, uncomment the before_script in .travis.yml--remote-repo: hdiff.luite.com:http://hdiff.luite.com/packages/archive-remote-repo-cache: ~/.cabal/packages-world-file: ~/.cabal/world-build-summary: ~/.cabal/logs/build.log-remote-build-reporting: anonymous-install-dirs user-install-dirs global