openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
August 2017
- 1 participants
- 2097 discussions
Hello community,
here is the log from the commit of package ghc-jose for openSUSE:Factory checked in at 2017-08-31 20:48:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-jose (Old)
and /work/SRC/openSUSE:Factory/.ghc-jose.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-jose"
Thu Aug 31 20:48:01 2017 rev:4 rq:513409 version:0.6.0.3
Changes:
--------
--- /work/SRC/…
[View More]openSUSE:Factory/ghc-jose/ghc-jose.changes 2017-07-07 10:17:44.260039656 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-jose.new/ghc-jose.changes 2017-08-31 20:48:02.310404887 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:57 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.6.0.3.
+
+-------------------------------------------------------------------
Old:
----
jose-0.5.0.4.tar.gz
New:
----
jose-0.6.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-jose.spec ++++++
--- /var/tmp/diff_new_pack.D9mR2E/_old 2017-08-31 20:48:03.378254996 +0200
+++ /var/tmp/diff_new_pack.D9mR2E/_new 2017-08-31 20:48:03.382254435 +0200
@@ -19,7 +19,7 @@
%global pkg_name jose
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.5.0.4
+Version: 0.6.0.3
Release: 0
Summary: Javascript Object Signing and Encryption and JSON Web Token library
License: Apache-2.0
@@ -32,8 +32,8 @@
BuildRequires: ghc-aeson-devel
BuildRequires: ghc-attoparsec-devel
BuildRequires: ghc-base64-bytestring-devel
-BuildRequires: ghc-byteable-devel
BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-concise-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-cryptonite-devel
BuildRequires: ghc-lens-devel
@@ -44,6 +44,7 @@
BuildRequires: ghc-quickcheck-instances-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-safe-devel
+BuildRequires: ghc-semigroups-devel
BuildRequires: ghc-template-haskell-devel
BuildRequires: ghc-text-devel
BuildRequires: ghc-time-devel
@@ -63,15 +64,15 @@
JSON Web Token (JWT; RFC 7519) formats.
The JSON Web Signature (JWS; RFC 7515) implementation is complete.
+
+EdDSA signatures (RFC 8037) are supported (Ed25519 only).
+
+JWK Thumbprint (RFC 7638) is supported (requires /aeson/ >= 0.10).
+
JSON Web Encryption (JWE; RFC 7516) is not yet implemented.
-All JWS algorithms (HMAC, ECDSA, RSASSA-PKCS-v1_5 and RSASSA-PSS) are
-implemented, however, the ECDSA implementation is is vulnerable to timing
-attacks and should therefore only be used for JWS verification.
-
-The 'Crypto.JOSE.Legacy' module is provided for working with the Mozilla
-Persona (formerly BrowserID) key format. Only RSA keys are supported - DSA keys
-cannot be used and must be handled as opaque objects.
+The __ECDSA implementation is vulnerable to timing attacks__ and should only be
+used for verification.
%package devel
Summary: Haskell %{pkg_name} library development files
++++++ jose-0.5.0.4.tar.gz -> jose-0.6.0.3.tar.gz ++++++
++++ 4786 lines of diff (skipped)
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-intervals for openSUSE:Factory checked in at 2017-08-31 20:47:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-intervals (Old)
and /work/SRC/openSUSE:Factory/.ghc-intervals.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-intervals"
Thu Aug 31 20:47:59 2017 rev:2 rq:513404 version:0.8
Changes:
--------
--- …
[View More]/work/SRC/openSUSE:Factory/ghc-intervals/ghc-intervals.changes 2017-04-11 12:45:12.302239300 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-intervals.new/ghc-intervals.changes 2017-08-31 20:48:00.898603056 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:27 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.8.
+
+-------------------------------------------------------------------
Old:
----
intervals-0.7.2.tar.gz
New:
----
intervals-0.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-intervals.spec ++++++
--- /var/tmp/diff_new_pack.eFo14h/_old 2017-08-31 20:48:01.802476183 +0200
+++ /var/tmp/diff_new_pack.eFo14h/_new 2017-08-31 20:48:01.802476183 +0200
@@ -17,8 +17,9 @@
%global pkg_name intervals
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.7.2
+Version: 0.8
Release: 0
Summary: Interval Arithmetic
License: BSD-2-Clause
@@ -27,9 +28,17 @@
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-array-devel
+BuildRequires: ghc-cabal-doctest-devel
BuildRequires: ghc-distributive-devel
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%if %{with tests}
+BuildRequires: ghc-QuickCheck-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-doctest-devel
+BuildRequires: ghc-filepath-devel
+BuildRequires: ghc-template-haskell-devel
+%endif
%description
A 'Numeric.Interval.Interval' is a closed, convex set of floating point values.
@@ -59,6 +68,9 @@
%install
%ghc_lib_install
+%check
+%cabal_test
+
%post devel
%ghc_pkg_recache
++++++ intervals-0.7.2.tar.gz -> intervals-0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/.travis.yml new/intervals-0.8/.travis.yml
--- old/intervals-0.7.2/.travis.yml 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/.travis.yml 2017-04-28 04:15:56.000000000 +0200
@@ -1 +1,121 @@
-language: haskell
+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
+language: c
+sudo: false
+
+cache:
+ directories:
+ - $HOME/.cabsnap
+ - $HOME/.cabal/packages
+
+before_cache:
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
+
+matrix:
+ include:
+ - env: CABALVER=1.18 GHCVER=7.0.4
+ compiler: ": #GHC 7.0.4"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.0.4], sources: [hvr-ghc]}}
+ - env: CABALVER=1.18 GHCVER=7.2.2
+ compiler: ": #GHC 7.2.2"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.2.2], sources: [hvr-ghc]}}
+ - env: CABALVER=1.18 GHCVER=7.4.2
+ compiler: ": #GHC 7.4.2"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.4.2], sources: [hvr-ghc]}}
+ - env: CABALVER=1.18 GHCVER=7.6.3
+ compiler: ": #GHC 7.6.3"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.6.3], sources: [hvr-ghc]}}
+ - env: CABALVER=1.18 GHCVER=7.8.4
+ compiler: ": #GHC 7.8.4"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], 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], 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], sources: [hvr-ghc]}}
+ - env: CABALVER=1.24 GHCVER=8.2.1
+ compiler: ": #GHC 8.2.1"
+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.1], sources: [hvr-ghc]}}
+ - env: CABALVER=1.24 GHCVER=head
+ compiler: ": #GHC head"
+ addons: {apt: {packages: [cabal-install-1.24,ghc-head], sources: [hvr-ghc]}}
+
+ allow_failures:
+ - env: CABALVER=1.18 GHCVER=7.0.4
+ - env: CABALVER=1.18 GHCVER=7.2.2
+ - env: CABALVER=1.24 GHCVER=head
+
+before_install:
+ - unset CC
+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
+
+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;
+ 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.
+script:
+ # -v2 provides useful information for debugging
+ - cabal configure --enable-tests -v2
+
+ # this builds all libraries and executables
+ # (including tests/benchmarks)
+ - cabal build
+
+ # tests that a source-distribution can be generated
+ - cabal sdist
+
+ # 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:
+ - "\x0313intervals\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
+
+# EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/CHANGELOG.markdown new/intervals-0.8/CHANGELOG.markdown
--- old/intervals-0.7.2/CHANGELOG.markdown 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/CHANGELOG.markdown 2017-04-28 04:15:56.000000000 +0200
@@ -1,3 +1,13 @@
+0.8
+---
+* `Eq` and `Ord` instances are now structural
+* Deprecate `elem` and `notElem` in favor of `member` and `nonMember`
+* Add `iquot`, `irem`, `idiv`, and `imod` functions
+* Relax `Fractional` constraint in `deflate` to `Num`
+* Revamp `Setup.hs` to use `cabal-doctest`. This makes it build
+ with `Cabal-2.0`, and makes the `doctest`s work with `cabal new-build` and
+ sandboxes.
+
0.7.2
-----
* Redundant constraint cleanup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/README.markdown new/intervals-0.8/README.markdown
--- old/intervals-0.7.2/README.markdown 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/README.markdown 2017-04-28 04:15:56.000000000 +0200
@@ -1,7 +1,7 @@
intervals
==========
-[![Hackage](https://img.shields.io/hackage/v/intervals.svg)](https://hackage.haskell.org/package/intervals) [![Build Status](https://secure.travis-ci.org/ekmett/intervals.png?branch=master)](h…
+[![Hackage](https://img.shields.io/hackage/v/intervals.svg)](https://hackage.haskell.org/package/intervals) [![Build Status](https://secure.travis-ci.org/ekmett/intervals.svg?branch=master)](h…
Basic interval arithmetic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/Setup.lhs new/intervals-0.8/Setup.lhs
--- old/intervals-0.7.2/Setup.lhs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/Setup.lhs 2017-04-28 04:15:56.000000000 +0200
@@ -1,55 +1,182 @@
-#!/usr/bin/runhaskell
\begin{code}
-{-# OPTIONS_GHC -Wall #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE OverloadedStrings #-}
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 )
+#else
+
+-- Otherwise we provide a shim
+
+#ifndef MIN_VERSION_Cabal
+#define MIN_VERSION_Cabal(x,y,z) 0
+#endif
+#ifndef MIN_VERSION_directory
+#define MIN_VERSION_directory(x,y,z) 0
+#endif
+#if MIN_VERSION_Cabal(1,24,0)
+#define InstalledPackageId UnitId
+#endif
+
+import Control.Monad ( when )
import Data.List ( nub )
-import Data.Version ( showVersion )
-import Distribution.Package ( PackageName(PackageName), Package, PackageId, InstalledPackageId, packageVersion, packageName )
-import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) )
+import Data.String ( fromString )
+import Distribution.Package ( InstalledPackageId )
+import Distribution.Package ( PackageId, Package (..), packageVersion )
+import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) , Library (..), BuildInfo (..))
import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
-import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose, copyFiles )
+import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )
import Distribution.Simple.BuildPaths ( autogenModulesDir )
-import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), Flag(..), fromFlag, HaddockFlags(haddockDistPref))
-import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) )
-import Distribution.Text ( display )
-import Distribution.Verbosity ( Verbosity, normal )
+import Distribution.Simple.Setup ( BuildFlags(buildDistPref, buildVerbosity), fromFlag)
+import Distribution.Simple.LocalBuildInfo ( withPackageDB, withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps), compiler )
+import Distribution.Simple.Compiler ( showCompilerId , PackageDB (..))
+import Distribution.Text ( display , simpleParse )
import System.FilePath ( (</>) )
-main :: IO ()
-main = defaultMainWithHooks simpleUserHooks
- { buildHook = \pkg lbi hooks flags -> do
- generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi
- buildHook simpleUserHooks pkg lbi hooks flags
- , postHaddock = \args flags pkg lbi -> do
- copyFiles normal (haddockOutputDir flags pkg) []
- postHaddock simpleUserHooks args flags pkg lbi
- }
-
-haddockOutputDir :: Package p => HaddockFlags -> p -> FilePath
-haddockOutputDir flags pkg = destDir where
- baseDir = case haddockDistPref flags of
- NoFlag -> "."
- Flag x -> x
- destDir = baseDir </> "doc" </> "html" </> display (packageName pkg)
-
-generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
-generateBuildModule verbosity pkg lbi = do
- let dir = autogenModulesDir lbi
- createDirectoryIfMissingVerbose verbosity True dir
- withLibLBI pkg lbi $ \_ libcfg -> do
- withTestLBI pkg lbi $ \suite suitecfg -> do
- rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
- [ "module Build_" ++ testName suite ++ " where"
- , "deps :: [String]"
- , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
+#if MIN_VERSION_Cabal(1,25,0)
+import Distribution.Simple.BuildPaths ( autogenComponentModulesDir )
+#endif
+
+#if MIN_VERSION_directory(1,2,2)
+import System.Directory (makeAbsolute)
+#else
+import System.Directory (getCurrentDirectory)
+import System.FilePath (isAbsolute)
+
+makeAbsolute :: FilePath -> IO FilePath
+makeAbsolute p | isAbsolute p = return p
+ | otherwise = do
+ cwd <- getCurrentDirectory
+ return $ cwd </> p
+#endif
+
+generateBuildModule :: String -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
+generateBuildModule testsuiteName flags pkg lbi = do
+ let verbosity = fromFlag (buildVerbosity flags)
+ let distPref = fromFlag (buildDistPref flags)
+
+ -- Package DBs
+ let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> "package.conf.inplace" ]
+ let dbFlags = "-hide-all-packages" : packageDbArgs dbStack
+
+ withLibLBI pkg lbi $ \lib libcfg -> do
+ let libBI = libBuildInfo lib
+
+ -- modules
+ let modules = exposedModules lib ++ otherModules libBI
+ -- it seems that doctest is happy to take in module names, not actual files!
+ let module_sources = modules
+
+ -- We need the directory with library's cabal_macros.h!
+#if MIN_VERSION_Cabal(1,25,0)
+ let libAutogenDir = autogenComponentModulesDir lbi libcfg
+#else
+ let libAutogenDir = autogenModulesDir lbi
+#endif
+
+ -- Lib sources and includes
+ iArgs <- mapM (fmap ("-i"++) . makeAbsolute) $ libAutogenDir : hsSourceDirs libBI
+ includeArgs <- mapM (fmap ("-I"++) . makeAbsolute) $ includeDirs libBI
+
+ -- CPP includes, i.e. include cabal_macros.h
+ let cppFlags = map ("-optP"++) $
+ [ "-include", libAutogenDir ++ "/cabal_macros.h" ]
+ ++ cppOptions libBI
+
+ withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString testsuiteName) $ do
+
+ -- get and create autogen dir
+#if MIN_VERSION_Cabal(1,25,0)
+ let testAutogenDir = autogenComponentModulesDir lbi suitecfg
+#else
+ let testAutogenDir = autogenModulesDir lbi
+#endif
+ createDirectoryIfMissingVerbose verbosity True testAutogenDir
+
+ -- write autogen'd file
+ rewriteFile (testAutogenDir </> "Build_doctests.hs") $ unlines
+ [ "module Build_doctests where"
+ , ""
+ -- -package-id etc. flags
+ , "pkgs :: [String]"
+ , "pkgs = " ++ (show $ formatDeps $ testDeps libcfg suitecfg)
+ , ""
+ , "flags :: [String]"
+ , "flags = " ++ show (iArgs ++ includeArgs ++ dbFlags ++ cppFlags)
+ , ""
+ , "module_sources :: [String]"
+ , "module_sources = " ++ show (map display module_sources)
]
where
- formatdeps = map (formatone . snd)
- formatone p = case packageName p of
- PackageName n -> n ++ "-" ++ showVersion (packageVersion p)
+ -- we do this check in Setup, as then doctests don't need to depend on Cabal
+ isOldCompiler = maybe False id $ do
+ a <- simpleParse $ showCompilerId $ compiler lbi
+ b <- simpleParse "7.5"
+ return $ packageVersion (a :: PackageId) < b
+
+ formatDeps = map formatOne
+ formatOne (installedPkgId, pkgId)
+ -- The problem is how different cabal executables handle package databases
+ -- when doctests depend on the library
+ | packageId pkg == pkgId = "-package=" ++ display pkgId
+ | otherwise = "-package-id=" ++ display installedPkgId
+
+ -- From Distribution.Simple.Program.GHC
+ packageDbArgs :: [PackageDB] -> [String]
+ packageDbArgs | isOldCompiler = packageDbArgsConf
+ | otherwise = packageDbArgsDb
+
+ -- GHC <7.6 uses '-package-conf' instead of '-package-db'.
+ packageDbArgsConf :: [PackageDB] -> [String]
+ packageDbArgsConf dbstack = case dbstack of
+ (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs
+ (GlobalPackageDB:dbs) -> ("-no-user-package-conf")
+ : concatMap specific dbs
+ _ -> ierror
+ where
+ specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ]
+ specific _ = ierror
+ ierror = error $ "internal error: unexpected package db stack: "
+ ++ show dbstack
+
+ -- GHC >= 7.6 uses the '-package-db' flag. See
+ -- https://ghc.haskell.org/trac/ghc/ticket/5977.
+ packageDbArgsDb :: [PackageDB] -> [String]
+ -- special cases to make arguments prettier in common scenarios
+ packageDbArgsDb dbstack = case dbstack of
+ (GlobalPackageDB:UserPackageDB:dbs)
+ | all isSpecific dbs -> concatMap single dbs
+ (GlobalPackageDB:dbs)
+ | all isSpecific dbs -> "-no-user-package-db"
+ : concatMap single dbs
+ dbs -> "-clear-package-db"
+ : concatMap single dbs
+ where
+ single (SpecificPackageDB db) = [ "-package-db=" ++ db ]
+ single GlobalPackageDB = [ "-global-package-db" ]
+ single UserPackageDB = [ "-user-package-db" ]
+ isSpecific (SpecificPackageDB _) = True
+ isSpecific _ = False
testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]
testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys
+defaultMainWithDoctests :: String -> IO ()
+defaultMainWithDoctests testSuiteName = defaultMainWithHooks simpleUserHooks
+ { buildHook = \pkg lbi hooks flags -> do
+ generateBuildModule testSuiteName flags pkg lbi
+ buildHook simpleUserHooks pkg lbi hooks flags
+ }
+
+#endif
+
+main :: IO ()
+main = defaultMainWithDoctests "doctests"
+
\end{code}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/intervals.cabal new/intervals-0.8/intervals.cabal
--- old/intervals-0.7.2/intervals.cabal 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/intervals.cabal 2017-04-28 04:15:56.000000000 +0200
@@ -1,5 +1,5 @@
name: intervals
-version: 0.7.2
+version: 0.8
synopsis: Interval Arithmetic
description:
A 'Numeric.Interval.Interval' is a closed, convex set of floating point values.
@@ -17,7 +17,7 @@
category: Math
build-type: Custom
cabal-version: >=1.8
-tested-with: GHC == 7.4.2, GHC == 7.6.1, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10, GHC == 8.0.1
+tested-with: GHC == 7.4.2, GHC == 7.6.1, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1
extra-source-files:
.travis.yml
CHANGELOG.markdown
@@ -28,6 +28,12 @@
type: git
location: git://github.com/ekmett/intervals.git
+custom-setup
+ setup-depends:
+ base >= 4 && <5,
+ Cabal,
+ cabal-doctest >= 1 && <1.1
+
-- 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
@@ -72,13 +78,13 @@
ghc-options: -Wall -threaded
hs-source-dirs: tests
- if !flag(test-doctests) || impl(ghc >= 8)
+ if !flag(test-doctests)
buildable: False
else
build-depends:
base,
directory >= 1.0,
- doctest >= 0.9.1,
+ doctest >= 0.11.1 && <0.12,
filepath,
QuickCheck,
template-haskell
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/src/Numeric/Interval/Internal.hs new/intervals-0.8/src/Numeric/Interval/Internal.hs
--- old/intervals-0.7.2/src/Numeric/Interval/Internal.hs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/src/Numeric/Interval/Internal.hs 2017-04-28 04:15:56.000000000 +0200
@@ -26,6 +26,8 @@
, empty
, null
, singleton
+ , member
+ , notMember
, elem
, notElem
, inf
@@ -48,6 +50,10 @@
, possibly, (<?), (<=?), (==?), (>=?), (>?)
, idouble
, ifloat
+ , iquot
+ , irem
+ , idiv
+ , imod
) where
import Control.Exception as Exception
@@ -68,7 +74,8 @@
-- $setup
data Interval a = I !a !a | Empty deriving
- ( Data
+ ( Eq, Ord
+ , Data
, Typeable
#if __GLASGOW_HASKELL__ >= 704
, Generic
@@ -191,10 +198,6 @@
singular (I a b) = a == b
{-# INLINE singular #-}
-instance Eq a => Eq (Interval a) where
- (==) = (==!)
- {-# INLINE (==) #-}
-
instance Show a => Show (Interval a) where
showsPrec _ Empty = showString "Empty"
showsPrec n (I a b) =
@@ -295,7 +298,7 @@
--
-- >>> deflate 1.0 empty
-- Empty
-deflate :: (Fractional a, Ord a) => a -> Interval a -> Interval a
+deflate :: (Num a, Ord a) => a -> Interval a -> Interval a
deflate _ Empty = Empty
deflate x (I a b) | a' <= b' = I a' b'
| otherwise = Empty
@@ -400,6 +403,44 @@
-- | Determine if a point is in the interval.
--
+-- >>> member 3.2 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 5 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 1 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 8 (1.0 ... 5.0)
+-- False
+--
+-- >>> member 5 empty
+-- False
+--
+member :: Ord a => a -> Interval a -> Bool
+member x (I a b) = x >= a && x <= b
+member _ Empty = False
+{-# INLINE member #-}
+
+-- | Determine if a point is not included in the interval
+--
+-- >>> notMember 8 (1.0 ... 5.0)
+-- True
+--
+-- >>> notMember 1.4 (1.0 ... 5.0)
+-- False
+--
+-- And of course, nothing is a member of the empty interval.
+--
+-- >>> notMember 5 empty
+-- True
+notMember :: Ord a => a -> Interval a -> Bool
+notMember x xs = not (member x xs)
+{-# INLINE notMember #-}
+
+-- | Determine if a point is in the interval.
+--
-- >>> elem 3.2 (1.0 ... 5.0)
-- True
--
@@ -416,9 +457,9 @@
-- False
--
elem :: Ord a => a -> Interval a -> Bool
-elem x (I a b) = x >= a && x <= b
-elem _ Empty = False
+elem = member
{-# INLINE elem #-}
+{-# DEPRECATED elem "Use `member` instead." #-}
-- | Determine if a point is not included in the interval
--
@@ -433,8 +474,9 @@
-- >>> notElem 5 empty
-- True
notElem :: Ord a => a -> Interval a -> Bool
-notElem x xs = not (elem x xs)
+notElem = notMember
{-# INLINE notElem #-}
+{-# DEPRECATED notElem "Use `notMember` instead." #-}
-- | 'realToFrac' will use the midpoint
instance Real a => Real (Interval a) where
@@ -444,27 +486,6 @@
b = toRational rb
{-# INLINE toRational #-}
-instance Ord a => Ord (Interval a) where
- compare Empty Empty = EQ
- compare Empty _ = LT
- compare _ Empty = GT
- compare (I ax bx) (I ay by)
- | bx < ay = LT
- | ax > by = GT
- | bx == ay && ax == by = EQ
- | otherwise = Exception.throw AmbiguousComparison
- {-# INLINE compare #-}
-
- max (I a b) (I a' b') = max a a' ... max b b'
- max Empty i = i
- max i Empty = i
- {-# INLINE max #-}
-
- min (I a b) (I a' b') = min a a' ... min b b'
- min Empty _ = Empty
- min _ Empty = Empty
- {-# INLINE min #-}
-
-- @'divNonZero' X Y@ assumes @0 `'notElem'` Y@
divNonZero :: (Fractional a, Ord a) => Interval a -> Interval a -> Interval a
divNonZero (I a b) (I a' b') =
@@ -886,3 +907,58 @@
-- sin 1 :: Interval Double
default (Integer,Double)
+
+-- | an interval containing all x `quot` y
+-- >>> (5 `quot` 3) `member` ((4...6) `iquot` (2...4))
+-- True
+-- >>> (1...10) `iquot` ((-5)...4)
+-- *** Exception: divide by zero
+iquot :: Integral a => Interval a -> Interval a -> Interval a
+iquot i j = case (i,j) of
+ (Empty,_) -> Empty
+ (_,Empty) -> Empty
+ (I l u , I l' u') ->
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [a `quot` b | a <- [l,u], b <- [l',u']])
+ (maximum [a `quot` b | a <- [l,u], b <- [l',u']])
+
+-- | an interval containing all x `rem` y
+-- >>> (5 `rem` 3) `member` ((4...6) `irem` (2...4))
+-- True
+-- >>> (1...10) `irem` ((-5)...4)
+-- *** Exception: divide by zero
+irem :: Integral a => Interval a -> Interval a -> Interval a
+irem i j = case (i,j) of
+ (Empty,_) -> Empty
+ (_,Empty) -> Empty
+ (I l u , I l' u') ->
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [0, signum l * (abs u' - 1), signum l * (abs l' - 1)])
+ (maximum [0, signum u * (abs u' - 1), signum u * (abs l' - 1)])
+
+-- | an interval containing all x `div` y
+-- >>> (5 `div` 3) `member` ((4...6) `idiv` (2...4))
+-- True
+-- >>> (1...10) `idiv` ((-5)...4)
+-- *** Exception: divide by zero
+idiv :: Integral a => Interval a -> Interval a -> Interval a
+idiv i j = case (i,j) of
+ (Empty,_) -> Empty
+ (_,Empty) -> Empty
+ (I l u , I l' u') ->
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (min (l `Prelude.div` max 1 l') (u `Prelude.div` min (-1) u'))
+ (max (u `Prelude.div` max 1 l') (l `Prelude.div` min (-1) u'))
+
+-- | an interval containing all x `mod` y
+-- >>> (5 `mod` 3) `member` ((4...6) `imod` (2...4))
+-- True
+-- >>> (1...10) `imod` ((-5)...4)
+-- *** Exception: divide by zero
+imod :: Integral a => Interval a -> Interval a -> Interval a
+imod i j = case (i,j) of
+ (Empty,_) -> Empty
+ (_,Empty) -> Empty
+ (_ , I l' u') ->
+ if l' <= 0 && 0 <= u' then throw DivideByZero else
+ I (min (l'+1) 0) (max 0 (u'-1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/src/Numeric/Interval/Kaucher.hs new/intervals-0.8/src/Numeric/Interval/Kaucher.hs
--- old/intervals-0.7.2/src/Numeric/Interval/Kaucher.hs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/src/Numeric/Interval/Kaucher.hs 2017-04-28 04:15:56.000000000 +0200
@@ -13,7 +13,7 @@
-- Stability : experimental
-- Portability : DeriveDataTypeable
--
--- "Directed" Interval arithmetic
+-- \"Directed\" Interval arithmetic
--
-----------------------------------------------------------------------------
@@ -25,6 +25,8 @@
, empty
, null
, singleton
+ , member
+ , notMember
, elem
, notElem
, inf
@@ -47,6 +49,10 @@
, clamp
, idouble
, ifloat
+ , iquot
+ , irem
+ , idiv
+ , imod
) where
import Control.Applicative hiding (empty)
@@ -70,7 +76,8 @@
-- $setup
data Interval a = I !a !a deriving
- ( Data
+ ( Eq, Ord
+ , Data
, Typeable
#if __GLASGOW_HASKELL__ >= 704
, Generic
@@ -207,10 +214,6 @@
singular x = not (null x) && inf x == sup x
{-# INLINE singular #-}
-instance Eq a => Eq (Interval a) where
- (==) = (==!)
- {-# INLINE (==) #-}
-
instance Show a => Show (Interval a) where
showsPrec n (I a b) =
showParen (n > 3) $
@@ -379,6 +382,43 @@
-- | Determine if a point is in the interval.
--
+-- >>> member 3.2 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 5 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 1 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 8 (1.0 ... 5.0)
+-- False
+--
+-- >>> member 5 empty
+-- False
+--
+member :: Ord a => a -> Interval a -> Bool
+member x (I a b) = x >= a && x <= b
+{-# INLINE member #-}
+
+-- | Determine if a point is not included in the interval
+--
+-- >>> notMember 8 (1.0 ... 5.0)
+-- True
+--
+-- >>> notMember 1.4 (1.0 ... 5.0)
+-- False
+--
+-- And of course, nothing is a member of the empty interval.
+--
+-- >>> notMember 5 empty
+-- True
+notMember :: Ord a => a -> Interval a -> Bool
+notMember x xs = not (member x xs)
+{-# INLINE notMember #-}
+
+-- | Determine if a point is in the interval.
+--
-- >>> elem 3.2 (1.0 ... 5.0)
-- True
--
@@ -395,8 +435,9 @@
-- False
--
elem :: Ord a => a -> Interval a -> Bool
-elem x xs = x >= inf xs && x <= sup xs
+elem = member
{-# INLINE elem #-}
+{-# DEPRECATED elem "Use `member` instead." #-}
-- | Determine if a point is not included in the interval
--
@@ -411,8 +452,9 @@
-- >>> notElem 5 empty
-- True
notElem :: Ord a => a -> Interval a -> Bool
-notElem x xs = not (elem x xs)
+notElem = notMember
{-# INLINE notElem #-}
+{-# DEPRECATED notElem "Use `notMember` instead." #-}
-- | 'realToFrac' will use the midpoint
instance Real a => Real (Interval a) where
@@ -424,20 +466,6 @@
b = toRational (sup x)
{-# INLINE toRational #-}
-instance Ord a => Ord (Interval a) where
- compare x y
- | sup x < inf y = LT
- | inf x > sup y = GT
- | sup x == inf y && inf x == sup y = EQ
- | otherwise = Exception.throw AmbiguousComparison
- {-# INLINE compare #-}
-
- max (I a b) (I a' b') = max a a' ... max b b'
- {-# INLINE max #-}
-
- min (I a b) (I a' b') = min a a' ... min b b'
- {-# INLINE min #-}
-
-- @'divNonZero' X Y@ assumes @0 `'notElem'` Y@
divNonZero :: (Fractional a, Ord a) => Interval a -> Interval a -> Interval a
divNonZero (I a b) (I a' b') =
@@ -829,3 +857,46 @@
default (Integer,Double)
+
+-- | an interval containing all x `quot` y
+-- >>> (5 `quot` 3) `member` ((4...6) `iquot` (2...4))
+-- True
+-- >>> (1...10) `iquot` ((-5)...4)
+-- *** Exception: divide by zero
+iquot :: Integral a => Interval a -> Interval a -> Interval a
+iquot (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [a `quot` b | a <- [l,u], b <- [l',u']])
+ (maximum [a `quot` b | a <- [l,u], b <- [l',u']])
+
+-- | an interval containing all x `rem` y
+-- >>> (5 `rem` 3) `member` ((4...6) `irem` (2...4))
+-- True
+-- >>> (1...10) `irem` ((-5)...4)
+-- *** Exception: divide by zero
+irem :: Integral a => Interval a -> Interval a -> Interval a
+irem (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [0, signum l * (abs u' - 1), signum l * (abs l' - 1)])
+ (maximum [0, signum u * (abs u' - 1), signum u * (abs l' - 1)])
+
+-- | an interval containing all x `div` y
+-- >>> (5 `div` 3) `member` ((4...6) `idiv` (2...4))
+-- True
+-- >>> (1...10) `idiv` ((-5)...4)
+-- *** Exception: divide by zero
+idiv :: Integral a => Interval a -> Interval a -> Interval a
+idiv (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (min (l `Prelude.div` max 1 l') (u `Prelude.div` min (-1) u'))
+ (max (u `Prelude.div` max 1 l') (l `Prelude.div` min (-1) u'))
+
+-- | an interval containing all x `mod` y
+-- >>> (5 `mod` 3) `member` ((4...6) `imod` (2...4))
+-- True
+-- >>> (1...10) `imod` ((-5)...4)
+-- *** Exception: divide by zero
+imod :: Integral a => Interval a -> Interval a -> Interval a
+imod _ (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else
+ I (min (l'+1) 0) (max 0 (u'-1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/src/Numeric/Interval/NonEmpty/Internal.hs new/intervals-0.8/src/Numeric/Interval/NonEmpty/Internal.hs
--- old/intervals-0.7.2/src/Numeric/Interval/NonEmpty/Internal.hs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/src/Numeric/Interval/NonEmpty/Internal.hs 2017-04-28 04:15:56.000000000 +0200
@@ -22,6 +22,8 @@
, interval
, whole
, singleton
+ , member
+ , notMember
, elem
, notElem
, inf
@@ -45,6 +47,10 @@
, scale, symmetric
, idouble
, ifloat
+ , iquot
+ , irem
+ , idiv
+ , imod
) where
import Control.Exception as Exception
@@ -66,15 +72,16 @@
-- >>> :set -XExtendedDefaultRules
-- >>> default (Integer,Double)
-- >>> instance (Ord a, Arbitrary a) => Arbitrary (Interval a) where arbitrary = (...) <$> arbitrary <*> arbitrary
--- >>> let elementOf xs = sized $ \n -> case n of { 0 -> pure $ inf xs; 1 -> pure $ sup xs; _ -> choose (inf xs, sup xs); }
--- >>> let conservative sf f xs = forAll (choose (inf xs, sup xs)) $ \x -> (sf x) `elem` (f xs)
--- >>> let conservative2 sf f xs ys = forAll ((,) <$> choose (inf xs, sup xs) <*> choose (inf ys, sup ys)) $ \(x,y) -> (sf x y) `elem` (f xs ys)
--- >>> let conservativeExceptNaN sf f xs = forAll (choose (inf xs, sup xs)) $ \x -> isNaN (sf x) || (sf x) `elem` (f xs)
+-- >>> let memberOf xs = sized $ \n -> case n of { 0 -> pure $ inf xs; 1 -> pure $ sup xs; _ -> choose (inf xs, sup xs); }
+-- >>> let conservative sf f xs = forAll (choose (inf xs, sup xs)) $ \x -> (sf x) `member` (f xs)
+-- >>> let conservative2 sf f xs ys = forAll ((,) <$> choose (inf xs, sup xs) <*> choose (inf ys, sup ys)) $ \(x,y) -> (sf x y) `member` (f xs ys)
+-- >>> let conservativeExceptNaN sf f xs = forAll (choose (inf xs, sup xs)) $ \x -> isNaN (sf x) || (sf x) `member` (f xs)
-- >>> let compose2 = fmap . fmap
-- >>> let commutative op a b = (a `op` b) == (b `op` a)
data Interval a = I !a !a deriving
- ( Data
+ ( Eq, Ord
+ , Data
, Typeable
#if __GLASGOW_HASKELL__ >= 704
, Generic
@@ -194,10 +201,6 @@
singular (I a b) = a == b
{-# INLINE singular #-}
-instance Eq a => Eq (Interval a) where
- (==) = (==!)
- {-# INLINE (==) #-}
-
instance Show a => Show (Interval a) where
showsPrec n (I a b) =
showParen (n > 3) $
@@ -331,6 +334,34 @@
-- | Determine if a point is in the interval.
--
+-- >>> member 3.2 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 5 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 1 (1.0 ... 5.0)
+-- True
+--
+-- >>> member 8 (1.0 ... 5.0)
+-- False
+member :: Ord a => a -> Interval a -> Bool
+member x (I a b) = x >= a && x <= b
+{-# INLINE member #-}
+
+-- | Determine if a point is not included in the interval
+--
+-- >>> notMember 8 (1.0 ... 5.0)
+-- True
+--
+-- >>> notMember 1.4 (1.0 ... 5.0)
+-- False
+notMember :: Ord a => a -> Interval a -> Bool
+notMember x xs = not (member x xs)
+{-# INLINE notMember #-}
+
+-- | Determine if a point is in the interval.
+--
-- >>> elem 3.2 (1.0 ... 5.0)
-- True
--
@@ -343,8 +374,9 @@
-- >>> elem 8 (1.0 ... 5.0)
-- False
elem :: Ord a => a -> Interval a -> Bool
-elem x (I a b) = x >= a && x <= b
+elem = member
{-# INLINE elem #-}
+{-# DEPRECATED elem "Use `member` instead." #-}
-- | Determine if a point is not included in the interval
--
@@ -354,8 +386,9 @@
-- >>> notElem 1.4 (1.0 ... 5.0)
-- False
notElem :: Ord a => a -> Interval a -> Bool
-notElem x xs = not (elem x xs)
+notElem = notMember
{-# INLINE notElem #-}
+{-# DEPRECATED notElem "Use `notMember` instead." #-}
-- | 'realToFrac' will use the midpoint
instance Real a => Real (Interval a) where
@@ -364,20 +397,6 @@
b = toRational rb
{-# INLINE toRational #-}
-instance Ord a => Ord (Interval a) where
- compare (I ax bx) (I ay by)
- | bx < ay = LT
- | ax > by = GT
- | bx == ay && ax == by = EQ
- | otherwise = Exception.throw AmbiguousComparison
- {-# INLINE compare #-}
-
- max (I a b) (I a' b') = max a a' ... max b b'
- {-# INLINE max #-}
-
- min (I a b) (I a' b') = min a a' ... min b b'
- {-# INLINE min #-}
-
-- @'divNonZero' X Y@ assumes @0 `'notElem'` Y@
divNonZero :: (Fractional a, Ord a) => Interval a -> Interval a -> Interval a
divNonZero (I a b) (I a' b') =
@@ -822,3 +841,38 @@
-- sin 1 :: Interval Double
default (Integer,Double)
+
+-- | an interval containing all x `quot` y
+-- prop> forAll (memberOf xs) $ \ x -> forAll (memberOf ys) $ \ y -> 0 `notMember` ys ==> (x `quot` y) `member` (xs `iquot` ys)
+-- prop> 0 `member` ys ==> ioProperty $ do z <- try (evaluate (xs `iquot` ys)); return $ z === Left DivideByZero
+iquot :: Integral a => Interval a -> Interval a -> Interval a
+iquot (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [a `quot` b | a <- [l,u], b <- [l',u']])
+ (maximum [a `quot` b | a <- [l,u], b <- [l',u']])
+
+-- | an interval containing all x `rem` y
+-- prop> forAll (memberOf xs) $ \ x -> forAll (memberOf ys) $ \ y -> 0 `notMember` ys ==> (x `rem` y) `member` (xs `irem` ys)
+-- prop> 0 `member` ys ==> ioProperty $ do z <- try (evaluate (xs `irem` ys)); return $ z === Left DivideByZero
+irem :: Integral a => Interval a -> Interval a -> Interval a
+irem (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (minimum [0, signum l * (abs u' - 1), signum l * (abs l' - 1)])
+ (maximum [0, signum u * (abs u' - 1), signum u * (abs l' - 1)])
+
+-- | an interval containing all x `div` y
+-- prop> forAll (memberOf xs) $ \ x -> forAll (memberOf ys) $ \ y -> 0 `notMember` ys ==> (x `div` y) `member` (xs `idiv` ys)
+-- prop> 0 `member` ys ==> ioProperty $ do z <- try (evaluate (xs `idiv` ys)); return $ z === Left DivideByZero
+idiv :: Integral a => Interval a -> Interval a -> Interval a
+idiv (I l u) (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else I
+ (min (l `Prelude.div` max 1 l') (u `Prelude.div` min (-1) u'))
+ (max (u `Prelude.div` max 1 l') (l `Prelude.div` min (-1) u'))
+
+-- | an interval containing all x `mod` y
+-- prop> forAll (memberOf xs) $ \ x -> forAll (memberOf ys) $ \ y -> 0 `notMember` ys ==> (x `mod` y) `member` (xs `imod` ys)
+-- prop> 0 `member` ys ==> ioProperty $ do z <- try (evaluate (xs `imod` ys)); return $ z === Left DivideByZero
+imod :: Integral a => Interval a -> Interval a -> Interval a
+imod _ (I l' u') =
+ if l' <= 0 && 0 <= u' then throw DivideByZero else
+ I (min (l'+1) 0) (max 0 (u'-1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/src/Numeric/Interval/NonEmpty.hs new/intervals-0.8/src/Numeric/Interval/NonEmpty.hs
--- old/intervals-0.7.2/src/Numeric/Interval/NonEmpty.hs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/src/Numeric/Interval/NonEmpty.hs 2017-04-28 04:15:56.000000000 +0200
@@ -23,6 +23,8 @@
, interval
, whole
, singleton
+ , member
+ , notMember
, elem
, notElem
, inf
@@ -46,6 +48,10 @@
, scale, symmetric
, idouble
, ifloat
+ , iquot
+ , irem
+ , idiv
+ , imod
) where
import Numeric.Interval.NonEmpty.Internal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/src/Numeric/Interval.hs new/intervals-0.8/src/Numeric/Interval.hs
--- old/intervals-0.7.2/src/Numeric/Interval.hs 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/src/Numeric/Interval.hs 2017-04-28 04:15:56.000000000 +0200
@@ -18,6 +18,8 @@
, empty
, null
, singleton
+ , member
+ , notMember
, elem
, notElem
, inf
@@ -40,6 +42,10 @@
, possibly, (<?), (<=?), (==?), (>=?), (>?)
, idouble
, ifloat
+ , iquot
+ , irem
+ , idiv
+ , imod
) where
import Numeric.Interval.Internal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/tests/doctests.hs new/intervals-0.8/tests/doctests.hs
--- old/intervals-0.7.2/tests/doctests.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/intervals-0.8/tests/doctests.hs 2017-04-28 04:15:56.000000000 +0200
@@ -0,0 +1,25 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : Main (doctests)
+-- Copyright : (C) 2012-14 Edward Kmett
+-- License : BSD-style (see the file LICENSE)
+-- Maintainer : Edward Kmett <ekmett(a)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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/intervals-0.7.2/tests/doctests.hsc new/intervals-0.8/tests/doctests.hsc
--- old/intervals-0.7.2/tests/doctests.hsc 2016-01-17 06:13:04.000000000 +0100
+++ new/intervals-0.8/tests/doctests.hsc 1970-01-01 01:00:00.000000000 +0100
@@ -1,76 +0,0 @@
-{-# LANGUAGE CPP #-}
-{-# LANGUAGE ForeignFunctionInterface #-}
------------------------------------------------------------------------------
--- |
--- Module : Main (doctests)
--- Copyright : (C) 2012-13 Edward Kmett
--- License : BSD-style (see the file LICENSE)
--- Maintainer : Edward Kmett <ekmett(a)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 (deps)
-#if __GLASGOW_HASKELL__ < 710
-import Control.Applicative
-#endif
-import Control.Monad
-import Data.List
-import System.Directory
-import System.FilePath
-import Test.DocTest
-
-##if defined(mingw32_HOST_OS)
-##if defined(i386_HOST_ARCH)
-##define USE_CP
-import Control.Applicative
-import Control.Exception
-import Foreign.C.Types
-foreign import stdcall "windows.h SetConsoleCP" c_SetConsoleCP :: CUInt -> IO Bool
-foreign import stdcall "windows.h GetConsoleCP" c_GetConsoleCP :: IO CUInt
-##elif defined(x86_64_HOST_ARCH)
-##define USE_CP
-import Control.Applicative
-import Control.Exception
-import Foreign.C.Types
-foreign import ccall "windows.h SetConsoleCP" c_SetConsoleCP :: CUInt -> IO Bool
-foreign import ccall "windows.h GetConsoleCP" c_GetConsoleCP :: IO CUInt
-##endif
-##endif
-
--- | Run in a modified codepage where we can print UTF-8 values on Windows.
-withUnicode :: IO a -> IO a
-##ifdef USE_CP
-withUnicode m = do
- cp <- c_GetConsoleCP
- (c_SetConsoleCP 65001 >> m) `finally` c_SetConsoleCP cp
-##else
-withUnicode m = m
-##endif
-
-main :: IO ()
-main = withUnicode $ getSources >>= \sources -> doctest $
- "-isrc"
- : "-idist/build/autogen"
- : "-optP-include"
- : "-optPdist/build/autogen/cabal_macros.h"
- : "-packageQuickCheck"
- : "-hide-all-packages"
- : map ("-package="++) deps ++ sources
-
-getSources :: IO [FilePath]
-getSources = filter (isSuffixOf ".hs") <$> go "src"
- where
- go dir = do
- (dirs, files) <- getFilesAndDirectories dir
- (files ++) . concat <$> mapM go dirs
-
-getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath])
-getFilesAndDirectories dir = do
- c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir
- (,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-interpolate for openSUSE:Factory checked in at 2017-08-31 20:47:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-interpolate (Old)
and /work/SRC/openSUSE:Factory/.ghc-interpolate.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-interpolate"
Thu Aug 31 20:47:57 2017 rev:3 rq:513403 version:0.1.1
Changes:
---…
[View More]-----
--- /work/SRC/openSUSE:Factory/ghc-interpolate/ghc-interpolate.changes 2017-06-22 10:38:00.617778130 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-interpolate.new/ghc-interpolate.changes 2017-08-31 20:47:57.967014553 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:05:24 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.1.1.
+
+-------------------------------------------------------------------
Old:
----
interpolate-0.1.0.tar.gz
interpolate.cabal
New:
----
interpolate-0.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-interpolate.spec ++++++
--- /var/tmp/diff_new_pack.4YbzDh/_old 2017-08-31 20:47:58.902883188 +0200
+++ /var/tmp/diff_new_pack.4YbzDh/_new 2017-08-31 20:47:58.906882626 +0200
@@ -19,14 +19,13 @@
%global pkg_name interpolate
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.0
+Version: 0.1.1
Release: 0
Summary: String interpolation done right
License: MIT
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-haskell-src-meta-devel
BuildRequires: ghc-rpm-macros
@@ -56,7 +55,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ interpolate-0.1.0.tar.gz -> interpolate-0.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/LICENSE new/interpolate-0.1.1/LICENSE
--- old/interpolate-0.1.0/LICENSE 2014-09-29 09:01:15.000000000 +0200
+++ new/interpolate-0.1.1/LICENSE 2017-05-31 05:51:32.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (c) 2013 Simon Hengel <sol(a)typeful.net>
+Copyright (c) 2013-2015 Simon Hengel <sol(a)typeful.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/interpolate.cabal new/interpolate-0.1.1/interpolate.cabal
--- old/interpolate-0.1.0/interpolate.cabal 2014-09-29 09:01:15.000000000 +0200
+++ new/interpolate-0.1.1/interpolate.cabal 2017-05-31 05:51:32.000000000 +0200
@@ -1,12 +1,18 @@
+-- This file has been generated from package.yaml by hpack version 0.17.0.
+--
+-- see: https://github.com/sol/hpack
+
name: interpolate
-version: 0.1.0
+version: 0.1.1
+homepage: https://github.com/sol/interpolate#readme
+bug-reports: https://github.com/sol/interpolate/issues
license: MIT
license-file: LICENSE
-copyright: (c) 2013 Simon Hengel
+copyright: (c) 2013-2015 Simon Hengel
author: Simon Hengel <sol(a)typeful.net>
maintainer: Simon Hengel <sol(a)typeful.net>
build-type: Simple
-cabal-version: >= 1.8
+cabal-version: >= 1.10
category: Data, Text
stability: experimental
synopsis: String interpolation done right
@@ -17,8 +23,6 @@
location: https://github.com/sol/interpolate
library
- ghc-options:
- -Wall
hs-source-dirs:
src
exposed-modules:
@@ -26,30 +30,43 @@
Data.String.Interpolate.IsString
Data.String.Interpolate.Util
other-modules:
+ Data.String.Interpolate.Compat
Data.String.Interpolate.Internal.Util
Data.String.Interpolate.Parse
- Data.String.Interpolate.Compat
+ Paths_interpolate
build-depends:
- base == 4.*
+ base == 4.*
, template-haskell
- , haskell-src-meta
+ , haskell-src-meta >= 0.8
+ ghc-options: -Wall
+ default-language: Haskell2010
test-suite spec
- type:
- exitcode-stdio-1.0
- ghc-options:
- -Wall
+ type: exitcode-stdio-1.0
hs-source-dirs:
- src, test
- main-is:
- Spec.hs
+ src
+ test
+ main-is: Spec.hs
+ other-modules:
+ Data.String.Interpolate
+ Data.String.Interpolate.Compat
+ Data.String.Interpolate.Internal.Util
+ Data.String.Interpolate.IsString
+ Data.String.Interpolate.Parse
+ Data.String.Interpolate.Util
+ Data.String.Interpolate.Internal.UtilSpec
+ Data.String.Interpolate.IsStringSpec
+ Data.String.Interpolate.ParseSpec
+ Data.String.Interpolate.UtilSpec
+ Data.String.InterpolateSpec
build-depends:
- base == 4.*
+ base == 4.*
, template-haskell
- , haskell-src-meta
-
+ , haskell-src-meta >= 0.8
, text
, bytestring
, hspec >= 1.5
, QuickCheck
, quickcheck-instances
+ ghc-options: -Wall
+ default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/src/Data/String/Interpolate.hs new/interpolate-0.1.1/src/Data/String/Interpolate.hs
--- old/interpolate-0.1.0/src/Data/String/Interpolate.hs 2014-09-29 09:01:15.000000000 +0200
+++ new/interpolate-0.1.1/src/Data/String/Interpolate.hs 2017-05-31 05:51:32.000000000 +0200
@@ -11,7 +11,7 @@
) where
import Language.Haskell.TH.Quote (QuasiQuoter(..))
-import Language.Haskell.Meta.Parse.Careful (parseExp)
+import Language.Haskell.Meta.Parse (parseExp)
import Data.String.Interpolate.Internal.Util
import Data.String.Interpolate.Parse
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/Internal/UtilSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/Internal/UtilSpec.hs
--- old/interpolate-0.1.0/test/Data/String/Interpolate/Internal/UtilSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/interpolate-0.1.1/test/Data/String/Interpolate/Internal/UtilSpec.hs 2017-05-31 05:51:32.000000000 +0200
@@ -0,0 +1,84 @@
+{-# LANGUAGE CPP #-}
+module Data.String.Interpolate.Internal.UtilSpec where
+
+import Test.Hspec
+import Test.QuickCheck
+import Test.QuickCheck.Instances ()
+
+import qualified Data.Text as T
+import qualified Data.Text.Lazy as LT
+import qualified Data.ByteString.Char8 as B
+import qualified Data.ByteString.Lazy.Char8 as LB
+
+import Data.String.Interpolate.Internal.Util
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+ describe "toString" $ do
+ it "behaves like `show`" $ do
+ property $ \n -> toString (n :: Int) `shouldBe` show n
+
+ context "when used with String" $ do
+ it "behaves like `id`" $ do
+ property $ \s -> toString s `shouldBe` s
+
+ context "when used with Text" $ do
+ it "behaves like `unpack`" $ do
+ property $ \s -> toString s `shouldBe` T.unpack s
+
+ context "when used with lazy Text" $ do
+ it "behaves like `unpack`" $ do
+ property $ \s -> toString s `shouldBe` LT.unpack s
+
+ context "when used with ByteString" $ do
+ it "behaves like `unpack`" $ do
+ property $ \s -> toString s `shouldBe` B.unpack s
+
+ context "when used with lazy ByteString" $ do
+ it "behaves like `unpack`" $ do
+ property $ \s -> do
+#if __GLASGOW_HASKELL__ < 706
+ pendingWith "Does not work with GHC < 7.6"
+#endif
+ toString s `shouldBe` LB.unpack s
+
+ describe "unescape" $ do
+ it "unescapes single-character escape codes" $ do
+ unescape "\\n" `shouldBe` "\n"
+
+ it "unescapes ASCII control code abbreviations" $ do
+ unescape "\\BEL" `shouldBe` "\BEL"
+
+ it "unescapes decimal character literals" $ do
+ unescape "\\955" `shouldBe` "\955"
+
+ it "unescapes hexadecimal character literals" $ do
+ unescape "\\xbeef" `shouldBe` "\xbeef"
+
+ it "unescapes octal character literals" $ do
+ unescape "\\o1234" `shouldBe` "\o1234"
+
+ context "with control escape sequences" $ do
+ it "unescapes null character" $ do
+ unescape "\\^@" `shouldBe` "\^@"
+
+ it "unescapes control codes" $ do
+ unescape "\\^A" `shouldBe` "\^A"
+
+ it "unescapes escape" $ do
+ unescape "\\^[" `shouldBe` "\^["
+
+ it "unescapes file separator" $ do
+ unescape "\\^\\ x" `shouldBe` "\^\ x"
+
+ it "unescapes group separator" $ do
+ unescape "\\^]" `shouldBe` "\^]"
+
+ it "unescapes record separator" $ do
+ unescape "\\^^" `shouldBe` "\^^"
+
+ it "unescapes unit separator" $ do
+ unescape "\\^_" `shouldBe` "\^_"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/IsStringSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/IsStringSpec.hs
--- old/interpolate-0.1.0/test/Data/String/Interpolate/IsStringSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/interpolate-0.1.1/test/Data/String/Interpolate/IsStringSpec.hs 2017-05-31 05:51:32.000000000 +0200
@@ -0,0 +1,19 @@
+{-# LANGUAGE QuasiQuotes #-}
+module Data.String.Interpolate.IsStringSpec (main, spec) where
+
+import Test.Hspec
+
+import qualified Data.Text as T
+import Data.String.Interpolate.IsString
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+ describe "[i|...|]" $ do
+ it "can be used to construct String literals" $ do
+ [i|foo #{23 :: Int} bar|] `shouldBe` "foo 23 bar"
+
+ it "can be used to construct Text literals" $ do
+ [i|foo #{23 :: Int} bar|] `shouldBe` T.pack "foo 23 bar"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/ParseSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/ParseSpec.hs
--- old/interpolate-0.1.0/test/Data/String/Interpolate/ParseSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/interpolate-0.1.1/test/Data/String/Interpolate/ParseSpec.hs 2017-05-31 05:51:32.000000000 +0200
@@ -0,0 +1,26 @@
+{-# LANGUAGE StandaloneDeriving #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+module Data.String.Interpolate.ParseSpec (main, spec) where
+
+import Test.Hspec
+
+import Data.String.Interpolate.Parse
+
+deriving instance Eq Node
+deriving instance Show Node
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+ describe "parseNodes" $ do
+ it "parses string literals" $ do
+ parseNodes "foo" `shouldBe` [Literal "foo"]
+
+ it "parses embedded expressions" $ do
+ parseNodes "foo #{bar} baz" `shouldBe` [Literal "foo ", Expression "bar", Literal " baz"]
+
+ context "when given an unterminated expression" $ do
+ it "parses it as a string literal" $ do
+ parseNodes "foo #{bar" `shouldBe` [Literal "foo #{bar"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/Interpolate/UtilSpec.hs new/interpolate-0.1.1/test/Data/String/Interpolate/UtilSpec.hs
--- old/interpolate-0.1.0/test/Data/String/Interpolate/UtilSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/interpolate-0.1.1/test/Data/String/Interpolate/UtilSpec.hs 2017-05-31 05:51:32.000000000 +0200
@@ -0,0 +1,55 @@
+module Data.String.Interpolate.UtilSpec (main, spec) where
+
+import Test.Hspec
+import Test.QuickCheck
+import Control.Applicative
+
+import Data.String.Interpolate.Util
+
+main :: IO ()
+main = hspec spec
+
+emptyLine :: Gen String
+emptyLine = (++ "\n") <$> listOf (elements " \t")
+
+spec :: Spec
+spec = do
+ describe "unindent" $ do
+ it "removes indentation" $ do
+ let xs = " foo\n bar\n baz \n"
+ unindent xs `shouldBe` " foo\nbar\n baz \n"
+
+ it "removes the first line of the string if it is empty" $ do
+ forAll emptyLine $ \xs -> do
+ let ys = " foo\nbar\n baz\n"
+ unindent (xs ++ ys) `shouldBe` ys
+
+ it "does not affect additional empty lines at the beginning" $ do
+ unindent " \n \nfoo" `shouldBe` " \nfoo"
+
+ it "empties the last line if it only consists of spaces" $ do
+ let xs = "foo\n "
+ unindent xs `shouldBe` "foo\n"
+
+ it "does not affect other whitespace lines at the end" $ do
+ unindent "foo\n \n " `shouldBe` "foo\n \n"
+
+ it "disregards empty lines when calculating indentation" $ do
+ let xs = " foo\n\n \n bar\n"
+ unindent xs `shouldBe` "foo\n\n\nbar\n"
+
+ it "correctly handles strings that do not end with a newline" $ do
+ let xs = "foo"
+ unindent xs `shouldBe` xs
+
+ it "does not affect lines consisting of whitespace (apart from unindenting)" $ do
+ unindent " foo\n \n bar" `shouldBe` "foo\n \nbar"
+
+ it "is total" $ do
+ property $ \xs -> length (unindent xs) `shouldSatisfy` (>= 0)
+
+ context "when all lines are empty" $ do
+ it "does not unindent at all" $ do
+ forAll emptyLine $ \x -> (forAll $ listOf emptyLine) $ \xs -> do
+ let ys = concat xs
+ unindent (x ++ ys) `shouldBe` ys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/interpolate-0.1.0/test/Data/String/InterpolateSpec.hs new/interpolate-0.1.1/test/Data/String/InterpolateSpec.hs
--- old/interpolate-0.1.0/test/Data/String/InterpolateSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/interpolate-0.1.1/test/Data/String/InterpolateSpec.hs 2017-05-31 05:51:32.000000000 +0200
@@ -0,0 +1,34 @@
+{-# LANGUAGE QuasiQuotes #-}
+module Data.String.InterpolateSpec (main, spec) where
+
+import Test.Hspec
+import Test.QuickCheck
+
+import Data.String.Interpolate
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+ describe "[i|...|]" $ do
+ it "interpolates an expression of type Int" $ do
+ property $ \x y -> [i|foo #{x + y :: Int} bar|] `shouldBe` "foo " ++ show (x + y) ++ " bar"
+
+ it "interpolates an expression of type String" $ do
+ property $ \xs ys -> [i|foo #{xs ++ ys} bar|] `shouldBe` "foo " ++ xs ++ ys ++ " bar"
+
+ it "accepts character escapes" $ do
+ [i|foo \955 bar|] `shouldBe` "foo \955 bar"
+
+ it "accepts character escapes in interpolated expressions" $ do
+ [i|foo #{"\955" :: String} bar|] `shouldBe` "foo \955 bar"
+
+ it "dose not strip backslashes (issue #1)" $ do
+ [i|foo\\bar|] `shouldBe` "foo\\bar"
+
+ it "allows to prevent interpolation by escaping the hash with a backslash" $ do
+ [i|foo \#{23 :: Int} bar|] `shouldBe` "foo #{23 :: Int} bar"
+
+ it "does not prevent interpolation on literal backslash" $ do
+ [i|foo \\#{23 :: Int} bar|] `shouldBe` "foo \\23 bar"
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-integer-logarithms for openSUSE:Factory checked in at 2017-08-31 20:47:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-integer-logarithms (Old)
and /work/SRC/openSUSE:Factory/.ghc-integer-logarithms.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-integer-logarithms"
Thu Aug 31 20:47:55 2017 rev:3 rq:…
[View More]513402 version:1.0.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-integer-logarithms/ghc-integer-logarithms.changes 2017-04-20 20:55:51.130372225 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-integer-logarithms.new/ghc-integer-logarithms.changes 2017-08-31 20:47:56.379237422 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:31 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.0.2.
+
+-------------------------------------------------------------------
Old:
----
integer-logarithms-1.0.1.tar.gz
integer-logarithms.cabal
New:
----
integer-logarithms-1.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-integer-logarithms.spec ++++++
--- /var/tmp/diff_new_pack.rCVbTA/_old 2017-08-31 20:47:57.571070129 +0200
+++ /var/tmp/diff_new_pack.rCVbTA/_new 2017-08-31 20:47:57.595066762 +0200
@@ -19,14 +19,13 @@
%global pkg_name integer-logarithms
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.0.1
+Version: 1.0.2
Release: 0
Summary: Integer logarithms
License: MIT
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-array-devel
BuildRequires: ghc-rpm-macros
@@ -62,7 +61,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ integer-logarithms-1.0.1.tar.gz -> integer-logarithms-1.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/changelog.md new/integer-logarithms-1.0.2/changelog.md
--- old/integer-logarithms-1.0.1/changelog.md 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/changelog.md 2017-07-07 14:03:58.000000000 +0200
@@ -1,3 +1,9 @@
+1.0.2
+-----
+
+- Deprecate `Math.NumberTheory.Power.Integer` and `Math.NumberTheory.Power.Natural` modules
+ `(^)` is as good as custom methods.
+
1.0.1
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/integer-logarithms.cabal new/integer-logarithms-1.0.2/integer-logarithms.cabal
--- old/integer-logarithms-1.0.1/integer-logarithms.cabal 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/integer-logarithms.cabal 2017-07-07 14:03:58.000000000 +0200
@@ -1,5 +1,5 @@
name: integer-logarithms
-version: 1.0.1
+version: 1.0.2
cabal-version: >= 1.10
author: Daniel Fischer
copyright: (c) 2011 Daniel Fischer
@@ -29,7 +29,8 @@
GHC==7.6.3,
GHC==7.8.4,
GHC==7.10.3,
- GHC==8.0.1
+ GHC==8.0.2,
+ GHC==8.2.1
extra-source-files : readme.md changelog.md
@@ -47,7 +48,7 @@
default-language: Haskell2010
hs-source-dirs: src
build-depends:
- base >= 4.3 && < 4.10,
+ base >= 4.3 && < 4.11,
array >= 0.3 && < 0.6,
ghc-prim < 0.6
if impl(ghc >= 7.10)
@@ -97,16 +98,14 @@
integer-logarithms,
tasty >= 0.10 && < 0.12,
tasty-smallcheck >= 0.8 && < 0.9,
- tasty-quickcheck >= 0.8 && < 0.9,
+ tasty-quickcheck >= 0.8 && < 0.10,
tasty-hunit >= 0.9 && < 0.10,
- QuickCheck >= 2.9 && < 2.10,
+ QuickCheck >= 2.10 && < 2.11,
smallcheck >= 1.1 && < 1.2
if !impl(ghc >= 7.10)
build-depends: nats >= 1.1 && <1.2
other-modules:
Math.NumberTheory.LogarithmsTests
- Math.NumberTheory.Powers.IntegerTests
- Math.NumberTheory.Powers.NaturalTests
- other-modules:
Math.NumberTheory.TestUtils
+ Orphans
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/src/Math/NumberTheory/Logarithms.hs new/integer-logarithms-1.0.2/src/Math/NumberTheory/Logarithms.hs
--- old/integer-logarithms-1.0.1/src/Math/NumberTheory/Logarithms.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/src/Math/NumberTheory/Logarithms.hs 2017-07-07 14:03:58.000000000 +0200
@@ -53,9 +53,6 @@
import Data.Array.Base (unsafeAt)
#endif
-import Math.NumberTheory.Powers.Integer
-import Math.NumberTheory.Powers.Natural
-
-- | Calculate the integer logarithm for an arbitrary base.
-- The base must be greater than 1, the second argument, the number
-- whose logarithm is sought, must be positive, otherwise an error is thrown.
@@ -163,7 +160,7 @@
integerLog10' n
| n < 10 = 0
| n < 100 = 1
- | otherwise = ex + integerLog10' (n `quot` integerPower 10 ex)
+ | otherwise = ex + integerLog10' (n `quot` 10 ^ ex)
where
ln = I# (integerLog2# n)
-- u/v is a good approximation of log 2/log 10
@@ -179,7 +176,7 @@
naturalLog10' n
| n < 10 = 0
| n < 100 = 1
- | otherwise = ex + naturalLog10' (n `quot` naturalPower 10 ex)
+ | otherwise = ex + naturalLog10' (n `quot` 10 ^ ex)
where
ln = I# (naturalLog2# n)
-- u/v is a good approximation of log 2/log 10
@@ -204,7 +201,7 @@
ex = fromInteger ((fromIntegral u * fromIntegral ln) `quot` fromIntegral v)
in case u of
1 -> ln `quot` v -- a power of 2, easy
- _ -> ex + integerLogBase' b (n `quot` integerPower b ex)
+ _ -> ex + integerLogBase' b (n `quot` b ^ ex)
| otherwise = let -- shift b so that 16 <= bi < 32
bi = fromInteger (b `shiftR` (lb-4))
-- we choose an approximation of log 2 / log (bi+1) to
@@ -219,7 +216,7 @@
v = fromIntegral $ logArr `unsafeAt` (ix+1)
w = v + u*fromIntegral (lb-4)
ex = fromInteger ((u * fromIntegral ln) `quot` w)
- in ex + integerLogBase' b (n `quot` integerPower b ex)
+ in ex + integerLogBase' b (n `quot` b ^ ex)
where
lb = integerLog2' b
ln = integerLog2' n
@@ -240,7 +237,7 @@
ex = fromNatural ((fromIntegral u * fromIntegral ln) `quot` fromIntegral v)
in case u of
1 -> ln `quot` v -- a power of 2, easy
- _ -> ex + naturalLogBase' b (n `quot` naturalPower b ex)
+ _ -> ex + naturalLogBase' b (n `quot` b ^ ex)
| otherwise = let -- shift b so that 16 <= bi < 32
bi = fromNatural (b `shiftR` (lb-4))
-- we choose an approximation of log 2 / log (bi+1) to
@@ -255,7 +252,7 @@
v = fromIntegral $ logArr `unsafeAt` (ix+1)
w = v + u*fromIntegral (lb-4)
ex = fromNatural ((u * fromIntegral ln) `quot` w)
- in ex + naturalLogBase' b (n `quot` naturalPower b ex)
+ in ex + naturalLogBase' b (n `quot` b ^ ex)
where
lb = naturalLog2' b
ln = naturalLog2' n
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/src/Math/NumberTheory/Powers/Integer.hs new/integer-logarithms-1.0.2/src/Math/NumberTheory/Powers/Integer.hs
--- old/integer-logarithms-1.0.1/src/Math/NumberTheory/Powers/Integer.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/src/Math/NumberTheory/Powers/Integer.hs 2017-07-07 14:03:58.000000000 +0200
@@ -10,15 +10,15 @@
-- or 'Word' exponent.
--
{-# LANGUAGE CPP #-}
-{-# LANGUAGE MagicHash #-}
-{-# LANGUAGE BangPatterns #-}
module Math.NumberTheory.Powers.Integer
+ {-# DEPRECATED "It is no faster than (^)" #-}
( integerPower
, integerWordPower
) where
-import GHC.Exts
-import GHC.Integer.Logarithms.Compat (wordLog2#)
+#if !MIN_VERSION_base(4,8,0)
+import Data.Word
+#endif
-- | Power of an 'Integer' by the left-to-right repeated squaring algorithm.
-- This needs two multiplications in each step while the right-to-left
@@ -34,29 +34,10 @@
-- /Warning:/ No check for the negativity of the exponent is performed,
-- a negative exponent is interpreted as a large positive exponent.
integerPower :: Integer -> Int -> Integer
-integerPower b (I# e#) = power b (int2Word# e#)
+integerPower = (^)
+{-# DEPRECATED integerPower "Use (^) instead" #-}
-- | Same as 'integerPower', but for exponents of type 'Word'.
integerWordPower :: Integer -> Word -> Integer
-integerWordPower b (W# w#) = power b w#
-
-power :: Integer -> Word# -> Integer
-power b w#
- | isTrue# (w# `eqWord#` 0##) = 1
- | isTrue# (w# `eqWord#` 1##) = b
- | otherwise = go (wordLog2# w# -# 1#) b (b*b)
- where
- go 0# l h = if isTrue# ((w# `and#` 1##) `eqWord#` 0##) then l*l else (l*h)
- go i# l h
- | w# `hasBit#` i# = go (i# -# 1#) (l*h) (h*h)
- | otherwise = go (i# -# 1#) (l*l) (l*h)
-
--- | A raw version of testBit for 'Word#'.
-hasBit# :: Word# -> Int# -> Bool
-hasBit# w# i# = isTrue# (((w# `uncheckedShiftRL#` i#) `and#` 1##) `neWord#` 0##)
-
-#if __GLASGOW_HASKELL__ < 707
--- The times they are a-changing. The types of primops too :(
-isTrue# :: Bool -> Bool
-isTrue# = id
-#endif
+integerWordPower = (^)
+{-# DEPRECATED integerWordPower "Use (^) instead" #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/src/Math/NumberTheory/Powers/Natural.hs new/integer-logarithms-1.0.2/src/Math/NumberTheory/Powers/Natural.hs
--- old/integer-logarithms-1.0.1/src/Math/NumberTheory/Powers/Natural.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/src/Math/NumberTheory/Powers/Natural.hs 2017-07-07 14:03:58.000000000 +0200
@@ -10,16 +10,17 @@
-- or 'Word' exponent.
--
{-# LANGUAGE CPP #-}
-{-# LANGUAGE MagicHash #-}
-{-# LANGUAGE BangPatterns #-}
module Math.NumberTheory.Powers.Natural
+ {-# DEPRECATED "It is no faster than (^)" #-}
( naturalPower
, naturalWordPower
) where
-import GHC.Exts
+#if !MIN_VERSION_base(4,8,0)
+import Data.Word
+#endif
+
import Numeric.Natural
-import GHC.Integer.Logarithms.Compat (wordLog2#)
-- | Power of an 'Natural' by the left-to-right repeated squaring algorithm.
-- This needs two multiplications in each step while the right-to-left
@@ -35,29 +36,10 @@
-- /Warning:/ No check for the negativity of the exponent is performed,
-- a negative exponent is interpreted as a large positive exponent.
naturalPower :: Natural -> Int -> Natural
-naturalPower b (I# e#) = power b (int2Word# e#)
+naturalPower = (^)
+{-# DEPRECATED naturalPower "Use (^) instead" #-}
-- | Same as 'naturalPower', but for exponents of type 'Word'.
naturalWordPower :: Natural -> Word -> Natural
-naturalWordPower b (W# w#) = power b w#
-
-power :: Natural -> Word# -> Natural
-power b w#
- | isTrue# (w# `eqWord#` 0##) = 1
- | isTrue# (w# `eqWord#` 1##) = b
- | otherwise = go (wordLog2# w# -# 1#) b (b*b)
- where
- go 0# l h = if isTrue# ((w# `and#` 1##) `eqWord#` 0##) then l*l else (l*h)
- go i# l h
- | w# `hasBit#` i# = go (i# -# 1#) (l*h) (h*h)
- | otherwise = go (i# -# 1#) (l*l) (l*h)
-
--- | A raw version of testBit for 'Word#'.
-hasBit# :: Word# -> Int# -> Bool
-hasBit# w# i# = isTrue# (((w# `uncheckedShiftRL#` i#) `and#` 1##) `neWord#` 0##)
-
-#if __GLASGOW_HASKELL__ < 707
--- The times they are a-changing. The types of primops too :(
-isTrue# :: Bool -> Bool
-isTrue# = id
-#endif
+naturalWordPower = (^)
+{-# DEPRECATED naturalWordPower "Use (^) instead" #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/LogarithmsTests.hs new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/LogarithmsTests.hs
--- old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/LogarithmsTests.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/LogarithmsTests.hs 2017-07-07 14:03:58.000000000 +0200
@@ -27,6 +27,9 @@
import Math.NumberTheory.Logarithms
import Math.NumberTheory.TestUtils
+-- Arbitrary Natural
+import Orphans ()
+
-- | Check that 'integerLogBase' returns the largest integer @l@ such that @b@ ^ @l@ <= @n@ and @b@ ^ (@l@+1) > @n@.
integerLogBaseProperty :: Positive Integer -> Positive Integer -> Bool
integerLogBaseProperty (Positive b) (Positive n) = b == 1 || b ^ l <= n && b ^ (l + 1) > n
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/Powers/IntegerTests.hs new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/Powers/IntegerTests.hs
--- old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/Powers/IntegerTests.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/Powers/IntegerTests.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
--- |
--- Module: Math.NumberTheory.Powers.IntegerTests
--- Copyright: (c) 2016 Andrew Lelechenko
--- Licence: MIT
--- Maintainer: Andrew Lelechenko <andrew.lelechenko(a)gmail.com>
--- Stability: Provisional
---
--- Tests for Math.NumberTheory.Powers.Integer
---
-
-{-# LANGUAGE CPP #-}
-
-{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-
-module Math.NumberTheory.Powers.IntegerTests
- ( testSuite
- ) where
-
-import Test.Tasty
-
-#if MIN_VERSION_base(4,8,0)
-#else
-import Data.Word
-#endif
-
-import Math.NumberTheory.Powers.Integer
-import Math.NumberTheory.TestUtils
-
--- | Check that 'integerPower' == '^'.
-integerPowerProperty :: Integer -> Power Int -> Bool
-integerPowerProperty a (Power b) = integerPower a b == a ^ b
-
--- | Check that 'integerWordPower' == '^'.
-integerWordPowerProperty :: Integer -> Power Word -> Bool
-integerWordPowerProperty a (Power b) = integerWordPower a b == a ^ b
-
-testSuite :: TestTree
-testSuite = testGroup "Integer"
- [ testSmallAndQuick "integerPower" integerPowerProperty
- , testSmallAndQuick "integerWordPower" integerWordPowerProperty
- ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/Powers/NaturalTests.hs new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/Powers/NaturalTests.hs
--- old/integer-logarithms-1.0.1/test-suite/Math/NumberTheory/Powers/NaturalTests.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/test-suite/Math/NumberTheory/Powers/NaturalTests.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,42 +0,0 @@
--- |
--- Module: Math.NumberTheory.Powers.NaturalTests
--- Copyright: (c) 2016 Andrew Lelechenko
--- Licence: MIT
--- Maintainer: Andrew Lelechenko <andrew.lelechenko(a)gmail.com>
--- Stability: Provisional
---
--- Tests for Math.NumberTheory.Powers.Natural
---
-
-{-# LANGUAGE CPP #-}
-
-{-# OPTIONS_GHC -fno-warn-type-defaults #-}
-
-module Math.NumberTheory.Powers.NaturalTests
- ( testSuite
- ) where
-
-import Test.Tasty
-
-#if MIN_VERSION_base(4,8,0)
-#else
-import Data.Word
-#endif
-
-import Math.NumberTheory.Powers.Natural
-import Numeric.Natural
-import Math.NumberTheory.TestUtils
-
--- | Check that 'naturalPower' == '^'.
-naturalPowerProperty :: Natural -> Power Int -> Bool
-naturalPowerProperty a (Power b) = naturalPower a b == a ^ b
-
--- | Check that 'naturalWordPower' == '^'.
-naturalWordPowerProperty :: Natural -> Power Word -> Bool
-naturalWordPowerProperty a (Power b) = naturalWordPower a b == a ^ b
-
-testSuite :: TestTree
-testSuite = testGroup "Natural"
- [ testSmallAndQuick "naturalPower" naturalPowerProperty
- , testSmallAndQuick "naturalWordPower" naturalWordPowerProperty
- ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/test-suite/Orphans.hs new/integer-logarithms-1.0.2/test-suite/Orphans.hs
--- old/integer-logarithms-1.0.1/test-suite/Orphans.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/integer-logarithms-1.0.2/test-suite/Orphans.hs 2017-07-07 14:03:58.000000000 +0200
@@ -0,0 +1,12 @@
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+module Orphans () where
+
+import Numeric.Natural (Natural)
+import Test.QuickCheck (Arbitrary (..))
+
+-- | The QuickCheck-2.10 doesn't define the Arbitrary Natural instance
+-- We define own instance (and not use quickcheck-instance) to break
+-- the cycle in tests.
+instance Arbitrary Natural where
+ arbitrary = fmap (fromInteger . abs) arbitrary
+ shrink = map (fromInteger . abs) . shrink . fromIntegral
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/integer-logarithms-1.0.1/test-suite/Test.hs new/integer-logarithms-1.0.2/test-suite/Test.hs
--- old/integer-logarithms-1.0.1/test-suite/Test.hs 2017-01-26 13:27:02.000000000 +0100
+++ new/integer-logarithms-1.0.2/test-suite/Test.hs 2017-07-07 14:03:58.000000000 +0200
@@ -1,8 +1,6 @@
import Test.Tasty
import qualified Math.NumberTheory.LogarithmsTests as Logarithms
-import qualified Math.NumberTheory.Powers.IntegerTests as PowerInteger
-import qualified Math.NumberTheory.Powers.NaturalTests as PowerNatural
main :: IO ()
main = defaultMain tests
@@ -10,6 +8,4 @@
tests :: TestTree
tests = testGroup "All"
[ Logarithms.testSuite
- , PowerInteger.testSuite
- , PowerNatural.testSuite
]
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-hxt-pickle-utils for openSUSE:Factory checked in at 2017-08-31 20:47:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hxt-pickle-utils (Old)
and /work/SRC/openSUSE:Factory/.ghc-hxt-pickle-utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hxt-pickle-utils"
Thu Aug 31 20:47:53 2017 rev:2 rq:513396 …
[View More]version:0.1.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hxt-pickle-utils/ghc-hxt-pickle-utils.changes 2017-03-08 00:57:04.290196183 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hxt-pickle-utils.new/ghc-hxt-pickle-utils.changes 2017-08-31 20:47:53.891586605 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 03:01:25 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.1.0.3 revision 2.
+
+-------------------------------------------------------------------
Old:
----
1.cabal
New:
----
hxt-pickle-utils.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hxt-pickle-utils.spec ++++++
--- /var/tmp/diff_new_pack.HKwrkl/_old 2017-08-31 20:47:54.695473766 +0200
+++ /var/tmp/diff_new_pack.HKwrkl/_new 2017-08-31 20:47:54.703472643 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-hxt-pickle-utils
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -22,17 +22,15 @@
Release: 0
Summary: Utility functions for using HXT picklers
License: BSD-3-Clause
-Group: System/Libraries
+Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal…
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-hxt-devel
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# End cabal-rpm deps
%description
Utility functions for using HXT picklers.
@@ -53,15 +51,12 @@
%setup -q -n %{pkg_name}-%{version}
cp -p %{SOURCE1} %{pkg_name}.cabal
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%post devel
%ghc_pkg_recache
++++++ hxt-pickle-utils.cabal ++++++
name: hxt-pickle-utils
version: 0.1.0.3
x-revision: 2
synopsis: Utility functions for using HXT picklers.
description: Utility functions for using HXT picklers.
homepage: https://github.com/silkapp/hxt-pickle-utils
license: BSD3
license-file: LICENSE
author: Silk
maintainer: code(a)silk.co
copyright: (c) 2014, Silk
category: XML
build-type: Simple
cabal-version: >=1.10
extra-source-files:
CHANGELOG.md
LICENSE
README.md
source-repository head
Type: git
Location: https://github.com/silkapp/hxt-pickle-utils.git
library
default-language: Haskell2010
hs-source-dirs: src
exposed-modules: Text.Xml.Pickle
build-depends:
base >= 4.5 && < 4.11
, hxt >= 9.2 && < 9.4
, mtl >= 2.0 && < 2.3
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-htaglib for openSUSE:Factory checked in at 2017-08-31 20:47:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-htaglib (Old)
and /work/SRC/openSUSE:Factory/.ghc-htaglib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-htaglib"
Thu Aug 31 20:47:50 2017 rev:4 rq:513394 version:1.1.1
Changes:
--------
--- /work/…
[View More]SRC/openSUSE:Factory/ghc-htaglib/ghc-htaglib.changes 2017-02-03 17:39:12.847852090 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-htaglib.new/ghc-htaglib.changes 2017-08-31 20:47:52.647761195 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:11 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.1.1.
+
+-------------------------------------------------------------------
Old:
----
htaglib-1.0.4.tar.gz
htaglib.cabal
New:
----
htaglib-1.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-htaglib.spec ++++++
--- /var/tmp/diff_new_pack.9RsVG7/_old 2017-08-31 20:47:53.679616358 +0200
+++ /var/tmp/diff_new_pack.9RsVG7/_new 2017-08-31 20:47:53.679616358 +0200
@@ -19,18 +19,18 @@
%global pkg_name htaglib
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.0.4
+Version: 1.1.1
Release: 0
Summary: Bindings to TagLib, audio meta-data library
License: BSD-3-Clause
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
+BuildRequires: ghc-transformers-devel
BuildRequires: libtag-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
@@ -56,7 +56,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
@@ -83,5 +82,6 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
+%doc CHANGELOG.md README.md
%changelog
++++++ htaglib-1.0.4.tar.gz -> htaglib-1.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/CHANGELOG.md new/htaglib-1.1.1/CHANGELOG.md
--- old/htaglib-1.0.4/CHANGELOG.md 2016-09-10 12:48:20.000000000 +0200
+++ new/htaglib-1.1.1/CHANGELOG.md 2017-05-22 16:18:11.000000000 +0200
@@ -1,3 +1,12 @@
+## HTagLib 1.1.1
+
+* Improved/updated documentation and metadata.
+
+## HTagLib 1.1.0
+
+* Made `getTags`, `getTags'`, `setTags`, and `setTags'` callable from any
+ instance of `MonadIO`, not only `IO`.
+
## HTagLib 1.0.4
* Re-wrote the test suite with Hspec.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/LICENSE.md new/htaglib-1.1.1/LICENSE.md
--- old/htaglib-1.0.4/LICENSE.md 2016-01-03 12:19:32.000000000 +0100
+++ new/htaglib-1.1.1/LICENSE.md 2017-01-27 21:18:50.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright © 2015–2016 Mark Karpov
+Copyright © 2015–2017 Mark Karpov
All rights reserved.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/README.md new/htaglib-1.1.1/README.md
--- old/htaglib-1.0.4/README.md 2016-04-12 10:43:20.000000000 +0200
+++ new/htaglib-1.1.1/README.md 2017-05-22 15:47:10.000000000 +0200
@@ -8,6 +8,7 @@
[![Coverage Status](https://coveralls.io/repos/mrkkrp/htaglib/badge.svg?branch=master&service=github)](https://coveralls.io/github/mrkkrp/htaglib?branch=master)
* [Alternatives](#alternatives)
+* [A note for FLAC users](#a-note-for-flac-users)
* [Quick start](#quick-start)
* [Reading meta data](#reading-meta-data)
* [Writing meta data](#writing-meta-data)
@@ -15,8 +16,7 @@
* [License](#license)
This is Haskell bindings to [TagLib](https://taglib.github.io/), library for
-reading and editing meta-data of several popular audio formats. This library
-is easy to use and type-safe.
+reading and editing meta-data of several popular audio formats.
It works with the following formats:
@@ -30,7 +30,7 @@
* MP4
* ASF
-This happens in abstract, uniform way, so you don't need to handle any
+This happens in an abstract, uniform way, so you don't need to handle any
low-level details. As a consequence, it's currently not possible to work
with format-specific functionality.
@@ -45,12 +45,20 @@
abstractions, not really type-safe. I personally don't want to use them, so
I wrote this.
+## A note for FLAC users
+
+If you want to work with FLAC, there is
+a [complete Haskell binding](https://github.com/mrkkrp/flac) to
+`libFLAC`—reference FLAC implementation. It allows to work with all FLAC
+metadata (read and write) and also provides Haskell API to stream encoder
+and stream decoder. Please prefer that package if you don't need to work
+with other audio formats.
+
## Quick start
First, since this is bindings to C-interface of the library, you'll need to
-install the library itself. If you're on Unix-like system, chances are
-you'll have it in official repositories of your distro. Users of other
-systems should also be able to install it without particular pain.
+install the library itself. If you're on a Unix-like system, chances are
+you'll have it in the official repositories of your distro.
After installation of the library, install `htaglib` package using Cabal or
Stack (recommended):
@@ -86,8 +94,8 @@
data, so it's more difficult to use track title in lieu of track artist, for
example. Meta data that is represented by strings also has smart
constructors, they replace zero bytes with spaces, this is necessary to
-avoid troubles when your Haskell strings go to C-level (well, zero-bytes in
-strings is rather edge case, but it should be mentioned). Of course,
+avoid troubles when your Haskell strings go to the C-level (well, zero-bytes
+in strings is rather edge case, but it should be mentioned). Of course,
`Title`, `Artist`, `Album`, `Comment`, and `Genre` all are instances of
`IsString`, so just turn on `OverloadedStrings` and you can use normal
string literals to create data of these types.
@@ -146,7 +154,8 @@
of seconds as an integer. This means that if you want to calculate total
duration, you'll have slightly incorrect result. Proper solution is to
extract duration as floating-point number, for that we recommend bindings to
-`libsndfile` — [`hsndfile`](https://hackage.haskell.org/package/hsndfile).
+`libsndfile`—[`hsndfile`](https://hackage.haskell.org/package/hsndfile) (or
+the above-mentioned `flac` package for Haskell if you work with FLAC).
### Writing meta data
@@ -173,8 +182,7 @@
print track
```
-This code loads file and changes “title” and “artist” meta data
-fields.
+This code loads file and changes “title” and “artist” meta data fields.
## Conclusion
@@ -185,6 +193,6 @@
## License
-Copyright © 2015–2016 Mark Karpov
+Copyright © 2015–2017 Mark Karpov
Distributed under BSD 3 clause license.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/Sound/HTagLib/Getter.hs new/htaglib-1.1.1/Sound/HTagLib/Getter.hs
--- old/htaglib-1.0.4/Sound/HTagLib/Getter.hs 2016-01-03 12:18:44.000000000 +0100
+++ new/htaglib-1.1.1/Sound/HTagLib/Getter.hs 2017-05-22 15:51:59.000000000 +0200
@@ -1,13 +1,13 @@
-- |
-- Module : Sound.HTagLib.Getter
--- Copyright : © 2015–2016 Mark Karpov
+-- Copyright : © 2015–2017 Mark Karpov
-- License : BSD 3 clause
--
--- Maintainer : Mark Karpov <markkarpov(a)opmbx.org>
+-- Maintainer : Mark Karpov <markkarpov92(a)gmail.com>
-- Stability : experimental
-- Portability : portable
--
--- High-level applicative interface for reading of audio meta data. You
+-- A high-level applicative interface for reading of audio meta data. You
-- don't need to import this module directly, import "Sound.HTagLib"
-- instead.
@@ -32,15 +32,16 @@
, channelsGetter )
where
+import Control.Monad.IO.Class
import Sound.HTagLib.Type
import qualified Sound.HTagLib.Internal as I
#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative (Applicative, (<$>), (<*>), pure)
+import Control.Applicative
#endif
--- | This type represents composable entity that can be used with 'getTags'
--- or 'getTags'' functions to read batch of meta parameters.
+-- | A composable entity that can be used with 'getTags' or 'getTags''
+-- functions to read batch of meta parameters.
newtype TagGetter a = TagGetter { runGetter :: I.FileId -> IO a }
@@ -56,35 +57,35 @@
-- | @getTags path g@ will try to read file located at @path@ and read meta
-- data of the file using getter @g@. Type of file will be guessed from its
-- extension. If this is not satisfactory and you want to explicitly specify
--- file type, see 'getTags'' variation of this function.
+-- the file type, see 'getTags'' variation of this function.
--
--- In case of trouble 'I.HTagLibException' will be thrown.
+-- In the case of trouble 'I.HTagLibException' will be thrown.
-getTags
- :: FilePath -- ^ Path to audio file
+getTags :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> TagGetter a -- ^ Getter
- -> IO a -- ^ Extracted data
+ -> m a -- ^ Extracted data
getTags path = execGetter path Nothing
-- | This is essentially the same as 'getTags', but allows to explicitly
--- choose file type (see 'I.FileType').
+-- choose file type (see 'FileType').
-getTags'
- :: FilePath -- ^ Path to audio file
+getTags' :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> FileType -- ^ Type of audio file
-> TagGetter a -- ^ Getter
- -> IO a -- ^ Extracted data
+ -> m a -- ^ Extracted data
getTags' path t = execGetter path (Just t)
-- | This is the most general way to read meta data from file. 'getTags' and
-- 'getTags'' are just wrappers around the function.
-execGetter
- :: FilePath -- ^ Path to audio file
+execGetter :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> Maybe FileType -- ^ Type of audio file (if known)
-> TagGetter a -- ^ Getter
- -> IO a -- ^ Extracted data
-execGetter path t = I.withFile path t . runGetter
+ -> m a -- ^ Extracted data
+execGetter path t = liftIO . I.withFile path t . runGetter
-- | Getter to retrieve track title.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/Sound/HTagLib/Internal.hs new/htaglib-1.1.1/Sound/HTagLib/Internal.hs
--- old/htaglib-1.0.4/Sound/HTagLib/Internal.hs 2016-09-03 12:21:17.000000000 +0200
+++ new/htaglib-1.1.1/Sound/HTagLib/Internal.hs 2017-05-22 15:52:53.000000000 +0200
@@ -1,9 +1,9 @@
-- |
-- Module : Sound.HTagLib.Internal
--- Copyright : © 2015–2016 Mark Karpov
+-- Copyright : © 2015–2017 Mark Karpov
-- License : BSD 3 clause
--
--- Maintainer : Mark Karpov <markkarpov(a)opmbx.org>
+-- Maintainer : Mark Karpov <markkarpov92(a)gmail.com>
-- Stability : experimental
-- Portability : portable
--
@@ -68,6 +68,7 @@
newtype FileId = FileId (Ptr TagLibFile)
+----------------------------------------------------------------------------
-- Misc
foreign import ccall unsafe "taglib/tag_c.h taglib_set_string_management_enabled"
@@ -96,6 +97,7 @@
foreign import ccall unsafe "taglib/tag_c.h taglib_file_save"
c_taglib_file_save :: Ptr TagLibFile -> IO CInt
+----------------------------------------------------------------------------
-- Tag API
foreign import ccall unsafe "taglib/tag_c.h taglib_tag_title"
@@ -140,6 +142,7 @@
foreign import ccall unsafe "taglib/tag_c.h taglib_tag_set_track"
c_taglib_tag_set_track :: Ptr TagLibTag -> CUInt -> IO ()
+----------------------------------------------------------------------------
-- Audio properties API
foreign import ccall unsafe "taglib/tag_c.h taglib_audioproperties_length"
@@ -154,14 +157,13 @@
foreign import ccall unsafe "taglib/tag_c.h taglib_audioproperties_channels"
c_taglib_properties_channels :: Ptr TagLibProperties -> IO CInt
+----------------------------------------------------------------------------
-- Special convenience ID3v2 functions
foreign import ccall unsafe "taglib/tag_c.h taglib_id3v2_set_default_text_encoding"
c_taglib_id3v2_set_default_text_encoding :: CInt -> IO ()
--- Wrappers. Here we prepare a little higher-level interface that will be
--- used by the rest of the library.
-
+----------------------------------------------------------------------------
-- File API
-- | Open audio file and return its ID (an opaque type that the rest of
@@ -212,6 +214,7 @@
unless success $
throw (T.SavingFailed path)
+----------------------------------------------------------------------------
-- Tag API
-- | Get title tag associated with file.
@@ -284,6 +287,7 @@
setTrackNumber :: Maybe T.TrackNumber -> FileId -> IO ()
setTrackNumber v = setIntValue c_taglib_tag_set_track (T.unTrackNumber <$> v)
+----------------------------------------------------------------------------
-- Audio properties API
-- | Get duration of track associated with file.
@@ -310,6 +314,7 @@
getChannels = fmap (fromJust . T.mkChannels)
. getIntProperty c_taglib_properties_channels
+----------------------------------------------------------------------------
-- Special convenience ID3v2 functions
-- | Set the default encoding for ID3v2 frames that are written to tags.
@@ -317,6 +322,7 @@
id3v2SetEncoding :: T.ID3v2Encoding -> IO ()
id3v2SetEncoding = c_taglib_id3v2_set_default_text_encoding . enumToCInt
+----------------------------------------------------------------------------
-- Helpers
getStrValue
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/Sound/HTagLib/Setter.hs new/htaglib-1.1.1/Sound/HTagLib/Setter.hs
--- old/htaglib-1.0.4/Sound/HTagLib/Setter.hs 2016-01-03 12:18:46.000000000 +0100
+++ new/htaglib-1.1.1/Sound/HTagLib/Setter.hs 2017-05-22 15:52:36.000000000 +0200
@@ -1,13 +1,13 @@
-- |
-- Module : Sound.HTagLib.Setter
--- Copyright : © 2015–2016 Mark Karpov
+-- Copyright : © 2015–2017 Mark Karpov
-- License : BSD 3 clause
--
--- Maintainer : Mark Karpov <markkarpov(a)opmbx.org>
+-- Maintainer : Mark Karpov <markkarpov92(a)gmail.com>
-- Stability : experimental
-- Portability : portable
--
--- High-level interface for writing audio meta data. You don't need to
+-- A high-level interface for writing audio meta data. You don't need to
-- import this module directly, import "Sound.HTagLib" instead.
{-# LANGUAGE CPP #-}
@@ -29,6 +29,7 @@
where
import Control.Applicative ((<|>))
+import Control.Monad.IO.Class
import Data.Foldable (forM_)
import Sound.HTagLib.Type
import qualified Sound.HTagLib.Internal as I
@@ -37,8 +38,8 @@
import Data.Monoid
#endif
--- | Composable entity that can be used together with 'setTags' or
--- 'setTags'' to write meta data to audio file.
+-- | A composable entity that can be used together with the 'setTags' or the
+-- 'setTags'' functions to write meta data to an audio file.
--
-- Note that in case of (for example):
--
@@ -73,38 +74,38 @@
, sdYear = f sdYear
, sdTrackNumber = f sdTrackNumber }
--- | Set tags in specified file using given setter.
+-- | Set tags in specified file using the given setter.
--
--- In case of trouble 'I.HTagLibException' will be thrown.
+-- In the case of trouble 'I.HTagLibException' will be thrown.
-setTags
- :: FilePath -- ^ Path to audio file
+setTags :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> Maybe ID3v2Encoding -- ^ Encoding for ID3v2 frames
-> TagSetter -- ^ Setter
- -> IO ()
+ -> m ()
setTags path enc = execSetter path enc Nothing
-- | Similar to 'setTags', but you can also specify type of audio file
-- explicitly (otherwise it's guessed from file extension).
-setTags'
- :: FilePath -- ^ Path to audio file
+setTags' :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> Maybe ID3v2Encoding -- ^ Encoding for ID3v2 frames
-> FileType -- ^ Type of audio file
-> TagSetter -- ^ Setter
- -> IO ()
+ -> m ()
setTags' path enc t = execSetter path enc (Just t)
-- | The most general way to set meta data. 'setTags' and 'setTags'' are
-- just wrappers around this function.
-execSetter
- :: FilePath -- ^ Path to audio file
+execSetter :: MonadIO m
+ => FilePath -- ^ Path to audio file
-> Maybe ID3v2Encoding -- ^ Encoding for ID3v2 frames
-> Maybe FileType -- ^ Type of audio file (if known)
-> TagSetter -- ^ Setter
- -> IO ()
-execSetter path enc t TagSetter {..} = I.withFile path t $ \fid -> do
+ -> m ()
+execSetter path enc t TagSetter {..} = liftIO . I.withFile path t $ \fid -> do
forM_ enc I.id3v2SetEncoding
let writeTag x f = forM_ x (`f` fid)
writeTag sdTitle I.setTitle
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/Sound/HTagLib/Type.hs new/htaglib-1.1.1/Sound/HTagLib/Type.hs
--- old/htaglib-1.0.4/Sound/HTagLib/Type.hs 2016-04-06 14:41:02.000000000 +0200
+++ new/htaglib-1.1.1/Sound/HTagLib/Type.hs 2017-05-22 15:48:52.000000000 +0200
@@ -1,9 +1,9 @@
-- |
-- Module : Sound.HTagLib.Type
--- Copyright : © 2015–2016 Mark Karpov
+-- Copyright : © 2015–2017 Mark Karpov
-- License : BSD 3 clause
--
--- Maintainer : Mark Karpov <markkarpov(a)opmbx.org>
+-- Maintainer : Mark Karpov <markkarpov92(a)gmail.com>
-- Stability : experimental
-- Portability : portable
--
@@ -242,8 +242,8 @@
atLeast a b = if b >= a then Just b else Nothing
-- | Types of files TagLib can work with. This may be used to explicitly
--- specify type of file rather than relying on TagLib ability to guess type
--- of file from its extension.
+-- specify type of file instead of relying on the TagLib's ability to guess
+-- type of file from its extension.
data FileType
= MPEG -- ^ MPEG
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/Sound/HTagLib.hs new/htaglib-1.1.1/Sound/HTagLib.hs
--- old/htaglib-1.0.4/Sound/HTagLib.hs 2016-09-03 12:34:48.000000000 +0200
+++ new/htaglib-1.1.1/Sound/HTagLib.hs 2017-05-22 15:47:40.000000000 +0200
@@ -1,18 +1,42 @@
-- |
-- Module : Sound.HTagLib
--- Copyright : © 2015–2016 Mark Karpov
+-- Copyright : © 2015–2017 Mark Karpov
-- License : BSD 3 clause
--
--- Maintainer : Mark Karpov <markkarpov(a)opmbx.org>
+-- Maintainer : Mark Karpov <markkarpov92(a)gmail.com>
-- Stability : experimental
-- Portability : portable
--
--- This module includes complete high-level interface to TagLib. This is the
--- module you should import to use in your projects.
+-- This module provides a complete high-level interface to TagLib. This is
+-- the module you should import to use in your projects.
module Sound.HTagLib
- ( -- * Data types
- Title
+ ( -- * Getters
+ getTags
+ , getTags'
+ , titleGetter
+ , artistGetter
+ , albumGetter
+ , commentGetter
+ , genreGetter
+ , yearGetter
+ , trackNumberGetter
+ , durationGetter
+ , bitRateGetter
+ , sampleRateGetter
+ , channelsGetter
+ -- * Setters
+ , setTags
+ , setTags'
+ , titleSetter
+ , artistSetter
+ , albumSetter
+ , commentSetter
+ , genreSetter
+ , yearSetter
+ , trackNumberSetter
+ -- * Data types
+ , Title
, mkTitle
, unTitle
, Artist
@@ -47,33 +71,9 @@
, unChannels
, FileType (..)
, ID3v2Encoding (..)
- , HTagLibException (..)
- -- * Getters
, TagGetter
- , getTags
- , getTags'
- , titleGetter
- , artistGetter
- , albumGetter
- , commentGetter
- , genreGetter
- , yearGetter
- , trackNumberGetter
- , durationGetter
- , bitRateGetter
- , sampleRateGetter
- , channelsGetter
- -- * Setters
, TagSetter
- , setTags
- , setTags'
- , titleSetter
- , artistSetter
- , albumSetter
- , commentSetter
- , genreSetter
- , yearSetter
- , trackNumberSetter )
+ , HTagLibException (..) )
where
import Sound.HTagLib.Getter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/htaglib.cabal new/htaglib-1.1.1/htaglib.cabal
--- old/htaglib-1.0.4/htaglib.cabal 2016-09-10 12:49:04.000000000 +0200
+++ new/htaglib-1.1.1/htaglib.cabal 2017-05-22 16:18:39.000000000 +0200
@@ -1,42 +1,11 @@
---
--- Cabal config for HTagLib.
---
--- Copyright © 2015–2016 Mark Karpov
---
--- 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 Mark Karpov nor the names of 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 “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 HOLDERS 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.
-
name: htaglib
-version: 1.0.4
+version: 1.1.1
cabal-version: >= 1.10
+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.1
license: BSD3
license-file: LICENSE.md
-author: Mark Karpov <markkarpov(a)opmbx.org>
-maintainer: Mark Karpov <markkarpov(a)opmbx.org>
+author: Mark Karpov <markkarpov92(a)gmail.com>
+maintainer: Mark Karpov <markkarpov92(a)gmail.com>
homepage: https://github.com/mrkkrp/htaglib
bug-reports: https://github.com/mrkkrp/htaglib/issues
category: Sound, Foreign
@@ -55,9 +24,10 @@
default: False
library
- build-depends: base >= 4.7 && < 5.0
- , bytestring >= 0.9 && < 0.11
- , text >= 1.0 && < 1.3
+ build-depends: base >= 4.7 && < 5.0
+ , bytestring >= 0.9 && < 0.11
+ , text >= 1.0 && < 1.3
+ , transformers >= 0.4 && < 0.6
extra-libraries: tag_c
exposed-modules: Sound.HTagLib
, Sound.HTagLib.Type
@@ -82,10 +52,10 @@
, Sound.HTagLib.SetterSpec
, Sound.HTagLib.Test.Util
build-depends: base >= 4.7 && < 5.0
- , directory >= 1.2 && < 1.3
+ , directory >= 1.2 && < 1.4
, filepath >= 1.4 && < 2.0
, hspec >= 2.0 && < 3.0
- , htaglib >= 1.0.4
+ , htaglib
default-extensions:
CPP
default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/tests/Sound/HTagLib/GetterSpec.hs new/htaglib-1.1.1/tests/Sound/HTagLib/GetterSpec.hs
--- old/htaglib-1.0.4/tests/Sound/HTagLib/GetterSpec.hs 2016-09-10 11:58:45.000000000 +0200
+++ new/htaglib-1.1.1/tests/Sound/HTagLib/GetterSpec.hs 2017-05-22 15:53:46.000000000 +0200
@@ -1,35 +1,3 @@
---
--- HTagLib tests, testing of getters.
---
--- Copyright © 2015–2016 Mark Karpov
---
--- 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 Mark Karpov nor the names of 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 “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 HOLDERS 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.
-
module Sound.HTagLib.GetterSpec (spec) where
import Sound.HTagLib
@@ -37,7 +5,7 @@
import Test.Hspec
#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative ((<$>))
+import Control.Applicative
#endif
spec :: Spec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/tests/Sound/HTagLib/SetterSpec.hs new/htaglib-1.1.1/tests/Sound/HTagLib/SetterSpec.hs
--- old/htaglib-1.0.4/tests/Sound/HTagLib/SetterSpec.hs 2016-09-10 12:01:36.000000000 +0200
+++ new/htaglib-1.1.1/tests/Sound/HTagLib/SetterSpec.hs 2017-05-22 15:53:50.000000000 +0200
@@ -1,35 +1,3 @@
---
--- HTagLib tests, testing of Setters.
---
--- Copyright © 2015–2016 Mark Karpov
---
--- 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 Mark Karpov nor the names of 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 “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 HOLDERS 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.
-
{-# LANGUAGE OverloadedStrings #-}
module Sound.HTagLib.SetterSpec (spec) where
@@ -41,7 +9,7 @@
import Test.Hspec
#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative ((<$>))
+import Control.Applicative
#endif
spec :: Spec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/htaglib-1.0.4/tests/Sound/HTagLib/Test/Util.hs new/htaglib-1.1.1/tests/Sound/HTagLib/Test/Util.hs
--- old/htaglib-1.0.4/tests/Sound/HTagLib/Test/Util.hs 2016-09-10 11:56:15.000000000 +0200
+++ new/htaglib-1.1.1/tests/Sound/HTagLib/Test/Util.hs 2017-05-22 15:53:40.000000000 +0200
@@ -1,35 +1,3 @@
---
--- HTagLib tests, utility definitions.
---
--- Copyright © 2015–2016 Mark Karpov
---
--- 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 Mark Karpov nor the names of 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 “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 HOLDERS 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.
-
{-# LANGUAGE OverloadedStrings #-}
module Sound.HTagLib.Test.Util
@@ -47,7 +15,7 @@
import Test.Hspec
#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative ((<$>), (<*>), pure)
+import Control.Applicative
#endif
data AudioTags = AudioTags
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-hsyslog for openSUSE:Factory checked in at 2017-08-31 20:47:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hsyslog (Old)
and /work/SRC/openSUSE:Factory/.ghc-hsyslog.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hsyslog"
Thu Aug 31 20:47:47 2017 rev:3 rq:513393 version:5.0.1
Changes:
--------
--- /work/…
[View More]SRC/openSUSE:Factory/ghc-hsyslog/ghc-hsyslog.changes 2017-03-24 02:18:20.320215046 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hsyslog.new/ghc-hsyslog.changes 2017-08-31 20:47:48.840295634 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:58 UTC 2017 - psimons(a)suse.com
+
+- Update to version 5.0.1.
+
+-------------------------------------------------------------------
Old:
----
hsyslog-4.tar.gz
New:
----
hsyslog-5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hsyslog.spec ++++++
--- /var/tmp/diff_new_pack.kdJjFK/_old 2017-08-31 20:47:49.640183357 +0200
+++ /var/tmp/diff_new_pack.kdJjFK/_new 2017-08-31 20:47:49.652181673 +0200
@@ -19,7 +19,7 @@
%global pkg_name hsyslog
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 4
+Version: 5.0.1
Release: 0
Summary: FFI interface to syslog(3) from POSIX.1-2001
License: BSD-3-Clause
@@ -27,17 +27,25 @@
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
BuildRequires: ghc-Cabal-devel
-BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-cabal-doctest-devel
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
-BuildRequires: ghc-QuickCheck-devel
+BuildRequires: ghc-doctest-devel
%endif
%description
-This library provides FFI bindings to syslog(3) from
-<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html
-POSIX.1-2008>.
+A Haskell interface to 'syslog(3)' as specified in
+<http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html
+POSIX.1-2008>. The entire public API lives in "System.Posix.Syslog".
+There is a set of exposed modules available underneath that one, which contain
+various implementation details that may be useful to other developers who want
+to implement syslog-related functionality. /Users/ of 'syslog', however, do not
+need them.
+
+An example program that demonstrates how to use this library is available in
+the <https://github.com/peti/hsyslog/blob/master/example/Main.hs examples>
+directory of this package.
%package devel
Summary: Haskell %{pkg_name} library development files
@@ -74,5 +82,6 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
+%doc example
%changelog
++++++ hsyslog-4.tar.gz -> hsyslog-5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/Setup.hs new/hsyslog-5.0.1/Setup.hs
--- old/hsyslog-4/Setup.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/Setup.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,34 @@
+{-# 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
+#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.
+#endif
+
+import Distribution.Simple
+
+main :: IO ()
+main = defaultMain
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/Setup.lhs new/hsyslog-5.0.1/Setup.lhs
--- old/hsyslog-4/Setup.lhs 2016-06-03 18:53:08.000000000 +0200
+++ new/hsyslog-5.0.1/Setup.lhs 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/usr/bin/env runhaskell
-
-> module Main (main) where
->
-> import Distribution.Simple
->
-> main :: IO ()
-> main = defaultMain
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/c-bits/make-log-mask.c new/hsyslog-5.0.1/c-bits/make-log-mask.c
--- old/hsyslog-4/c-bits/make-log-mask.c 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/c-bits/make-log-mask.c 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,6 @@
+#include <syslog.h>
+
+int makeLogMask(int priority)
+{
+ return LOG_MASK(priority);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/c-bits/simple-syslog.c new/hsyslog-5.0.1/c-bits/simple-syslog.c
--- old/hsyslog-4/c-bits/simple-syslog.c 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/c-bits/simple-syslog.c 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,27 @@
+#include <syslog.h>
+
+/*
+ A variant of syslog(3) that provides a simplified API to addresses the
+ following issues:
+
+ - Calling variadic functions via FFI kind-of sort-of works, but the Haskell
+ standard actually doesn't guarantee it. There is a GHC extension, CApiFFI,
+ which addresses this issue, but then that extension isn't part of any
+ Haskell standard either.
+
+ - Strings in Haskell are almost never terminated by a \0 byte. We generally
+ do know their lengths, though, so it's more convenient to specify an
+ explicit maximum field length in the format string via "%.*s" and pass our
+ string as an argument to that. An added benefit is that our syslog
+ function doesn't interpret any of those freaky % formatting features that
+ can't support (and don't want to, really).
+
+ Note that we totally don't make any effort whatsoever to guarantee
+ meaningful argument values. If you wan to pass a negative string length,
+ null pointers and non-existent facility values ... be our guest!
+ */
+
+void simpleSyslog(int facility, int priority, const char * buf, int len)
+{
+ syslog(facility | priority, "%.*s", len, buf);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/example/Main.hs new/hsyslog-5.0.1/example/Main.hs
--- old/hsyslog-4/example/Main.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/example/Main.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,44 @@
+-- These extensions are required so that we can define a class instance for "String".
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
+
+module Main ( main ) where
+
+import System.Posix.Syslog
+
+import Data.ByteString.Char8 ( ByteString, pack )
+import Data.ByteString.Unsafe ( unsafeUseAsCStringLen )
+import Foreign.C.String ( CStringLen, withCStringLen )
+
+-- This class allows us to log normal Strings, ByteStrings, and pretty much any
+-- other type to syslog without any explicit conversions. It abstracts the
+-- information of how to convert the given type into a CStringLen that can be
+-- passed to syslog.
+
+class LogMessage m where
+ toCStringLen :: m -> (CStringLen -> IO a) -> IO a
+
+instance LogMessage String where
+ toCStringLen = withCStringLen
+
+instance LogMessage ByteString where
+ toCStringLen = unsafeUseAsCStringLen
+
+-- This simplified syslog interface can deal efficiently with any LogMessage.
+-- It relies on the default 'Facility' to be configured globally.
+
+write :: LogMessage a => Priority -> a -> IO ()
+write pri msg = toCStringLen msg (syslog Nothing pri)
+
+-- Now write a couple of String and ByteString messages. On my system, the log
+-- file shows the following output:
+--
+-- May 12 19:49:18 myhost example[26995]: Hello, World.
+-- May 12 19:49:18 myhost example[26995]: Default logging mask is [Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug]
+
+main :: IO ()
+main =
+ withSyslog "example" [LogPID, Console] User $ do
+ write Info "Hello, World."
+ lm <- setlogmask [Debug]
+ write Info (pack "This message does not show up.")
+ write Debug ("Default logging mask is " ++ show lm)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/hsyslog.cabal new/hsyslog-5.0.1/hsyslog.cabal
--- old/hsyslog-4/hsyslog.cabal 2016-06-03 18:53:08.000000000 +0200
+++ new/hsyslog-5.0.1/hsyslog.cabal 2017-07-07 14:05:07.000000000 +0200
@@ -1,38 +1,77 @@
-Name: hsyslog
-Version: 4
-Copyright: Copyright (c) 2004-2016 by Peter Simons
-License: BSD3
-License-File: LICENSE
-Author: Peter Simons, John Lato, Jonathan Childress
-Maintainer: Peter Simons <simons(a)cryp.to>
-Homepage: http://github.com/peti/hsyslog
-Bug-Reports: http://github.com/peti/hsyslog/issues
-Category: Foreign
-Synopsis: FFI interface to syslog(3) from POSIX.1-2001
-Description: This library provides FFI bindings to syslog(3) from
- <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.
-Cabal-Version: >= 1.8
-Build-Type: Simple
-Tested-With: GHC > 7.6 && < 8.1
-
-Source-Repository head
- Type: git
- Location: git://github.com/peti/hsyslog.git
-
-Library
- Hs-Source-Dirs: src
- Build-Depends: base >= 3 && < 5
- , bytestring == 0.10.*
- Extensions: CApiFFI
- , ForeignFunctionInterface
- , OverloadedStrings
- Exposed-Modules: System.Posix.Syslog
-
-Test-Suite tests
- Hs-Source-Dirs: test
- Main-Is: Main.hs
- Type: exitcode-stdio-1.0
- Build-Depends: base
- , bytestring
- , hsyslog
- , QuickCheck
+name: hsyslog
+version: 5.0.1
+cabal-version: >= 1.10
+build-type: Custom
+license: BSD3
+license-file: LICENSE
+copyright: Copyright (c) 2004-2017 by Peter Simons
+author: Peter Simons, John Lato, Jonathan Childress
+maintainer: Peter Simons <simons(a)cryp.to>
+homepage: http://github.com/peti/hsyslog
+bug-reports: http://github.com/peti/hsyslog/issues
+synopsis: FFI interface to syslog(3) from POSIX.1-2001
+category: Foreign
+tested-with: GHC > 7.6 && < 8.3
+
+extra-source-files:
+ c-bits/simple-syslog.c
+ c-bits/make-log-mask.c
+
+description:
+ A Haskell interface to @syslog(3)@ as specified in
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ The entire public API lives in "System.Posix.Syslog". There is a set of exposed
+ modules available underneath that one, which contain various implementation details
+ that may be useful to other developers who want to implement syslog-related
+ functionality. /Users/ of @syslog@, however, do not need them.
+ .
+ An example program that demonstrates how to use this library is available in the
+ <https://github.com/peti/hsyslog/blob/master/example/Main.hs examples> directory of
+ this package.
+
+custom-setup
+ setup-depends: base >= 4 && <5,
+ Cabal,
+ cabal-doctest >= 1 && <1.1
+
+source-repository head
+ type: git
+ location: git://github.com/peti/hsyslog.git
+
+Flag install-examples
+ Description: Build and install example programs.
+ Default: False
+
+library
+ exposed-modules: System.Posix.Syslog
+ System.Posix.Syslog.Facility
+ System.Posix.Syslog.Functions
+ System.Posix.Syslog.LogMask
+ System.Posix.Syslog.Options
+ System.Posix.Syslog.Priority
+ build-depends: base >= 4.6 && < 5
+ other-extensions: ForeignFunctionInterface, DeriveGeneric
+ hs-source-dirs: src
+ c-sources: c-bits/simple-syslog.c
+ c-bits/make-log-mask.c
+ default-language: Haskell2010
+ build-tools: hsc2hs
+
+test-suite doctests
+ type: exitcode-stdio-1.0
+ main-is: doctests.hs
+ hs-source-dirs: test
+ build-depends: hsyslog, base, doctest
+ ghc-options: -threaded
+ default-language: Haskell2010
+
+executable hsyslog-example
+ main-is: Main.hs
+ hs-source-dirs: example
+ if flag(install-examples)
+ buildable: True
+ build-depends: base, hsyslog, bytestring
+ other-extensions: TypeSynonymInstances, FlexibleInstances
+ else
+ buildable: False
+ default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog/Facility.hsc new/hsyslog-5.0.1/src/System/Posix/Syslog/Facility.hsc
--- old/hsyslog-4/src/System/Posix/Syslog/Facility.hsc 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog/Facility.hsc 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,65 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ FFI bindings to @syslog(3)@ from
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ This module is intended for purposes of low-level implementation. Users of
+ this library should prefer safer and more convenient API provided by
+ "System.Posix.Syslog".
+-}
+
+module System.Posix.Syslog.Facility where
+
+import Foreign.C.Types
+import GHC.Generics ( Generic )
+
+#include <syslog.h>
+
+-- | Syslog distinguishes various system facilities. Most applications should
+-- log in 'USER'.
+
+data Facility = Kernel -- ^ kernel messages
+ | User -- ^ user-level messages (default unless set otherwise)
+ | Mail -- ^ mail system
+ | News -- ^ network news subsystem
+ | UUCP -- ^ UUCP subsystem
+ | Daemon -- ^ system daemons
+ | Auth -- ^ security and authorization messages
+ | Cron -- ^ clock daemon
+ | LPR -- ^ line printer subsystem
+ | Local0 -- ^ reserved for local use
+ | Local1 -- ^ reserved for local use
+ | Local2 -- ^ reserved for local use
+ | Local3 -- ^ reserved for local use
+ | Local4 -- ^ reserved for local use
+ | Local5 -- ^ reserved for local use
+ | Local6 -- ^ reserved for local use
+ | Local7 -- ^ reserved for local use
+ deriving (Show, Read, Bounded, Enum, Eq, Generic)
+
+-- | Translate a 'Facility' into the system-dependent identifier that's used by
+-- the @syslog(3)@ implementation.
+
+{-# INLINE fromFacility #-}
+fromFacility :: Facility -> CInt
+fromFacility Kernel = #{const LOG_KERN}
+fromFacility User = #{const LOG_USER}
+fromFacility Mail = #{const LOG_MAIL}
+fromFacility Daemon = #{const LOG_DAEMON}
+fromFacility Auth = #{const LOG_AUTH}
+fromFacility LPR = #{const LOG_LPR}
+fromFacility News = #{const LOG_NEWS}
+fromFacility UUCP = #{const LOG_UUCP}
+fromFacility Cron = #{const LOG_CRON}
+fromFacility Local0 = #{const LOG_LOCAL0}
+fromFacility Local1 = #{const LOG_LOCAL1}
+fromFacility Local2 = #{const LOG_LOCAL2}
+fromFacility Local3 = #{const LOG_LOCAL3}
+fromFacility Local4 = #{const LOG_LOCAL4}
+fromFacility Local5 = #{const LOG_LOCAL5}
+fromFacility Local6 = #{const LOG_LOCAL6}
+fromFacility Local7 = #{const LOG_LOCAL7}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog/Functions.hs new/hsyslog-5.0.1/src/System/Posix/Syslog/Functions.hs
--- old/hsyslog-4/src/System/Posix/Syslog/Functions.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog/Functions.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,71 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ Low-level FFI bindings to @syslog(3)@ et al from
+ <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.
+ This module is intended for purposes of low-level implementation. Users of
+ this library should prefer safer and more convenient API provided by
+ "System.Posix.Syslog"
+-}
+
+module System.Posix.Syslog.Functions where
+
+import Foreign.C
+
+-- | The POSIX function <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html syslog(3)>
+-- imported into Haskell directly as an "unsafe" C-API call. We chose this
+-- specific signature for the variadic function, because it's ideal for the
+-- efficient zero-copy implementation provided by the high-level function
+-- 'System.Posix.Syslog.syslog'.
+foreign import ccall unsafe "syslog.h simpleSyslog" _syslog
+ :: CInt -- ^ The system-specific identifier for 'System.Posix.Syslog.Facility'.
+ -> CInt -- ^ The system-specific identifier for 'System.Posix.Syslog.Priority'.
+ -> CString -- ^ The actual log message, which does not need to be
+ -- terminated by a NUL byte. It should not contain NUL bytes
+ -- either, though.
+ -> CInt -- ^ The length of the log message. Yes, this is a signed
+ -- integer. Yes, an unsigned integer would be better. No, I
+ -- can't do anything about it. It's frickin' C code from one
+ -- and a half centuries ago; what do you expect? Just don't
+ -- pass any negative values here, okay?
+ -> IO ()
+
+-- | The POSIX function <http://pubs.opengroup.org/onlinepubs/9699919799/functions/openlog.html openlog(3)>,
+-- imported into Haskell directly as an "unsafe" foreign function call.
+foreign import ccall unsafe "syslog.h openlog" _openlog
+ :: CString -- ^ A process-wide identifier to prepent to every log message.
+ -- Note that this string must exist until 'closelog' is called.
+ -- If the underlying memory buffer changes, the identifier used
+ -- by 'System.Posix.Syslog.syslog' /probably/ changes too. It's
+ -- safe to pass 'nullPtr', but POSIX does not specify how that
+ -- choice is
+ -- interpreted.
+ -> CInt -- ^ A bit set that combines various 'Option' values.
+ -> CInt -- ^ A default 'Facility' to use for messages that don't
+ -- specify one.
+ -> IO ()
+
+-- | The POSIX function <http://pubs.opengroup.org/onlinepubs/9699919799/functions/closelog.html closelog(3)>
+-- imported into Haskell directly as an "unsafe" foreign function call.
+foreign import ccall unsafe "syslog.h closelog" _closelog :: IO ()
+
+-- | The POSIX function <http://pubs.opengroup.org/onlinepubs/9699919799/functions/setlogmask.html setlogmask(3)>
+-- imported into Haskell directly as an "unsafe" foreign function call.
+foreign import ccall unsafe "syslog.h setlogmask" _setlogmask
+ :: CInt -- ^ A bit mask that determines which priorities are enabled or
+ -- disabled. See also '_LOG_MASK'.
+ -> IO CInt
+
+-- | The POSIX macro <http://pubs.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html LOG_MASK()>
+-- imported into Haskell directly as a pure, "unsafe" foreign function call. It
+-- does feel a little silly to bother with this functions since we pretty much know
+-- @
+-- _logMask = (2^)
+-- @
+-- for certain, but, well, POSIX provides this abstraction and so it's probably
+-- no good idea to make that assumption.
+foreign import ccall unsafe "makeLogMask" _logMask :: CInt -> CInt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog/LogMask.hs new/hsyslog-5.0.1/src/System/Posix/Syslog/LogMask.hs
--- old/hsyslog-4/src/System/Posix/Syslog/LogMask.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog/LogMask.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,31 @@
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ FFI bindings to @syslog(3)@ from
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ This module is intended for purposes of low-level implementation. Users of
+ this library should prefer safer and more convenient API provided by
+ "System.Posix.Syslog".
+-}
+
+module System.Posix.Syslog.LogMask where
+
+import System.Posix.Syslog.Functions ( _logMask )
+import System.Posix.Syslog.Priority ( Priority, fromPriority )
+
+import Data.Bits
+import Foreign.C.Types
+
+-- | Convert a set of logging priorities into a system-dependent binary
+-- representation suitable for calling '_setlogmask'.
+
+toLogMask :: [Priority] -> CInt
+toLogMask = foldr (.|.) 0 . map (_logMask . fromPriority)
+
+-- | Decode the the system-dependent binary representation returned by
+-- '_setlogmask' back into a set of logging priorities.
+
+fromLogMask :: CInt -> [Priority]
+fromLogMask old = [ p | p <- [minBound..maxBound], _logMask (fromPriority p) .&. old /= 0 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog/Options.hsc new/hsyslog-5.0.1/src/System/Posix/Syslog/Options.hsc
--- old/hsyslog-4/src/System/Posix/Syslog/Options.hsc 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog/Options.hsc 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,44 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ FFI bindings to @syslog(3)@ from
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ This module is intended for purposes of low-level implementation. Users of
+ this library should prefer safer and more convenient API provided by
+ "System.Posix.Syslog".
+-}
+
+module System.Posix.Syslog.Options where
+
+import Foreign.C.Types
+import GHC.Generics ( Generic )
+
+#include <syslog.h>
+
+-- | The function 'openlog' allows one to configure a handful of process-wide
+-- options that modify the bahavior of the 'syslog' funcion. These options are
+-- 'pid', 'cons', 'odelay', and 'ndelay'.
+
+data Option = LogPID -- ^ Log the pid with each message.
+ | Console -- ^ Log on the console if errors occur while sending messages.
+ | DelayedOpen -- ^ Delay all initialization until first @syslog()@ call (default).
+ | ImmediateOpen -- ^ Initalize the syslog system immediately.
+ | DontWaitForChildren -- ^ The syslog system should not attempt to wait for child
+ -- process it may have created. This option is required by
+ -- applications who enable @SIGCHLD@ themselves.
+ deriving (Show, Read, Bounded, Enum, Eq, Generic)
+
+-- | Translate an 'Option' into the system-dependent identifier that's used by
+-- the @syslog(3)@ implementation.
+
+{-# INLINE fromOption #-}
+fromOption :: Option -> CInt
+fromOption LogPID = #{const LOG_PID}
+fromOption Console = #{const LOG_CONS}
+fromOption DelayedOpen = #{const LOG_ODELAY}
+fromOption ImmediateOpen = #{const LOG_NDELAY}
+fromOption DontWaitForChildren = #{const LOG_NOWAIT}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog/Priority.hsc new/hsyslog-5.0.1/src/System/Posix/Syslog/Priority.hsc
--- old/hsyslog-4/src/System/Posix/Syslog/Priority.hsc 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog/Priority.hsc 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,61 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ FFI bindings to @syslog(3)@ from
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ This module is intended for purposes of low-level implementation. Users of
+ this library should prefer safer and more convenient API provided by
+ "System.Posix.Syslog".
+-}
+
+module System.Posix.Syslog.Priority where
+
+import Foreign.C
+import GHC.Generics ( Generic )
+
+#include <syslog.h>
+
+-- * Message Priorities
+
+-- | Log messages are prioritized with one of the following levels:
+--
+-- >>> [minBound..maxBound] :: [Priority]
+-- [Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug]
+--
+-- The 'Ord' instance for 'Priority' considers the more urgent level lower than
+-- less urgent ones:
+--
+-- >>> Emergency < Debug
+-- True
+-- >>> minimum [minBound..maxBound] :: Priority
+-- Emergency
+-- >>> maximum [minBound..maxBound] :: Priority
+-- Debug
+
+data Priority = Emergency -- ^ the system is unusable
+ | Alert -- ^ action must be taken immediately
+ | Critical -- ^ critical conditions
+ | Error -- ^ error conditions
+ | Warning -- ^ warning conditions
+ | Notice -- ^ normal but significant condition
+ | Info -- ^ informational
+ | Debug -- ^ debug-level messages
+ deriving (Show, Read, Eq, Ord, Bounded, Enum, Generic)
+
+-- | Translate a 'Priority' into the system-dependent identifier that's used by
+-- the @syslog(3)@ implementation.
+
+{-# INLINE fromPriority #-}
+fromPriority :: Priority -> CInt
+fromPriority Emergency = #{const LOG_EMERG}
+fromPriority Alert = #{const LOG_ALERT}
+fromPriority Critical = #{const LOG_CRIT}
+fromPriority Error = #{const LOG_ERR}
+fromPriority Warning = #{const LOG_WARNING}
+fromPriority Notice = #{const LOG_NOTICE}
+fromPriority Info = #{const LOG_INFO}
+fromPriority Debug = #{const LOG_DEBUG}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog.hs new/hsyslog-5.0.1/src/System/Posix/Syslog.hs
--- old/hsyslog-4/src/System/Posix/Syslog.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,115 @@
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: POSIX
+
+ A Haskell interface to @syslog(3)@ as specified in
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
+ The entire public API lives in this module. There is a set of exposed
+ modules available underneath this one, which contain various implementation
+ details that may be useful to other developers who want to implement
+ syslog-related functionality. /Users/ of syslog, however, do not need those
+ modules; "System.Posix.Syslog" has all you'll need.
+
+ Check out the
+ <https://github.com/peti/hsyslog/blob/master/example/Main.hs example program>
+ that demonstrates how to use this library.
+-}
+
+module System.Posix.Syslog
+ ( -- * Writing Log Messages
+ syslog, Priority(..), Facility(..)
+ , -- * Configuring the system's logging engine
+ openlog, closelog, withSyslog, setlogmask, Option(..)
+ )
+ where
+
+import System.Posix.Syslog.Facility
+import System.Posix.Syslog.Functions
+import System.Posix.Syslog.LogMask
+import System.Posix.Syslog.Options
+import System.Posix.Syslog.Priority
+
+import Control.Exception ( assert, bracket_ )
+import Data.Bits
+import Foreign.C
+
+-- |Log the given text message via @syslog(3)@. Please note that log messages
+-- are committed to the log /verbatim/ --- @printf()@-style text formatting
+-- features offered by the underlying system function are /not/ available. If
+-- your log message reads @"%s"@, then that string is exactly what will be
+-- written to the log. Also, log messages cannot contain @\\0@ bytes. If they
+-- do, all content following that byte will be cut off because the C function
+-- assumes that the string ends there.
+--
+-- The Haskell 'String' type can be easily logged with 'withCStringLen':
+--
+-- @
+-- withCStringLen "Hello, world." $ syslog (Just User) Info
+-- @
+--
+-- 'ByteStrings' can be logged in the same way with the 'unsafeUseAsCStringLen'
+-- function from @Data.ByteString.Unsafe@, which extracts a 'CStringLen' from
+-- the 'ByteString' in constant time (no copying!).
+
+syslog :: Maybe Facility -- ^ Categorize this message as belonging into the
+ -- given system facility. If left unspecified, the
+ -- process-wide default will be used, which tends to
+ -- be 'User' by default.
+ -> Priority -- ^ Log with the specified priority.
+ -> CStringLen -- ^ The actual log message. The string does not need
+ -- to be terminated by a @\\0@ byte. If the string
+ -- /does/ contain a @\\0@ byte, then the message ends
+ -- there regardless of what the length argument says.
+ -> IO ()
+syslog facil prio (ptr,len) = assert (len >= 0) $ do
+ _syslog (maybe 0 fromFacility facil) (fromPriority prio) ptr (fromIntegral len)
+
+-- | This function configures the process-wide hidden state of the system's
+-- syslog engine. It's probably a bad idea to call this function anywhere
+-- except at the very top of your program's 'main' function. And even then you
+-- should probably prefer 'withSyslog' instead, which guarantees that syslog is
+-- properly initialized within its scope.
+
+openlog :: CString -- ^ An identifier to prepend to all log messages,
+ -- typically the name of the programm. Note that the
+ -- memory that contains this name must remain valid
+ -- until the pointer provided here is released by
+ -- calling 'closelog'.
+ -> [Option] -- ^ A set of options that configure the behavior of
+ -- the system's syslog engine.
+ -> Facility -- ^ The facility to use by default when none has been
+ -- specified with a 'syslog' call.
+ -> IO ()
+openlog ident opts facil =
+ _openlog ident (foldr ((.|.) . fromOption) 0 opts) (fromFacility facil)
+
+-- | Release all syslog-related resources.
+
+closelog :: IO ()
+closelog = _closelog
+
+-- | Run the given @IO a@ computation within an initialized syslogging scope.
+-- The definition is:
+--
+-- @
+-- withSyslog ident opts facil f =
+-- 'withCString' ident $ \ptr ->
+-- 'bracket_' (openlog ptr opts facil) closelog f
+-- @
+
+withSyslog :: String -> [Option] -> Facility -> IO a -> IO a
+withSyslog ident opts facil f =
+ withCString ident $ \ptr ->
+ bracket_ (openlog ptr opts facil) closelog f
+
+-- | Configure a process-wide filter that determines which logging priorities
+-- are ignored and which ones are forwarded to the @syslog@ implementation. For
+-- example, use @setlogmask [Emergency .. Info]@ to filter out all debug-level
+-- messages from the message stream. Calling @setlogmask [minBound..maxBound]@
+-- enables /everything/. The special case @setlogmask []@ does /nothing/, i.e.
+-- the current filter configuration is not modified. This can be used to
+-- retrieve the current configuration.
+
+setlogmask :: [Priority] -> IO [Priority]
+setlogmask prios = fmap fromLogMask (_setlogmask (toLogMask prios))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/src/System/Posix/Syslog.hsc new/hsyslog-5.0.1/src/System/Posix/Syslog.hsc
--- old/hsyslog-4/src/System/Posix/Syslog.hsc 2016-06-03 18:53:08.000000000 +0200
+++ new/hsyslog-5.0.1/src/System/Posix/Syslog.hsc 1970-01-01 01:00:00.000000000 +0100
@@ -1,342 +0,0 @@
-{-# LANGUAGE
- CApiFFI
- , ForeignFunctionInterface
- , OverloadedStrings
- #-}
-
-#if __GLASGOW_HASKELL__ >= 706
-{-# LANGUAGE DeriveGeneric #-}
-#endif
-
-{- |
- Module : System.Posix.Syslog
- Maintainer : simons(a)cryp.to
- Stability : provisional
- Portability : Posix
-
- FFI bindings to syslog(3) from
- <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.
--}
-
-module System.Posix.Syslog
- ( -- * Marshaled Data Types
- Priority (..)
- , toPriority
- , fromPriority
- , Facility (..)
- , toFacility
- , fromFacility
- , Option (..)
- , toOption
- , fromOption
- , PriorityMask (..)
- , fromPriorityMask
- -- * Configuring syslog
- , SyslogConfig (..)
- , defaultConfig
- -- * The preferred Haskell API to syslog
- , withSyslog
- , SyslogFn
- -- * The unsafe Haskell API to syslog
- , syslogUnsafe
- -- * Low-level C functions
- -- | See the
- -- <http://pubs.opengroup.org/onlinepubs/9699919799/functions/closelog.html POSIX.1-2008 documentation>.
- , _openlog
- , _closelog
- , _setlogmask
- , _syslog
- -- ** Low-level C macros
- , _LOG_MAKEPRI
- , _LOG_MASK
- , _LOG_UPTO
- -- * Utilities
- -- | Low-level utilities for syslog-related tools
- , makePri
- ) where
-
-import Control.Exception (bracket_)
-import Data.Bits (Bits, (.|.))
-import Data.ByteString (ByteString, useAsCString)
-import Data.List (foldl')
-import Foreign.C (CInt (..), CString (..))
-
-#if __GLASGOW_HASKELL__ >= 706
-import GHC.Generics (Generic)
-#endif
-
-#include <syslog.h>
-#ifndef LOG_AUTHPRIV
-#define LOG_AUTHPRIV LOG_AUTH
-#endif
-
-#ifndef LOG_FTP
-#define LOG_FTP LOG_DAEMON
-#endif
-
-#ifndef LOG_PERROR
-#define LOG_PERROR 0
-#endif
-
--- | Log messages have a priority attached.
-
-data Priority
- = Emergency -- ^ system is unusable
- | Alert -- ^ action must be taken immediately
- | Critical -- ^ critical conditions
- | Error -- ^ error conditions
- | Warning -- ^ warning conditions
- | Notice -- ^ normal but significant condition
- | Info -- ^ informational
- | Debug -- ^ debug-level messages
- deriving ( Bounded, Enum, Eq, Show, Read
-#if __GLASGOW_HASKELL__ >= 706
- , Generic
-#endif
- )
-
-toPriority :: CInt -> Priority
-toPriority #{const LOG_EMERG} = Emergency
-toPriority #{const LOG_ALERT} = Alert
-toPriority #{const LOG_CRIT} = Critical
-toPriority #{const LOG_ERR} = Error
-toPriority #{const LOG_WARNING} = Warning
-toPriority #{const LOG_NOTICE} = Notice
-toPriority #{const LOG_INFO} = Info
-toPriority #{const LOG_DEBUG} = Debug
-toPriority i = error (shows i " is not a valid syslog priority value")
-
-fromPriority :: Priority -> CInt
-fromPriority Emergency = #{const LOG_EMERG}
-fromPriority Alert = #{const LOG_ALERT}
-fromPriority Critical = #{const LOG_CRIT}
-fromPriority Error = #{const LOG_ERR}
-fromPriority Warning = #{const LOG_WARNING}
-fromPriority Notice = #{const LOG_NOTICE}
-fromPriority Info = #{const LOG_INFO}
-fromPriority Debug = #{const LOG_DEBUG}
-
--- | Syslog distinguishes various system facilities. Most applications should
--- log in 'USER'.
-
-data Facility
- = KERN -- ^ kernel messages
- | USER -- ^ user-level messages (default unless set otherwise)
- | MAIL -- ^ mail system
- | DAEMON -- ^ system daemons
- | AUTH -- ^ security\/authorization messages
- | SYSLOG -- ^ messages generated internally by syslogd
- | LPR -- ^ line printer subsystem
- | NEWS -- ^ network news subsystem
- | UUCP -- ^ UUCP subsystem
- | CRON -- ^ clock daemon
- | AUTHPRIV -- ^ security\/authorization messages (effectively equals 'AUTH' on some systems)
- | FTP -- ^ ftp daemon (effectively equals 'DAEMON' on some systems)
- | LOCAL0 -- ^ reserved for local use
- | LOCAL1 -- ^ reserved for local use
- | LOCAL2 -- ^ reserved for local use
- | LOCAL3 -- ^ reserved for local use
- | LOCAL4 -- ^ reserved for local use
- | LOCAL5 -- ^ reserved for local use
- | LOCAL6 -- ^ reserved for local use
- | LOCAL7 -- ^ reserved for local use
- deriving ( Bounded, Enum, Eq, Show, Read
-#if __GLASGOW_HASKELL__ >= 706
- , Generic
-#endif
- )
-
-toFacility :: CInt -> Facility
-toFacility #{const LOG_KERN} = KERN
-toFacility #{const LOG_USER} = USER
-toFacility #{const LOG_MAIL} = MAIL
-toFacility #{const LOG_DAEMON} = DAEMON
-toFacility #{const LOG_AUTH} = AUTH
-toFacility #{const LOG_SYSLOG} = SYSLOG
-toFacility #{const LOG_LPR} = LPR
-toFacility #{const LOG_NEWS} = NEWS
-toFacility #{const LOG_UUCP} = UUCP
-toFacility #{const LOG_CRON} = CRON
-toFacility #{const LOG_AUTHPRIV} = AUTHPRIV
-toFacility #{const LOG_FTP} = FTP
-toFacility #{const LOG_LOCAL0} = LOCAL0
-toFacility #{const LOG_LOCAL1} = LOCAL1
-toFacility #{const LOG_LOCAL2} = LOCAL2
-toFacility #{const LOG_LOCAL3} = LOCAL3
-toFacility #{const LOG_LOCAL4} = LOCAL4
-toFacility #{const LOG_LOCAL5} = LOCAL5
-toFacility #{const LOG_LOCAL6} = LOCAL6
-toFacility #{const LOG_LOCAL7} = LOCAL7
-toFacility i = error (shows i " is not a valid syslog facility value")
-
-fromFacility :: Facility -> CInt
-fromFacility KERN = #{const LOG_KERN}
-fromFacility USER = #{const LOG_USER}
-fromFacility MAIL = #{const LOG_MAIL}
-fromFacility DAEMON = #{const LOG_DAEMON}
-fromFacility AUTH = #{const LOG_AUTH}
-fromFacility SYSLOG = #{const LOG_SYSLOG}
-fromFacility LPR = #{const LOG_LPR}
-fromFacility NEWS = #{const LOG_NEWS}
-fromFacility UUCP = #{const LOG_UUCP}
-fromFacility CRON = #{const LOG_CRON}
-fromFacility AUTHPRIV = #{const LOG_AUTHPRIV}
-fromFacility FTP = #{const LOG_FTP}
-fromFacility LOCAL0 = #{const LOG_LOCAL0}
-fromFacility LOCAL1 = #{const LOG_LOCAL1}
-fromFacility LOCAL2 = #{const LOG_LOCAL2}
-fromFacility LOCAL3 = #{const LOG_LOCAL3}
-fromFacility LOCAL4 = #{const LOG_LOCAL4}
-fromFacility LOCAL5 = #{const LOG_LOCAL5}
-fromFacility LOCAL6 = #{const LOG_LOCAL6}
-fromFacility LOCAL7 = #{const LOG_LOCAL7}
-
--- | 'withSyslog' options for the syslog service.
-
-data Option
- = PID -- ^ log the pid with each message
- | CONS -- ^ log on the console if errors in sending
- | ODELAY -- ^ delay open until first @syslog()@ (default)
- | NDELAY -- ^ don't delay open
- | NOWAIT -- ^ don't wait for console forks: DEPRECATED
- | PERROR -- ^ log to 'stderr' as well (might be a no-op on some systems)
- deriving ( Bounded, Enum, Eq, Show, Read
-#if __GLASGOW_HASKELL__ >= 706
- , Generic
-#endif
- )
-
-toOption :: CInt -> Option
-toOption #{const LOG_PID} = PID
-toOption #{const LOG_CONS} = CONS
-toOption #{const LOG_ODELAY} = ODELAY
-toOption #{const LOG_NDELAY} = NDELAY
-toOption #{const LOG_NOWAIT} = NOWAIT
-toOption #{const LOG_PERROR} = PERROR
-toOption i = error (shows i " is not a valid syslog option value")
-
-fromOption :: Option -> CInt
-fromOption PID = #{const LOG_PID}
-fromOption CONS = #{const LOG_CONS}
-fromOption ODELAY = #{const LOG_ODELAY}
-fromOption NDELAY = #{const LOG_NDELAY}
-fromOption NOWAIT = #{const LOG_NOWAIT}
-fromOption PERROR = #{const LOG_PERROR}
-
--- | 'withSyslog' options for the priority mask.
-
-data PriorityMask
- = NoMask -- ^ allow all messages thru
- | Mask [Priority] -- ^ allow only messages with the priorities listed
- | UpTo Priority -- ^ allow only messages down to and including the specified priority
- deriving ( Eq, Show, Read
-#if __GLASGOW_HASKELL__ >= 706
- , Generic
-#endif
- )
-
-fromPriorityMask :: PriorityMask -> CInt
-fromPriorityMask (Mask pris) = bitsOrWith (_LOG_MASK . fromPriority) pris
-fromPriorityMask (UpTo pri) = _LOG_UPTO $ fromPriority pri
-fromPriorityMask NoMask = 0
-
-data SyslogConfig = SyslogConfig
- { identifier :: ByteString
- -- ^ string appended to each log message
- , options :: [Option]
- -- ^ options for syslog behavior
- , defaultFacility :: Facility
- -- ^ facility logged to when none are provided (currently unsupported)
- , priorityMask :: PriorityMask
- -- ^ filter by priority which messages are logged
- }
- deriving (Eq, Show)
-
--- | A practical default syslog config. You'll at least want to change the
--- identifier.
-
-defaultConfig :: SyslogConfig
-defaultConfig = SyslogConfig "hsyslog" [ODELAY] USER NoMask
-
--- | Bracket an 'IO' computation between calls to '_openlog', '_setlogmask',
--- and '_closelog', providing a logging function which can be used as follows:
---
--- > main = withSyslog defaultConfig $ \syslog -> do
--- > putStrLn "huhu"
--- > syslog USER Debug "huhu"
---
--- Note that these are /process-wide/ settings, so multiple calls to
--- this function will interfere with each other in unpredictable ways.
-
-withSyslog :: SyslogConfig -> (SyslogFn -> IO ()) -> IO ()
-withSyslog config f =
- useAsCString (identifier config) $ \cIdent ->
- let
- open :: IO ()
- open = do
- _openlog cIdent cOpts cFac
- _setlogmask cMask
- return ()
- where
- cFac = fromFacility $ defaultFacility config
- cMask = fromPriorityMask $ priorityMask config
- cOpts = bitsOrWith fromOption $ options config
-
- close :: IO ()
- close = _closelog
-
- run :: IO ()
- run = do
- useAsCString escape (f . syslogEscaped)
- return ()
- in
- bracket_ open close run
-
--- | The type of function provided by 'withSyslog'.
-
-type SyslogFn
- = Facility -- ^ the facility to log to
- -> Priority -- ^ the priority under which to log
- -> ByteString -- ^ the message to log
- -> IO ()
-
--- | Provides no guarantee that a call to '_openlog' has been made, inviting
--- unpredictable results.
-
-syslogUnsafe :: SyslogFn
-syslogUnsafe fac pri msg = useAsCString msg (_syslog (makePri fac pri))
-
--- foreign imports
-
-foreign import ccall unsafe "openlog" _openlog :: CString -> CInt -> CInt -> IO ()
-foreign import ccall unsafe "closelog" _closelog :: IO ()
-foreign import ccall unsafe "setlogmask" _setlogmask :: CInt -> IO CInt
-
-foreign import ccall unsafe "syslog" _syslogEscaped
- :: CInt -> CString -> CString -> IO ()
-
-_syslog :: CInt -> CString -> IO ()
-_syslog int msg = useAsCString escape $ \e -> _syslogEscaped int e msg
-
-foreign import capi "syslog.h LOG_MAKEPRI" _LOG_MAKEPRI :: CInt -> CInt -> CInt
-foreign import capi "syslog.h LOG_MASK" _LOG_MASK :: CInt -> CInt
-foreign import capi "syslog.h LOG_UPTO" _LOG_UPTO :: CInt -> CInt
-
--- utilities
-
--- | Calculate the full priority value of a 'Facility' and 'Priority'
-
-makePri :: Facility -> Priority -> CInt
-makePri fac pri = _LOG_MAKEPRI (fromFacility fac) (fromPriority pri)
-
--- internal functions
-
-bitsOrWith :: (Bits b, Num b) => (a -> b) -> [a] -> b
-bitsOrWith f = foldl' (\bits x -> f x .|. bits) 0
-
-escape :: ByteString
-escape = "%s"
-
-syslogEscaped :: CString -> Facility -> Priority -> ByteString -> IO ()
-syslogEscaped esc fac pri msg =
- useAsCString msg (_syslogEscaped (makePri fac pri) esc)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/test/Main.hs new/hsyslog-5.0.1/test/Main.hs
--- old/hsyslog-4/test/Main.hs 2016-06-03 18:53:08.000000000 +0200
+++ new/hsyslog-5.0.1/test/Main.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,48 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Main (main) where
-
-import Data.ByteString.Char8
-import System.Posix.Syslog
-import Test.QuickCheck
-import Test.QuickCheck.Property
-
-instance Arbitrary Priority where
- arbitrary = arbitraryBoundedEnum
-
-instance Arbitrary Facility where
- arbitrary = arbitraryBoundedEnum
-
-instance Arbitrary ByteString where
- arbitrary = fmap pack arbitrary
-
-main :: IO ()
-main = do
- outputTest
- dontExplodeTest
-
-{--
- This isn't a true test. Instead, we're passing the PERROR option (meaning
- syslog will also send messages to STDERR), sending a message that should be
- whitelisted by the priority mask, and sending a message that should be
- blacklisted by the priority mask. If hsyslog is working correctly, then only
- "hsyslog is working" should appear in your test log output.
---}
-outputTest :: IO ()
-outputTest = withSyslog config $ \syslog -> do
- syslog USER Debug "%s%d hsyslog is working :)"
- syslog USER Error "hsyslog is not working :("
- where
- config = defaultConfig
- { options = [PERROR, NDELAY]
- , priorityMask = Mask [Debug, Alert]
- }
-
-dontExplodeTest :: IO ()
-dontExplodeTest = withSyslog defaultConfig $ \syslog -> do
- let
- prop_dontExplode :: Facility -> Priority -> ByteString -> Property
- prop_dontExplode fac pri msg = ioProperty $ do
- syslog fac pri msg
- return succeeded
- quickCheck prop_dontExplode
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hsyslog-4/test/doctests.hs new/hsyslog-5.0.1/test/doctests.hs
--- old/hsyslog-4/test/doctests.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hsyslog-5.0.1/test/doctests.hs 2017-07-07 14:05:07.000000000 +0200
@@ -0,0 +1,10 @@
+module Main where
+
+import Build_doctests (flags, pkgs, module_sources)
+import Data.Foldable (traverse_)
+import Test.DocTest (doctest)
+
+main :: IO ()
+main = do let args = flags ++ pkgs ++ module_sources
+ traverse_ putStrLn args -- optionally print arguments
+ doctest args
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-hspec-core for openSUSE:Factory checked in at 2017-08-31 20:47:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hspec-core (Old)
and /work/SRC/openSUSE:Factory/.ghc-hspec-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hspec-core"
Thu Aug 31 20:47:45 2017 rev:5 rq:513391 version:2.4.4
Changes:
-------…
[View More]-
--- /work/SRC/openSUSE:Factory/ghc-hspec-core/ghc-hspec-core.changes 2017-06-22 10:37:52.502922147 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-hspec-core.new/ghc-hspec-core.changes 2017-08-31 20:47:46.928563976 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:42 UTC 2017 - psimons(a)suse.com
+
+- Update to version 2.4.4.
+
+-------------------------------------------------------------------
Old:
----
hspec-core-2.4.3.tar.gz
hspec-core.cabal
New:
----
hspec-core-2.4.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hspec-core.spec ++++++
--- /var/tmp/diff_new_pack.o8gyl4/_old 2017-08-31 20:47:48.092400613 +0200
+++ /var/tmp/diff_new_pack.o8gyl4/_new 2017-08-31 20:47:48.104398929 +0200
@@ -19,14 +19,13 @@
%global pkg_name hspec-core
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 2.4.3
+Version: 2.4.4
Release: 0
Summary: A Testing Framework for Haskell
License: MIT
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-QuickCheck-devel
@@ -70,7 +69,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ hspec-core-2.4.3.tar.gz -> hspec-core-2.4.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-core-2.4.3/hspec-core.cabal new/hspec-core-2.4.4/hspec-core.cabal
--- old/hspec-core-2.4.3/hspec-core.cabal 2017-03-25 12:27:37.000000000 +0100
+++ new/hspec-core-2.4.4/hspec-core.cabal 2017-06-16 11:08:23.000000000 +0200
@@ -1,9 +1,9 @@
--- This file has been generated from package.yaml by hpack version 0.17.0.
+-- This file has been generated from package.yaml by hpack version 0.18.0.
--
-- see: https://github.com/sol/hpack
name: hspec-core
-version: 2.4.3
+version: 2.4.4
license: MIT
license-file: LICENSE
copyright: (c) 2011-2017 Simon Hengel,
@@ -40,7 +40,7 @@
, deepseq
, HUnit >= 1.2.5
, QuickCheck >= 2.5.1
- , quickcheck-io
+ , quickcheck-io >= 0.2.0
, hspec-expectations == 0.8.2.*
, async >= 2
, call-stack
@@ -93,7 +93,7 @@
, deepseq
, HUnit >= 1.2.5
, QuickCheck >= 2.5.1
- , quickcheck-io
+ , quickcheck-io >= 0.2.0
, hspec-expectations == 0.8.2.*
, async >= 2
, call-stack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-core-2.4.3/src/Test/Hspec/Core/Example.hs new/hspec-core-2.4.4/src/Test/Hspec/Core/Example.hs
--- old/hspec-core-2.4.3/src/Test/Hspec/Core/Example.hs 2017-03-25 12:27:37.000000000 +0100
+++ new/hspec-core-2.4.4/src/Test/Hspec/Core/Example.hs 2017-06-16 11:08:23.000000000 +0200
@@ -185,10 +185,12 @@
sanitizeFailureMessage r = let m = QC.output r in strip $
#if MIN_VERSION_QuickCheck(2,7,0)
case QC.theException r of
- Just e -> let numbers = formatNumbers r in
- "uncaught exception: " ++ formatException e ++ " " ++ numbers ++ "\n" ++ case lines m of
- x:xs | x == (exceptionPrefix ++ show e ++ "' " ++ numbers ++ ": ") -> unlines xs
- _ -> m
+ Just e -> case E.fromException e :: Maybe (HUnit.HUnitFailure) of
+ Just _ -> (addFalsifiable . stripFailed) m
+ Nothing -> let numbers = formatNumbers r in
+ "uncaught exception: " ++ formatException e ++ " " ++ numbers ++ "\n" ++ case lines m of
+ x:xs | x == (exceptionPrefix ++ show e ++ "' " ++ numbers ++ ": ") -> unlines xs
+ _ -> m
Nothing ->
#endif
(addFalsifiable . stripFailed) m
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-hspec-contrib for openSUSE:Factory checked in at 2017-08-31 20:47:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hspec-contrib (Old)
and /work/SRC/openSUSE:Factory/.ghc-hspec-contrib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hspec-contrib"
Thu Aug 31 20:47:43 2017 rev:3 rq:513390 version:0.4.0
…
[View More]Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hspec-contrib/ghc-hspec-contrib.changes 2017-03-24 02:14:57.472916116 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hspec-contrib.new/ghc-hspec-contrib.changes 2017-08-31 20:47:44.416916525 +0200
@@ -1,0 +2,5 @@
+Sat Jul 22 03:02:03 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.4.0 revision 1.
+
+-------------------------------------------------------------------
New:
----
hspec-contrib.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hspec-contrib.spec ++++++
--- /var/tmp/diff_new_pack.jJYBMr/_old 2017-08-31 20:47:45.312790775 +0200
+++ /var/tmp/diff_new_pack.jJYBMr/_new 2017-08-31 20:47:45.336787407 +0200
@@ -26,6 +26,7 @@
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-hspec-core-devel
@@ -52,6 +53,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ hspec-contrib.cabal ++++++
name: hspec-contrib
version: 0.4.0
x-revision: 1
license: MIT
license-file: LICENSE
copyright: (c) 2011-2017 Simon Hengel,
(c) 2014 Junji Hashimoto
maintainer: Simon Hengel <sol(a)typeful.net>
build-type: Simple
cabal-version: >= 1.10
category: Testing
stability: experimental
bug-reports: https://github.com/hspec/hspec/issues
homepage: http://hspec.github.io/
synopsis: Contributed functionality for Hspec
description: Contributed functionality for Hspec
source-repository head
type: git
location: https://github.com/hspec/hspec
subdir: hspec-contrib
library
ghc-options:
-Wall
hs-source-dirs:
src
build-depends:
base == 4.*
, hspec-core >= 2.4.0
, HUnit
exposed-modules:
Test.Hspec.Contrib.Retry
Test.Hspec.Contrib.HUnit
other-modules:
default-language: Haskell2010
test-suite spec
type:
exitcode-stdio-1.0
hs-source-dirs:
test
main-is:
Spec.hs
other-modules:
Helper
Test.Hspec.Contrib.RetrySpec
Test.Hspec.Contrib.HUnitSpec
ghc-options:
-Wall
build-depends:
base == 4.*
, hspec-core
, HUnit
, hspec-contrib
, hspec
, QuickCheck
default-language: Haskell2010
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-hquantlib for openSUSE:Factory checked in at 2017-08-31 20:47:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hquantlib (Old)
and /work/SRC/openSUSE:Factory/.ghc-hquantlib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hquantlib"
Thu Aug 31 20:47:41 2017 rev:3 rq:513386 version:0.0.4.0
Changes:
--------
…
[View More]--- /work/SRC/openSUSE:Factory/ghc-hquantlib/ghc-hquantlib.changes 2017-06-04 01:57:38.442749626 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-hquantlib.new/ghc-hquantlib.changes 2017-08-31 20:47:42.793144447 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 03:01:26 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.0.4.0 revision 1.
+
+-------------------------------------------------------------------
New:
----
hquantlib.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hquantlib.spec ++++++
--- /var/tmp/diff_new_pack.lEZMkj/_old 2017-08-31 20:47:43.741011399 +0200
+++ /var/tmp/diff_new_pack.lEZMkj/_new 2017-08-31 20:47:43.765008032 +0200
@@ -26,6 +26,7 @@
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-containers-devel
@@ -68,6 +69,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ hquantlib.cabal ++++++
name: hquantlib
version: 0.0.4.0
x-revision: 1
license: LGPL
license-file: LICENSE
author: Pavel Ryzhov
maintainer: Pavel Ryzhov <pavel.ryzhov(a)gmail.com>
category: Finance
synopsis: HQuantLib is a port of essencial parts of QuantLib to Haskell
description: HQuantLib is intended to be a functional style port of QuantLib (http://quantlib.org)
build-type: Simple
stability: alpha
homepage: http://github.com/paulrzcz/hquantlib.git
cabal-version: >= 1.18.0
source-repository head
type: git
location: https://github.com/paulrzcz/hquantlib.git
source-repository this
type: git
location: https://github.com/paulrzcz/hquantlib.git
tag: 0.0.3.4
flag optimize
description : Enable optimizations for library and benchmarks
default : True
library
default-language: Haskell2010
exposed-modules:
QuantLib
QuantLib.Event
QuantLib.Instruments
QuantLib.Currencies
QuantLib.Stochastic
QuantLib.Priceable
QuantLib.PricingEngines
QuantLib.PricingEngines.BlackFormula
QuantLib.Quotes
QuantLib.Time
QuantLib.TimeSeries
QuantLib.Money
QuantLib.Math
QuantLib.Math.Copulas
QuantLib.Models
QuantLib.Models.Volatility
QuantLib.Prices
QuantLib.Position
QuantLib.Options
QuantLib.Methods.MonteCarlo
QuantLib.Methods.Pricer
other-modules:
QuantLib.Currencies.America
QuantLib.Currencies.Europe
QuantLib.Instruments.Instrument
QuantLib.Instruments.Stock
QuantLib.Stochastic.Discretize
QuantLib.Stochastic.Process
QuantLib.Stochastic.Random
QuantLib.Currency
QuantLib.Time.Date
QuantLib.Time.DayCounter
QuantLib.Math.InverseNormal
QuantLib.Stochastic.PureMT
build-depends:
base >3 && <5,
random >= 1.0 && < 2.0,
time >= 1.4.0.0 && < 1.9.0.0,
containers >= 0.5.0.0 && < 0.6.0.0,
hmatrix >= 0.17.0.0 && < 0.19.0.0,
hmatrix-gsl >= 0.17.0.0 && < 0.19.0.0,
hmatrix-special >= 0.4.0 && < 0.5.0,
parallel >= 3.2.0.0 && < 3.3.0.0,
mersenne-random-pure64 >= 0.2.0.0 && < 0.3.0.0,
statistics >= 0.13.0.0 && < 0.15.0.0,
vector >= 0.11.0.0 && < 0.13.0.0,
vector-algorithms >= 0.7.0.0 && < 0.8.0.0
hs-source-dirs: src
ghc-options: -Wall
if flag(optimize)
ghc-options: -funbox-strict-fields -O2 -fspec-constr -fdicts-cheap
executable mctest
default-language: Haskell2010
main-is : Tests/McTest.hs
hs-source-dirs : src
ghc-options : -threaded -rtsopts
other-modules : QuantLib.Math.InverseNormal
QuantLib.Methods.MonteCarlo
QuantLib.Methods.Pricer
QuantLib.Stochastic
QuantLib.Stochastic.Discretize
QuantLib.Stochastic.Process
QuantLib.Stochastic.Random
build-depends : base,
hquantlib,
parallel,
mersenne-random-pure64,
containers,
time
Test-Suite main-test
default-language: Haskell2010
type : exitcode-stdio-1.0
main-is : Test.hs
hs-source-dirs : src
build-depends : base,
test-framework >= 0.8 && < 0.9,
test-framework-hunit >= 0.3.0 && < 0.4.0,
test-framework-quickcheck2 >= 0.3.0.0 && < 0.4.0,
QuickCheck >= 2.8.0 && < 3.0.0,
HUnit >= 1.2.5.2 && < 2.0.0.0
[View Less]
1
0