packages feed

compensated 0.7.2 → 0.7.3

raw patch · 5 files changed

+208/−100 lines, 5 filesdep ~safecopyPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: safecopy

API changes (from Hackage documentation)

- Numeric.Compensated: instance Numeric.Compensated.Compensable a => Data.Semigroup.Semigroup (Numeric.Compensated.Compensated a)
+ Numeric.Compensated: --
+ Numeric.Compensated: -- >>> Prelude.product [2..100]
+ Numeric.Compensated: -- 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
+ Numeric.Compensated: -- </pre>
+ Numeric.Compensated: -- <pre>
+ Numeric.Compensated: -- This construction can be iterated, doubling precision each time.
+ Numeric.Compensated: -- by using Knuth's error free transform and a number of custom
+ Numeric.Compensated: -- compensated arithmetic circuits.
+ Numeric.Compensated: -- | This provides a numeric data type with effectively doubled precision
+ Numeric.Compensated: instance Numeric.Compensated.Compensable a => GHC.Base.Semigroup (Numeric.Compensated.Compensated a)
- Numeric.Compensated: class (RealFrac a, Precise a, Floating a) => Compensable a where data Compensated a where {
+ Numeric.Compensated: class (RealFrac a, Precise a, Floating a) => Compensable a where {

Files

.gitignore view
@@ -1,4 +1,5 @@ dist+dist-newstyle docs wiki TAGS@@ -33,3 +34,21 @@ www stamp-h1 config.h.in+.stack-work/+cabal-dev+*.chi+*.chs.h+*.dyn_o+*.dyn_hi+.hpc+.hsenv+.cabal-sandbox/+cabal.sandbox.config+*.prof+*.aux+*.hp+*.eventlog+cabal.project.local+cabal.project.local~+.HTF/+.ghc.environment.*
.travis.yml view
@@ -1,106 +1,175 @@-# This file has been generated -- see https://github.com/hvr/multi-ghc-travis+# This Travis job script has been generated by a script via+#+#   haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'cabal.project'+#+# For more information, see https://github.com/haskell-CI/haskell-ci+#+# version: 0.3.20190425+# language: c-sudo: false-+dist: xenial+git:+  # whether to recursively clone submodules+  submodules: false+notifications:+  irc:+    channels:+      - irc.freenode.org#haskell-lens+    skip_join: true+    template:+      - "\"\\x0313compensated\\x03/\\x0306%{branch}\\x03 \\x0314%{commit}\\x03 %{build_url} %{message}\"" cache:   directories:-    - $HOME/.cabsnap     - $HOME/.cabal/packages-+    - $HOME/.cabal/store before_cache:-  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log-  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar-+  - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log+  # remove files that are regenerated by 'cabal update'+  - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*+  - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json+  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache+  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar+  - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx+  - rm -rfv $CABALHOME/packages/head.hackage matrix:   include:-    - env: CABALVER=1.24 GHCVER=7.4.2-      compiler: ": #GHC 7.4.2"-      addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2,hlint], sources: [hvr-ghc]}}-    - env: CABALVER=1.24 GHCVER=7.6.3-      compiler: ": #GHC 7.6.3"-      addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3,hlint], sources: [hvr-ghc]}}-    - env: CABALVER=1.24 GHCVER=7.8.4-      compiler: ": #GHC 7.8.4"-      addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4,hlint], sources: [hvr-ghc]}}-    - env: CABALVER=1.24 GHCVER=7.10.3-      compiler: ": #GHC 7.10.3"-      addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,hlint], sources: [hvr-ghc]}}-    - env: CABALVER=1.24 GHCVER=8.0.2-      compiler: ": #GHC 8.0.2"-      addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,hlint], sources: [hvr-ghc]}}-+    - compiler: ghc-8.8.1+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}+      env: GHCHEAD=true+    - compiler: ghc-8.6.5+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}+    - compiler: ghc-8.4.4+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}+    - compiler: ghc-8.2.2+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}+    - compiler: ghc-8.0.2+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}+    - compiler: ghc-7.10.3+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-2.4"]}}+    - compiler: ghc-7.8.4+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}}+    - compiler: ghc-7.6.3+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-2.4"]}}+    - compiler: ghc-7.4.2+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.4.2","cabal-install-2.4"]}}+    - compiler: ghc-head+      addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-head","cabal-install-head"]}}+      env: GHCHEAD=true+  allow_failures:+    - compiler: ghc-head+    - compiler: ghc-8.8.1 before_install:- - unset CC- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH-+  - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')+  - HCPKG="$HC-pkg"+  - unset CC+  - CABAL=/opt/ghc/bin/cabal+  - CABALHOME=$HOME/.cabal+  - export PATH="$CABALHOME/bin:$PATH"+  - TOP=$(pwd)+  - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))+  - echo $HCNUMVER+  - CABAL="$CABAL -vnormal+nowrap+markoutput"+  - set -o pipefail+  - |+    echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }'           >> .colorful.awk+    echo 'BEGIN { state = "output"; }'                                     >> .colorful.awk+    echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }'            >> .colorful.awk+    echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }'             >> .colorful.awk+    echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk+    echo '  if (state == "cabal") {'                                       >> .colorful.awk+    echo '    print blue($0)'                                              >> .colorful.awk+    echo '  } else {'                                                      >> .colorful.awk+    echo '    print $0'                                                    >> .colorful.awk+    echo '  }'                                                             >> .colorful.awk+    echo '}'                                                               >> .colorful.awk+  - cat .colorful.awk+  - |+    color_cabal_output () {+      awk -f $TOP/.colorful.awk+    }+  - echo text | color_cabal_output install:- - cabal --version- - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"- - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];-   then-     zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >-          $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;-   fi- - travis_retry cabal update -v- - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config- - cabal install --only-dependencies --enable-tests --dry -v > installplan.txt- - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt--# check whether current requested install-plan matches cached package-db snapshot- - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;-   then-     echo "cabal build-cache HIT";-     rm -rfv .ghc;-     cp -a $HOME/.cabsnap/ghc $HOME/.ghc;-     cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;-   else-     echo "cabal build-cache MISS";-     rm -rf $HOME/.cabsnap;-     mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;-     cabal install -j --only-dependencies --enable-tests --enable-benchmarks;-   fi--# snapshot package-db on cache miss- - if [ ! -d $HOME/.cabsnap ];-   then-      echo "snapshotting package-db to build-cache";-      mkdir $HOME/.cabsnap;-      cp -a $HOME/.ghc $HOME/.cabsnap/ghc;-      cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;-   fi--# 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.+  - ${CABAL} --version+  - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"+  - TEST=--enable-tests+  - BENCH=--enable-benchmarks+  - GHCHEAD=${GHCHEAD-false}+  - rm -f $CABALHOME/config+  - |+    echo "verbose: normal +nowrap +markoutput"          >> $CABALHOME/config+    echo "remote-build-reporting: anonymous"            >> $CABALHOME/config+    echo "remote-repo-cache: $CABALHOME/packages"       >> $CABALHOME/config+    echo "logs-dir:          $CABALHOME/logs"           >> $CABALHOME/config+    echo "world-file:        $CABALHOME/world"          >> $CABALHOME/config+    echo "extra-prog-path:   $CABALHOME/bin"            >> $CABALHOME/config+    echo "symlink-bindir:    $CABALHOME/bin"            >> $CABALHOME/config+    echo "installdir:        $CABALHOME/bin"            >> $CABALHOME/config+    echo "build-summary:     $CABALHOME/logs/build.log" >> $CABALHOME/config+    echo "store-dir:         $CABALHOME/store"          >> $CABALHOME/config+    echo "install-dirs user"                            >> $CABALHOME/config+    echo "  prefix: $CABALHOME"                         >> $CABALHOME/config+    echo "repository hackage.haskell.org"               >> $CABALHOME/config+    echo "  url: http://hackage.haskell.org/"           >> $CABALHOME/config+  - |+    if $GHCHEAD; then+    echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config+    +    echo "repository head.hackage"                                                        >> $CABALHOME/config+    echo "   url: http://head.hackage.haskell.org/"                                       >> $CABALHOME/config+    echo "   secure: True"                                                                >> $CABALHOME/config+    echo "   root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config+    echo "              2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config+    echo "              8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config+    echo "   key-threshold: 3"                                                            >> $CABALHOME/config+    fi+  - cat $CABALHOME/config+  - rm -fv cabal.project cabal.project.local cabal.project.freeze+  - travis_retry ${CABAL} v2-update -v+  - if [ $HCNUMVER -eq 80801 ] ; then ${CABAL} v2-install -w ${HC} -j2 hlint --constraint='hlint ==2.1.*' | color_cabal_output ; fi+  # Generate cabal.project+  - rm -rf cabal.project cabal.project.local cabal.project.freeze+  - touch cabal.project+  - |+    echo 'packages: "."' >> cabal.project+  - |+    echo "write-ghc-environment-files: always" >> cabal.project+  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(compensated)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"+  - cat cabal.project || true+  - cat cabal.project.local || true+  - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi+  - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output+  - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"+  - rm  cabal.project.freeze+  - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output script:- # -v2 provides useful information for debugging- - cabal configure --enable-tests --enable-benchmarks -v2-- # this builds all libraries and executables- # (including tests/benchmarks)- - cabal build- - cabal test --show-details=always-- # tests that a source-distribution can be generated- - cabal sdist- - hlint src --cpp-define HLINT-- # check that the generated source-distribution can be built & installed- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;-   cd dist/;-   if [ -f "$SRC_TGZ" ]; then-      cabal install --force-reinstalls "$SRC_TGZ";-   else-      echo "expected '$SRC_TGZ' not found";-      exit 1;-   fi--notifications:-  irc:-    channels:-      - "irc.freenode.org#haskell-lens"-    skip_join: true-    template:-      - "\x0313compensated\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"+  - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)+  # Packaging...+  - ${CABAL} v2-sdist all | color_cabal_output+  # Unpacking...+  - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/+  - cd ${DISTDIR} || false+  - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;+  # Generate cabal.project+  - rm -rf cabal.project cabal.project.local cabal.project.freeze+  - touch cabal.project+  - |+    echo 'packages: "compensated-*/*.cabal"' >> cabal.project+  - |+    echo "write-ghc-environment-files: always" >> cabal.project+  - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(compensated)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"+  - cat cabal.project || true+  - cat cabal.project.local || true+  # Building with tests and benchmarks...+  # build & run tests, build benchmarks+  - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output+  # Testing...+  - ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output+  # HLint..+  - if [ $HCNUMVER -eq 80801 ] ; then (cd compensated-* && hlint --cpp-ansi --cpp-define=HLINT src) ; fi+  # cabal check...+  - (cd compensated-* && ${CABAL} -vnormal check)+  # haddock...+  - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output +# REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"] # EOF
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.7.3 [2019.09.13]+------------------+* Allow building with `safecopy-0.10`.+ 0.7.2 ----- * Add a library dependency on the `doctests` test suite
compensated.cabal view
@@ -1,6 +1,6 @@ name:          compensated category:      Numeric-version:       0.7.2+version:       0.7.3 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE@@ -11,7 +11,15 @@ bug-reports:   http://github.com/analytics/compensated/issues copyright:     Copyright (C) 2013 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+tested-with:   GHC == 7.4.2+             , GHC == 7.6.3+             , GHC == 7.8.4+             , GHC == 7.10.3+             , GHC == 8.0.2+             , GHC == 8.2.2+             , GHC == 8.4.4+             , GHC == 8.6.5+             , GHC == 8.8.1 synopsis:      Compensated floating-point arithmetic description:   This package provides compensated floating point arithmetic. @@ -52,12 +60,12 @@     comonad                   >= 4        && < 6,     deepseq                   >= 1.3      && < 1.5,     distributive              >= 0.3      && < 1,-    hashable                  >= 1.1.2.3  && < 1.3,+    hashable                  >= 1.1.2.3  && < 1.4,     lens                      >= 4        && < 5,     log-domain                >= 0.9      && < 1,     semigroupoids             >= 5        && < 6,     semigroups                >= 0.8.4    && < 1,-    safecopy                  >= 0.8.1    && < 0.10,+    safecopy                  >= 0.8.1    && < 0.11,     vector                    >= 0.9      && < 0.13    exposed-modules:
src/Numeric/Compensated.hs view
@@ -2,7 +2,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveDataTypeable #-}@@ -72,7 +71,9 @@ import Data.SafeCopy import Data.Serialize as Serialize import Data.Bytes.Serial as Bytes+#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup+#endif import Data.Vector.Unboxed as U import Data.Vector.Generic as G import Data.Vector.Generic.Mutable as M@@ -87,6 +88,8 @@  {-# ANN module "hlint: ignore Use -" #-} {-# ANN module "hlint: ignore Use curry" #-}+{-# ANN module "hlint: ignore Eta reduce" #-}+{-# ANN module "hlint: ignore Unused LANGUAGE pragma" #-}  -- | @'add' a b k@ computes @k x y@ such that --@@ -512,7 +515,12 @@     Bytes.serialize b  -- ಠ_ಠ this unnecessarily expects that the format won't change, because I can't derive a better instance.-instance (Compensable a, Serialize a) => SafeCopy (Compensated a)+instance (Compensable a, Serialize a) => SafeCopy (Compensated a) where+  -- safecopy-0.10.0 changed its default implementations for these methods.+  -- The implementations below are copied from the pre-0.10.0 defaults.+  errorTypeName _ = "<unknown type>"+  getCopy = contain Serialize.get+  putCopy = contain . Serialize.put  instance (Compensable a, Storable a) => Storable (Compensated a) where   sizeOf _ = sizeOf (undefined :: a) * 2