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/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)
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:
--------
--- /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
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:
--------
--- /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"
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: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
]
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 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
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/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
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/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
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:
--------
--- /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
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
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
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:
--------
--- /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
1
0
Hello community,
here is the log from the commit of package ghc-hopenssl for openSUSE:Factory checked in at 2017-08-31 20:47:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hopenssl (Old)
and /work/SRC/openSUSE:Factory/.ghc-hopenssl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hopenssl"
Thu Aug 31 20:47:37 2017 rev:2 rq:513385 version:2.2.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hopenssl/ghc-hopenssl.changes 2017-03-08 00:54:47.265586267 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hopenssl.new/ghc-hopenssl.changes 2017-08-31 20:47:40.181511032 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:59 UTC 2017 - psimons(a)suse.com
+
+- Update to version 2.2.1.
+
+-------------------------------------------------------------------
Old:
----
hopenssl-1.7.tar.gz
New:
----
hopenssl-2.2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hopenssl.spec ++++++
--- /var/tmp/diff_new_pack.g5Ttsr/_old 2017-08-31 20:47:41.045389773 +0200
+++ /var/tmp/diff_new_pack.g5Ttsr/_new 2017-08-31 20:47:41.049389211 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-hopenssl
#
-# 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
@@ -17,38 +17,39 @@
%global pkg_name hopenssl
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.7
+Version: 2.2.1
Release: 0
-Summary: FFI bindings to OpenSSL's EVP digest interface
+Summary: FFI Bindings to OpenSSL's EVP Digest Interface
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…
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-bytestring-devel
-BuildRequires: ghc-mtl-devel
+BuildRequires: ghc-cabal-doctest-devel
BuildRequires: ghc-rpm-macros
BuildRequires: libopenssl-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# End cabal-rpm deps
+%if %{with tests}
+BuildRequires: ghc-HUnit-devel
+BuildRequires: ghc-doctest-devel
+%endif
%description
-Foreign-function bindings to the OpenSSL library <http://www.openssl.org/>.
+Foreign-function bindings to the <http://www.openssl.org/ OpenSSL library>.
Currently provides access to the messages digests MD5, DSS, DSS1, RIPEMD160,
-and several variants of SHA through the EVP digest interface.
+and various SHA variants through the EVP digest interface.
%package devel
Summary: Haskell %{pkg_name} library development files
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
-# Begin cabal-rpm deps:
Requires: libopenssl-devel
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}
-# End cabal-rpm deps
%description devel
This package provides the Haskell %{pkg_name} library development files.
@@ -56,14 +57,14 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
+%check
+%cabal_test
%post devel
%ghc_pkg_recache
++++++ hopenssl-1.7.tar.gz -> hopenssl-2.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/OpenSSL/Digest/ByteString/Lazy.hs new/hopenssl-2.2.1/OpenSSL/Digest/ByteString/Lazy.hs
--- old/hopenssl-1.7/OpenSSL/Digest/ByteString/Lazy.hs 2014-12-17 18:25:00.000000000 +0100
+++ new/hopenssl-2.2.1/OpenSSL/Digest/ByteString/Lazy.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-{- |
- Module : OpenSSL.Digest.ByteString.Lazy
- Copyright : (c) 2010 by Peter Simons
- License : BSD3
-
- Maintainer : simons(a)cryp.to
- Stability : provisional
- Portability : portable
-
- Wrappers for "OpenSSL.Digest" that supports lazy 'ByteString'.
- -}
-
-module OpenSSL.Digest.ByteString.Lazy where
-
-import OpenSSL.Digest hiding ( update )
-import Data.Word ( Word8 )
-import Control.Monad.State ( evalStateT )
-import qualified OpenSSL.Digest.ByteString as BS ( update )
-import Data.ByteString.Lazy ( ByteString, toChunks )
-
--- |A convenience wrapper which computes the given digest type of a
--- 'ByteString'. Unlike the monadic interface, this function does not
--- allow the computation to be restarted.
-
-digest :: MessageDigest -> ByteString -> IO [Word8]
-digest mdType xs =
- mkDigest mdType $ evalStateT (update xs >> final)
-
--- |Update the internal state with a block of data.
-
-update :: ByteString -> Digest Int
-update = fmap sum . mapM BS.update . toChunks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/OpenSSL/Digest/ByteString.hs new/hopenssl-2.2.1/OpenSSL/Digest/ByteString.hs
--- old/hopenssl-1.7/OpenSSL/Digest/ByteString.hs 2014-12-17 18:25:00.000000000 +0100
+++ new/hopenssl-2.2.1/OpenSSL/Digest/ByteString.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,38 +0,0 @@
-{- |
- Module : OpenSSL.Digest.ByteString
- Copyright : (c) 2010 by Peter Simons
- License : BSD3
-
- Maintainer : simons(a)cryp.to
- Stability : provisional
- Portability : portable
-
- Wrappers for "OpenSSL.Digest" that supports 'ByteString'.
- -}
-
-module OpenSSL.Digest.ByteString where
-
-import OpenSSL.Digest hiding ( update )
-import Control.Monad.State ( evalStateT, lift, get )
-import Foreign.Ptr ( castPtr )
-import Data.Word ( Word8 )
-import Data.ByteString ( ByteString )
-import Data.ByteString.Unsafe ( unsafeUseAsCStringLen )
-
--- |A convenience wrapper which computes the given digest type of a
--- 'ByteString'. Unlike the monadic interface, this function does not
--- allow the computation to be restarted.
-
-digest :: MessageDigest -> ByteString -> IO [Word8]
-digest mdType xs =
- mkDigest mdType $ evalStateT (update xs >> final)
-
--- |Update the internal state with a block of data.
-
-update :: ByteString -> Digest Int
-update bs = do
- DST ctx <- get
- l <- lift $
- unsafeUseAsCStringLen bs $ \(ptr, len) ->
- digestUpdate ctx (castPtr ptr) (fromIntegral len)
- return (fromEnum l)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/OpenSSL/Digest.hs new/hopenssl-2.2.1/OpenSSL/Digest.hs
--- old/hopenssl-1.7/OpenSSL/Digest.hs 2014-12-17 18:25:00.000000000 +0100
+++ new/hopenssl-2.2.1/OpenSSL/Digest.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,237 +0,0 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
-
-{- |
- Module : OpenSSL.Digest
- Copyright : (c) 2014 by Peter Simons
- License : BSD3
-
- Maintainer : simons(a)cryp.to
- Stability : provisional
- Portability : portable
-
- This module proivdes a high-level API to the message
- digest algorithms found in OpenSSL's @crypto@ library.
- Link with @-lcrypto@ when using this module.
-
- Here is a short example program which runs all available
- digests on a string:
-
- > example :: (Enum a) => [a] -> IO [String]
- > example input = mapM hash [minBound .. maxBound]
- > where
- > hash f = fmap (fmt f) (digest f (toWord input))
- > fmt f = shows f . (": \t"++) . (>>=toHex)
- > toWord = map (toEnum . fromEnum)
-
- And when called, the function prints:
-
- > *Digest> example "open sesame" >>= putStr . unlines
- > Null:
- > MD5: 54ef36ec71201fdf9d1423fd26f97f6b
- > SHA: 2ccefef64c76ac0d42ca1657457977675890c42f
- > SHA1: 5bcaff7f22ff533ca099b3408ead876c0ebba9a7
- > DSS: 5bcaff7f22ff533ca099b3408ead876c0ebba9a7
- > DSS1: 5bcaff7f22ff533ca099b3408ead876c0ebba9a7
- > RIPEMD160: bdb2bba6ec93bd566dc1181cadbc92176aa78382
- > MDC2: 112db2200ce1e9db3c2d132aea4ef7d0
- > SHA224: 1ee0f9d93a873a67fe781852d716cb3e5904e015aafaa4d1ff1a81bc
- > SHA256: 41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb
- > SHA384: ae2a5d6649035c00efe2bc1b5c97f4d5ff97fa2df06f273afa0231c425e8aff30e4cc1db5e5756e8d2245a1514ad1a2d
- > SHA512: 8470cdd3bf1ef85d5f092bce5ae5af97ce50820481bf43b2413807fec37e2785b533a65d4c7d71695b141d81ebcd4b6c4def4284e6067f0b400000001b230205
--}
-
-module OpenSSL.Digest where
-
-import Control.Exception ( bracket )
-import Foreign
-import Foreign.C
-import Control.Monad.State
-import Numeric ( showHex )
-
--- * High-level API
-
--- |The message digest algorithms we support.
-
-data MessageDigest
- = Null -- ^ 0 bit
- | MD5 -- ^ 128 bit
- | SHA -- ^ 160 bit
- | SHA1 -- ^ 160 bit
- | DSS -- ^ other name for SHA1
- | DSS1 -- ^ other name for SHA1
- | RIPEMD160 -- ^ 160 bit
- | MDC2 -- ^ 128 bit
- | SHA224 -- ^ 224 bit
- | SHA256 -- ^ 256 bit
- | SHA384 -- ^ 384 bit
- | SHA512 -- ^ 512 bit
- deriving (Show, Eq, Enum, Bounded)
-
--- |A convenience wrapper which computes the given digest
--- over a list of 'Word8'. Unlike the monadic interface,
--- this function does not allow the computation to be
--- restarted.
-
-digest :: MessageDigest -> [Word8] -> IO [Word8]
-digest mdType xs =
- mkDigest mdType $ evalStateT (update xs >> final)
-
--- |A monadic interface to the digest computation.
-
-type Digest a = StateT DigestState IO a
-
--- |The internal EVP context.
-
-newtype DigestState = DST (Ptr OpaqueContext)
-
--- |Run an 'IO' computation with an initialized
--- 'DigestState'. All resources will be freed when the
--- computation returns.
-
-mkDigest :: MessageDigest -> (DigestState -> IO a) -> IO a
-mkDigest mdType f =
- bracket ctxCreate ctxDestroy $ \ctx -> do
- when (ctx == nullPtr) (fail "Digest.mkDigest: ctxCreate failed")
- md <- toMDEngine mdType
- when (md == nullPtr) (fail ("Digest.mkDigest: can't access "++show mdType))
- rc <- digestInit ctx md
- when (rc == 0) (fail ("Digest.mkDigest: can't initialize "++show mdType))
- f (DST ctx)
-
--- |Update the internal state with a block of data. This
--- function is just a wrapper for 'update'', which creates
--- an array in memory using 'withArray'.
-
-update :: [Word8] -> Digest ()
-update xs = do
- st <- get
- liftIO $
- withArray xs $ \p ->
- evalStateT (update' (p, length xs)) st
-
--- |Update the internal state with a block of data from
--- memory. This is the /faster/ version of 'update'.
-
-update' :: (Ptr Word8, Int) -> Digest ()
-update' (p,n) = do
- DST ctx <- get
- rc <- liftIO $ digestUpdate ctx p (toEnum (fromEnum n))
- when (rc == 0) (fail "Digest.update failed")
-
--- |Wrap up the computation, add padding, do whatever has to
--- be done, and return the final hash. The length of the
--- result depends on the chosen 'MessageDigest'. Do not call
--- more than once!
-
-final :: Digest [Word8]
-final = do
- DST ctx <- get
- liftIO $
- allocaArray maxMDSize $ \p ->
- allocaArray (sizeOf (undefined :: CUInt)) $ \i -> do
- rc <- digestFinal ctx p i
- when (rc == 0) (fail "Digest.Final failed")
- i' <- peek i
- peekArray (fromEnum i') p
-
--- * Low-level API
-
--- |The EVP context used by OpenSSL is opaque for us; we
--- only access it through a 'Ptr'.
-
-data OpaqueContext = OpaqueContext
-type Context = Ptr OpaqueContext
-
--- |The message digest engines are opaque for us as well.
-
-data OpaqueMDEngine = OpaqueMDEngine
-type MDEngine = Ptr OpaqueMDEngine
-
--- |Maximum size of all message digests supported by
--- OpenSSL. Allocate a buffer of this size for 'digestFinal'
--- if you want to stay generic.
-
-maxMDSize :: Int
-maxMDSize = 36
-
--- |Create an EVP context. May be 'nullPtr'.
-
-foreign import ccall unsafe "EVP_MD_CTX_create" ctxCreate ::
- IO Context
-
--- |Initialize an EVP context.
-
-foreign import ccall unsafe "EVP_MD_CTX_init" ctxInit ::
- Context -> IO ()
-
--- |Destroy an EVP context and free the allocated resources.
-
-foreign import ccall unsafe "EVP_MD_CTX_destroy" ctxDestroy ::
- Context -> IO ()
-
--- |Set the message digest engine for 'digestUpdate' calls.
--- Returns @\/=0@ in case of an error.
-
-foreign import ccall unsafe "EVP_DigestInit" digestInit ::
- Context -> MDEngine -> IO CInt
-
--- |Update the internal context with a block of input.
--- Returns @\/=0@ in case of an error.
-
-foreign import ccall unsafe "EVP_DigestUpdate" digestUpdate ::
- Context -> Ptr Word8 -> CUInt -> IO CInt
-
--- |Wrap up the digest computation and return the final
--- digest. Do not call repeatedly on the same context!
--- Returns @\/=0@ in case of an error. The pointer to the
--- unsigned integer may be 'nullPtr'. If it is not,
--- 'digestFinal' will store the length of the computed
--- digest there.
-
-foreign import ccall unsafe "EVP_DigestFinal" digestFinal ::
- Context -> Ptr Word8 -> Ptr CUInt -> IO CInt
-
--- ** Message Digest Engines
-
-foreign import ccall unsafe "EVP_dss" mdDSS :: IO MDEngine
-foreign import ccall unsafe "EVP_dss1" mdDSS1 :: IO MDEngine
-foreign import ccall unsafe "EVP_md5" mdMD5 :: IO MDEngine
-foreign import ccall unsafe "EVP_md_null" mdNull :: IO MDEngine
-foreign import ccall unsafe "EVP_mdc2" mdMDC2 :: IO MDEngine
-foreign import ccall unsafe "EVP_ripemd160" mdRIPEMD160 :: IO MDEngine
-foreign import ccall unsafe "EVP_sha" mdSHA :: IO MDEngine
-foreign import ccall unsafe "EVP_sha1" mdSHA1 :: IO MDEngine
-foreign import ccall unsafe "EVP_sha224" mdSHA224 :: IO MDEngine
-foreign import ccall unsafe "EVP_sha256" mdSHA256 :: IO MDEngine
-foreign import ccall unsafe "EVP_sha384" mdSHA384 :: IO MDEngine
-foreign import ccall unsafe "EVP_sha512" mdSHA512 :: IO MDEngine
-
--- |Map a 'MessageDigest' type into the the corresponding
--- 'MDEngine'.
-
-toMDEngine :: MessageDigest -> IO MDEngine
-toMDEngine Null = mdNull
-toMDEngine MD5 = mdMD5
-toMDEngine SHA = mdSHA
-toMDEngine SHA1 = mdSHA1
-toMDEngine DSS = mdDSS
-toMDEngine DSS1 = mdDSS1
-toMDEngine RIPEMD160 = mdRIPEMD160
-toMDEngine MDC2 = mdMDC2
-toMDEngine SHA224 = mdSHA224
-toMDEngine SHA256 = mdSHA256
-toMDEngine SHA384 = mdSHA384
-toMDEngine SHA512 = mdSHA512
-
--- * Helper Functions
-
--- |Neat helper to print digests with:
--- @
--- \\ws :: [Word8] -> ws >>= toHex
--- @
-
-toHex :: Word8 -> String
-toHex w = case showHex w "" of
- w1:w2:[] -> w1:w2:[]
- w2:[] -> '0':w2:[]
- _ -> error "showHex returned []"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/Setup.hs new/hopenssl-2.2.1/Setup.hs
--- old/hopenssl-1.7/Setup.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/Setup.hs 2017-07-07 13:30:48.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/hopenssl-1.7/Setup.lhs new/hopenssl-2.2.1/Setup.lhs
--- old/hopenssl-1.7/Setup.lhs 2014-12-17 18:25:00.000000000 +0100
+++ new/hopenssl-2.2.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/hopenssl-1.7/hopenssl.cabal new/hopenssl-2.2.1/hopenssl.cabal
--- old/hopenssl-1.7/hopenssl.cabal 2014-12-17 18:25:00.000000000 +0100
+++ new/hopenssl-2.2.1/hopenssl.cabal 2017-07-07 13:30:48.000000000 +0200
@@ -1,31 +1,68 @@
-Name: hopenssl
-Version: 1.7
-Copyright: (c) 2004-2013 Peter Simons
-License: BSD3
-License-File: LICENSE
-Author: Peter Simons <simons(a)cryp.to>,
- Jesper Louis Andersen <jesper.louis.andersen(a)gmail.com>,
- Markus Rothe <markus(a)unixforces.net>
-Maintainer: Peter Simons <simons(a)cryp.to>
-Homepage: http://github.com/peti/hopenssl
-Category: Foreign, Cryptography
-Synopsis: FFI bindings to OpenSSL's EVP digest interface
-Description: Foreign-function bindings to the OpenSSL library
- <http://www.openssl.org/>. Currently provides
- access to the messages digests MD5, DSS, DSS1,
- RIPEMD160, and several variants of SHA through
- the EVP digest interface.
-Cabal-Version: >= 1.6
-Build-Type: Simple
-Tested-With: GHC >= 6.10.4 && <= 7.8.3
-
-Source-Repository head
- Type: git
- Location: git://github.com/peti/hopenssl.git
-
-Library
- Build-Depends: base >= 3 && < 5, mtl, bytestring
- Extensions: ForeignFunctionInterface
- Extra-Libraries: crypto
- Includes: "openssl/evp.h"
- Exposed-Modules: OpenSSL.Digest, OpenSSL.Digest.ByteString, OpenSSL.Digest.ByteString.Lazy
+name: hopenssl
+version: 2.2.1
+copyright: (c) 2004-2017 Peter Simons
+license: BSD3
+license-file: LICENSE
+author: Peter Simons, Markus Rothe
+maintainer: Peter Simons <simons(a)cryp.to>
+homepage: http://github.com/peti/hopenssl
+category: Foreign, Cryptography
+synopsis: FFI Bindings to OpenSSL's EVP Digest Interface
+description: Foreign-function bindings to the
+ <http://www.openssl.org/ OpenSSL library>. Currently
+ provides access to the messages digests MD5, DSS, DSS1,
+ RIPEMD160, and various SHA variants through the EVP
+ digest interface.
+cabal-version: >= 1.8
+build-type: Custom
+tested-with: GHC > 7.6 && < 8.1
+
+custom-setup
+ setup-depends:
+ base >= 4 && <5,
+ Cabal,
+ cabal-doctest >= 1 && <1.1
+
+source-repository head
+ type: git
+ location: git://github.com/peti/hopenssl.git
+
+library
+ build-depends: base >= 4.6 && < 5, bytestring
+ hs-source-dirs: src
+ other-extensions: CPP, DeriveDataTypeable, EmptyDataDecls, FlexibleInstances,
+ ForeignFunctionInterface, TypeSynonymInstances
+ extra-libraries: crypto
+ includes: "openssl/evp.h"
+ exposed-modules: OpenSSL.Digest
+ OpenSSL.Util
+ OpenSSL.EVP.Digest
+ OpenSSL.EVP.Digest.Algorithm
+ OpenSSL.EVP.Digest.Digest
+ OpenSSL.EVP.Digest.Context
+ OpenSSL.EVP.Digest.Error
+ OpenSSL.EVP.Digest.Initialization
+ build-tools: hsc2hs
+
+test-suite check-low-level-digest-api
+ type: exitcode-stdio-1.0
+ main-is: CheckLowLevelDigestAPI.hs
+ other-modules: OpenSesame
+ hs-source-dirs: test
+ build-depends: base >= 3 && < 5, hopenssl, HUnit
+ ghc-options: -threaded
+
+test-suite check-high-level-digest-api
+ type: exitcode-stdio-1.0
+ main-is: CheckHighLevelDigestAPI.hs
+ other-modules: OpenSesame
+ hs-source-dirs: test
+ build-depends: base >= 3 && < 5, hopenssl, HUnit
+ ghc-options: -threaded
+
+test-suite doctests
+ type: exitcode-stdio-1.0
+ main-is: doctests.hs
+ hs-source-dirs: test
+ build-depends: base, hopenssl, doctest
+ ghc-options: -threaded
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/Digest.hs new/hopenssl-2.2.1/src/OpenSSL/Digest.hs
--- old/hopenssl-1.7/src/OpenSSL/Digest.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/Digest.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,196 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ This module provides a generic high-level API to the message digest
+ algorithms found in OpenSSL's @crypto@ library. There are two functions of
+ particular interest: 'digestByName' and 'digest'. The former can be used to
+ retrieve an 'Algorithm', i.e. an OpenSSL object that implements a particular
+ algorithm. That type can then be used to compute actual message digests with
+ the latter function:
+
+ >>> import Data.ByteString.Char8 ( pack )
+ >>> digest (digestByName "md5") (pack "Hello, world.")
+ "\b\n\239\131\155\149\250\207s\236Y\147u\233-G"
+
+ Neat pretty-printing can be achieved with 'toHex', which converts the binary
+ representation of a message digest into the common hexadecimal one:
+
+ >>> toHex $ digest (digestByName "md5") (pack "Hello, world.")
+ "080aef839b95facf73ec599375e92d47"
+ >>> toHex $ digest (digestByName "sha1") (pack "Hello, world.")
+ "2ae01472317d1935a84797ec1983ae243fc6aa28"
+
+ The precise set of available digest algorithms provided by OpenSSL depends
+ on the version of the library installed into the system, obviously, but it's
+ reasonable to expect the following algorithms to be present: MD5, RIPEMD160,
+ SHA1, SHA224, SHA256, SHA384, and SHA512. If an algorithm is not available,
+ 'digestByName' will throw an 'DigestAlgorithmNotAvailableInOpenSSL'
+ exception. If you don't like exceptions, use the tamer 'digestByName''
+ variant:
+
+ >>> digestByName' "i bet this algorithm won't exist"
+ Nothing
+
+ 'Algorithm' is an instance of 'IsString', so with the proper GHC extensions
+ enabled it's possible to simplify the call to 'digest' even further:
+
+ >>> :set -XOverloadedStrings
+ >>> toHex $ digest "sha256" (pack "The 'Through the Universe' podcast rules.")
+ "73624694a9435095c8fdaad711273a23c02226196c452f817cfd86f965895614"
+
+ Last but not least, 'digest' is actually a class method of 'Digestable',
+ which collects things we can compute digests of. The defaults are
+ conservative, i.e. we support all things that correspond roughly to C's
+ construct of "void pointer plus a length". @digest@ can use with any of the
+ following signatures:
+
+ >>> let shape1 = digest :: Algorithm -> (Ptr (), CSize) -> MessageDigest
+ >>> let shape2 = digest :: Algorithm -> (Ptr Word8, CSize) -> MessageDigest
+ >>> let shape3 = digest :: Algorithm -> (Ptr Word8, CUInt) -> MessageDigest
+ >>> let shape4 = digest :: Algorithm -> (Ptr (), Int) -> MessageDigest
+ >>> let shape5 = digest :: Algorithm -> StrictByteString -> MessageDigest
+ >>> let shape6 = digest :: Algorithm -> LazyByteString -> MessageDigest
+
+ 'StrictByteString' and 'LazyByteString' are also instances of 'IsString' and
+ therefore subject to implicit construction from string literals:
+
+ >>> shape5 "sha256" "hello" == shape6 "sha256" "hello"
+ True
+
+ Note that this code offers no overloaded 'digest' version for 'String',
+ because that function would produce non-deterministic results for Unicode
+ characters. There is an instance for @[Word8]@, though, so strings can be
+ hashed after a proper encoding has been applied. For those who don't care
+ about determinism, there is the following specialized function:
+
+ >>> toHex $ digestString "md5" "no Digestable instance for this sucker"
+ "a74827f849005794565f83fbd68ad189"
+
+ If you don't mind orphaned instances, however, feel free to shoot yourself
+ in the foot:
+
+ >>> :set -XFlexibleInstances
+ >>> instance Digestable String where updateChunk ctx str = withCStringLen str (updateChunk ctx)
+ >>> toHex $ digest "sha256" ("now we can hash strings" :: String)
+ "7f2989f173125810aa917c4ffe0e26ae1b5f7fb852274829c210297a43dfc7f9"
+-}
+
+module OpenSSL.Digest
+ ( -- * Generic digest API
+ MessageDigest, digest, Digestable(..), digestByName, digestByName', Algorithm
+ , -- * Special instances
+ digestString
+ , -- * Helper Types and Functions
+ toHex, StrictByteString, LazyByteString
+ )
+ where
+
+import OpenSSL.EVP.Digest
+import qualified OpenSSL.Util as Util
+
+import Control.Exception
+import qualified Data.ByteString as Strict ( ByteString, packCStringLen, concatMap )
+import Data.ByteString.Char8 as Strict8 ( pack )
+import qualified Data.ByteString.Lazy as Lazy ( ByteString, toChunks )
+import Data.ByteString.Unsafe ( unsafeUseAsCStringLen )
+import Foreign
+import Foreign.C
+import System.IO.Unsafe as IO
+
+-- Generic Class API ----------------------------------------------------------
+
+-- | A message digest is essentially an array of 'Word8' octets.
+
+type MessageDigest = StrictByteString
+
+-- | Compute the given message digest of any 'Digestable' thing, i.e. any type
+-- that can be converted /efficiently/ and /unambiguously/ into a continuous
+-- memory buffer or a sequence of continuous memory buffers. Note that 'String'
+-- does /not/ have that property, because the binary representation chosen for
+-- Unicode characters during the marshaling process is determined by the
+-- system's locale and is therefore non-deterministic.
+
+digest :: Digestable a => Algorithm -> a -> MessageDigest
+digest algo input =
+ IO.unsafePerformIO $
+ bracket newContext freeContext $ \ctx -> do
+ initDigest algo ctx
+ updateChunk ctx input
+ let mdSize = fromIntegral (digestSize algo)
+ allocaArray mdSize $ \md -> do
+ finalizeDigest ctx md
+ Strict.packCStringLen (castPtr md, mdSize)
+
+-- | A class of things that can be part of a digest computations. By default,
+-- we define instances only for various representations of plain memory
+-- buffers, but in theory that class can be extended to contain all kinds of
+-- complex data types.
+
+class Digestable a where
+ updateChunk :: Context -> a -> IO ()
+
+instance Digestable (Ptr a, CSize) where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx = uncurry (updateDigest ctx)
+
+instance Digestable (Ptr a, CUInt) where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx = updateChunk ctx . fmap (fromIntegral :: CUInt -> CSize)
+
+instance Digestable (Ptr a, CInt) where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx = updateChunk ctx . fmap (fromIntegral :: CInt -> CSize)
+
+instance Digestable (Ptr a, Int) where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx = updateChunk ctx . fmap (fromIntegral :: Int -> CSize)
+
+instance Digestable [Word8] where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx buf = withArrayLen buf $ \len ptr -> updateChunk ctx (ptr,len)
+
+instance Digestable StrictByteString where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx str = unsafeUseAsCStringLen str (updateChunk ctx)
+
+instance Digestable LazyByteString where
+ {-# INLINE updateChunk #-}
+ updateChunk ctx = mapM_ (updateChunk ctx) . Lazy.toChunks
+
+-- |We do /not/ define a 'Digestable' instance for 'String', because there is
+-- no one obviously correct way to encode Unicode characters for purposes of
+-- calculating a digest. We have, however, this specialized function which
+-- computes a digest over a @String@ by means of 'withCStrinLen'. This means
+-- that the representation of Unicode characters depends on the process locale
+-- a.k.a. it's non-deterministc!
+--
+-- >>> toHex $ digestString (digestByName "sha1") "Hello, world."
+-- "2ae01472317d1935a84797ec1983ae243fc6aa28"
+
+digestString :: Algorithm -> String -> MessageDigest
+digestString algo str = IO.unsafePerformIO $
+ withCStringLen str (return . digest algo)
+
+-- Helper functions -----------------------------------------------------------
+
+-- | Synonym for the strict 'Strict.ByteString' variant to improve readability.
+
+type StrictByteString = Strict.ByteString
+
+-- | Synonym for the lazy 'Lazy.ByteString' variant to improve readability.
+
+type LazyByteString = Lazy.ByteString
+
+-- | Pretty-print a given message digest from binary into hexadecimal
+-- representation.
+--
+-- >>> toHex (Data.ByteString.pack [0..15])
+-- "000102030405060708090a0b0c0d0e0f"
+
+toHex :: MessageDigest -> StrictByteString
+toHex = Strict.concatMap (pack . Util.toHex)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Algorithm.hsc new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Algorithm.hsc
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Algorithm.hsc 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Algorithm.hsc 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,100 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest.Algorithm where
+
+import OpenSSL.EVP.Digest.Initialization
+import OpenSSL.EVP.Digest.Error ( UnknownAlgorithm(..) )
+
+import Control.Exception
+import Data.Maybe
+import Data.String ( IsString(..) )
+import Foreign
+import Foreign.C
+import System.IO.Unsafe as IO
+
+#include "openssl/opensslv.h"
+#include "openssl/evp.h"
+
+-- | An opaque handle into OpenSSL's collection of message digest algorithms.
+-- Use 'digestByName' to look up any of the available algorithms by name. For
+-- the sake of convenience, 'Algorithm' is an instance of 'IsString' so
+-- that the compiler can transparently map 'String' literals to algorithms via
+-- 'fromString' if the @XOverloadedStrings@ extension is enabled.
+--
+-- >>> fromString "sha256" == digestByName "sha256"
+-- True
+
+newtype Algorithm = Algorithm (Ptr ())
+ deriving (Show, Eq)
+
+instance IsString Algorithm where
+ fromString = digestByName
+
+-- | Look up a digest algorithm engine by name. Algorithms usually offered by
+-- OpenSSL are "md2", "md5", "sha1", "mdc2", "ripemd160", "blake2b512",
+-- "blake2s256", "sha224", "sha256", "sha384", and "sha512", but the exact set
+-- may vary between platforms. Throws 'UnknownAlgorithm' if the requested
+-- algorithm is not known.
+
+digestByName :: String -> Algorithm
+digestByName algo =
+ fromMaybe (throw (UnknownAlgorithm algo)) (digestByName' algo)
+
+-- | Variant of 'digestByName' that signals failure by evaluating to 'Nothing'
+-- rather than failing.
+--
+-- >>> digestByName' "sha256" == Just (digestByName "sha256")
+-- True
+-- >>> digestByName' "Guess what?" :: Maybe Algorithm
+-- Nothing
+
+digestByName' :: String -> Maybe Algorithm
+digestByName' algo = do
+ let Algorithm p = IO.unsafePerformIO $ do
+ initializeEVPDigests
+ withCString algo (return . _digestByName)
+ if p == nullPtr then Nothing else Just (Algorithm p)
+
+-- | Return the size of the digest in bytes that the given algorithm will produce.
+--
+-- >>> digestSize (digestByName "sha256")
+-- 32
+
+digestSize :: Algorithm -> Int
+digestSize = fromIntegral . _digestSize
+
+-- | The largest possible digest size of any of the algorithms supported by
+-- this library will generate. So if you want to store a digest without
+-- bothering to retrieve the appropriate size with 'digestSize' first, allocate
+-- a buffer of that size.
+
+maxDigestSize :: Int
+maxDigestSize = #{const EVP_MAX_MD_SIZE}
+
+-- | Return the block size the the given algorithm operates with.
+--
+-- >>> digestBlockSize (digestByName "sha256")
+-- 64
+
+digestBlockSize :: Algorithm -> Int
+digestBlockSize = fromIntegral . _digestBlockSize
+
+-------------------------------------------------------------------------------
+
+foreign import ccall unsafe "openssl/evp.h EVP_get_digestbyname"
+ _digestByName :: CString -> Algorithm
+
+foreign import ccall unsafe "openssl/evp.h EVP_MD_size"
+ _digestSize :: Algorithm -> CInt
+
+foreign import ccall unsafe "openssl/evp.h EVP_MD_block_size"
+ _digestBlockSize :: Algorithm -> CInt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Context.hs new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Context.hs
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Context.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Context.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,68 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE CPP #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest.Context where
+
+import OpenSSL.EVP.Digest.Error ( throwIfZero )
+
+import Control.Monad
+import Foreign
+import Foreign.C
+
+#include "openssl/opensslv.h"
+
+-- | A context for digest computations. Use 'newContext' and 'freeContext' to
+-- allocate/deallocate this type.
+
+newtype Context = Context (Ptr ())
+ deriving (Show, Eq)
+
+-- | Allocate and initialize an 'Context' for use in a digest computation
+-- on the heap. Release its underlying memory after use with 'freeContext'.
+
+newContext :: IO Context
+newContext = do ctx@(Context p) <- _newContext
+ when (p == nullPtr) (fail "OpenSSL.EVP.Digest.Context.newContext failed")
+ return ctx
+
+foreign import ccall unsafe
+#if OPENSSL_VERSION_NUMBER < 0x1010000f
+ "openssl/evp.h EVP_MD_CTX_create"
+#else
+ "openssl/evp.h EVP_MD_CTX_new"
+#endif
+ _newContext :: IO Context
+
+-- | Release all resources associated with a digest computation.
+
+foreign import ccall unsafe
+#if OPENSSL_VERSION_NUMBER < 0x1010000f
+ "openssl/evp.h EVP_MD_CTX_destroy"
+#else
+ "openssl/evp.h EVP_MD_CTX_free"
+#endif
+ freeContext :: Context -> IO ()
+
+-- | Free all resources associated with this 'Context', but don't destroy the
+-- context itself so that it can be re-used for a new digest computation.
+
+resetDigest :: Context -> IO ()
+resetDigest ctx =
+ throwIfZero "OpenSSL.EVP.Digest.resetDigest" (_resetContext ctx)
+
+foreign import ccall unsafe
+#if OPENSSL_VERSION_NUMBER < 0x1010000f
+ "openssl/evp.h EVP_MD_CTX_cleanup"
+#else
+ "openssl/evp.h EVP_MD_CTX_reset"
+#endif
+ _resetContext :: Context -> IO CInt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Digest.hs new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Digest.hs
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Digest.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Digest.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,67 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE EmptyDataDecls #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest.Digest where
+
+import OpenSSL.EVP.Digest.Algorithm
+import OpenSSL.EVP.Digest.Context
+import OpenSSL.EVP.Digest.Error ( throwIfZero )
+
+import Foreign
+import Foreign.C
+
+-- | Configure the given digest context to use the given message digest
+-- algorithm. Throws an exception to signal failure, i.e. because the system is
+-- out of memory.
+
+initDigest :: Algorithm -> Context -> IO ()
+initDigest algo ctx =
+ throwIfZero "OpenSSL.EVP.Digest.initDigest" (_initDigest ctx algo nullPtr)
+
+-- | Hash the given block of memory and update the digest state accordingly.
+-- This function can be called many times. Then use 'finalizeDigest' to
+-- retrieve the actual hash value.
+
+updateDigest :: Context -> Ptr a -> CSize -> IO ()
+updateDigest ctx ptr len =
+ throwIfZero "OpenSSL.EVP.Digest.updateDigest" (_updateDigest ctx ptr len)
+
+-- | Finalize the digest calculation and return the result in the 'Word8' array
+-- passed as an argument. Naturally, that array is expected to be large enough
+-- to contain the digest. 'digestSize' or 'maxDigestSize' are your friends.
+-- This function does /not/ clean up the digest context; this has to be done
+-- with an explicit call to 'freeContext' (or 'resetContext', if you want to
+-- re-use it). However, it does invalidate the digest state so that no further
+-- calls of 'digestUpdate' can be made without re-initializing the context
+-- first.
+
+finalizeDigest :: Context -> Ptr Word8 -> IO ()
+finalizeDigest ctx ptr =
+ throwIfZero "OpenSSL.EVP.Digest.finalizeDigest" (_finalizeDigest ctx ptr nullPtr)
+
+-------------------------------------------------------------------------------
+
+-- | We don't support choosing a custom engine to implement the given
+-- algorithm. This type is just a place holder, and we always pass 'nullPtr'
+-- whereever it is required to let OpenSSL choose whatever engine it thinks is
+-- best.
+
+data OpaqueEngine
+
+foreign import ccall unsafe "openssl/evp.h EVP_DigestInit_ex"
+ _initDigest :: Context -> Algorithm -> Ptr OpaqueEngine -> IO CInt
+
+foreign import ccall unsafe "openssl/evp.h EVP_DigestUpdate"
+ _updateDigest :: Context -> Ptr a -> CSize -> IO CInt
+
+foreign import ccall unsafe "openssl/evp.h EVP_DigestFinal_ex"
+ _finalizeDigest :: Context -> Ptr Word8 -> Ptr CUInt -> IO CInt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Error.hs new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Error.hs
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Error.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Error.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,33 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest.Error where
+
+import Control.Exception
+import Data.Typeable ( Typeable )
+import Foreign
+import Foreign.C
+
+-- | Most OpenSSL functions return an approximation of @Bool@ to signify
+-- failure. This wrapper makes it easier to move the error handling to the
+-- exception layer where appropriate.
+
+throwIfZero :: String -> IO CInt -> IO ()
+throwIfZero fname =
+ throwIf_ (==0) (const (showString fname " failed with error code 0"))
+
+-- | A custom exception type which is thrown by 'digestByName' in case the
+-- requested digest algorithm is not available in the OpenSSL system library.
+
+newtype UnknownAlgorithm = UnknownAlgorithm String
+ deriving (Show, Typeable)
+
+instance Exception UnknownAlgorithm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Initialization.hs new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Initialization.hs
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest/Initialization.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest/Initialization.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,41 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest.Initialization ( initializeEVPDigests ) where
+
+import Control.Concurrent.MVar
+import Control.Monad
+import System.IO.Unsafe as IO
+
+#include "openssl/opensslv.h"
+
+-- | Initialize the OpenSSL EVP engine and register all known digest types in
+-- the internal data structures. This function must be called before any of the
+-- message digest functions can succeed. This is generally handled
+-- transparently by the Haskell implementation and users do not need to worry
+-- about this.
+
+initializeEVPDigests :: IO ()
+initializeEVPDigests =
+#if OPENSSL_VERSION_NUMBER >= 0x1010000f
+ return ()
+#else
+ modifyMVar_ isDigestEngineInitialized $ \isInitialized ->
+ unless isInitialized _addAllDigests >> return True
+
+{-# NOINLINE isDigestEngineInitialized #-}
+isDigestEngineInitialized :: MVar Bool
+isDigestEngineInitialized = IO.unsafePerformIO $ newMVar False
+
+foreign import ccall unsafe "openssl/evp.h OpenSSL_add_all_digests" _addAllDigests :: IO ()
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/EVP/Digest.hs new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest.hs
--- old/hopenssl-1.7/src/OpenSSL/EVP/Digest.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/EVP/Digest.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,26 @@
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Low-level bindings to OpenSSL's EVP interface. Most users do not need this
+ code. Check out "OpenSSL.Digest" for a more comfortable interface.
+-}
+
+module OpenSSL.EVP.Digest
+ (
+ -- * Digest Algorithms
+ Algorithm
+ , digestByName, digestByName', digestSize, maxDigestSize, digestBlockSize
+ , UnknownAlgorithm
+ , -- * Digest Contexts
+ Context, newContext, freeContext, resetDigest
+ , -- * Digest Computations
+ initDigest, updateDigest, finalizeDigest
+ )
+ where
+
+import OpenSSL.EVP.Digest.Algorithm
+import OpenSSL.EVP.Digest.Context
+import OpenSSL.EVP.Digest.Digest
+import OpenSSL.EVP.Digest.Error
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/src/OpenSSL/Util.hs new/hopenssl-2.2.1/src/OpenSSL/Util.hs
--- old/hopenssl-1.7/src/OpenSSL/Util.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/src/OpenSSL/Util.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,24 @@
+{- |
+ Maintainer: simons(a)cryp.to
+ Stability: provisional
+ Portability: portable
+
+ Random collection of utility functions that may be useful, but which aren't
+ useful enough to be included in the main API modules.
+-}
+
+module OpenSSL.Util where
+
+import Data.Word
+import Numeric
+
+-- |Neat helper to pretty-print digests into the common hexadecimal notation:
+--
+-- >>> [0..15] >>= toHex
+-- "000102030405060708090a0b0c0d0e0f"
+
+toHex :: Word8 -> String
+toHex w = case showHex w "" of
+ [w1,w2] -> [w1, w2]
+ [w2] -> ['0', w2]
+ _ -> "showHex returned []"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/test/CheckHighLevelDigestAPI.hs new/hopenssl-2.2.1/test/CheckHighLevelDigestAPI.hs
--- old/hopenssl-1.7/test/CheckHighLevelDigestAPI.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/test/CheckHighLevelDigestAPI.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,18 @@
+module Main ( main ) where
+
+import OpenSSL.Digest
+import OpenSesame
+
+import Test.HUnit
+
+main :: IO ()
+main = runTestTT (TestList tests) >> return ()
+
+tests :: [Test]
+tests = map (uncurry (mkTest "open sesame")) opensesame
+
+mkTest :: String -> String -> String -> Test
+mkTest input algoName expect = TestCase $
+ case digestByName' algoName of
+ Nothing -> return ()
+ Just algo -> assertEqual algoName expect (show (toHex (digestString algo input)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/test/CheckLowLevelDigestAPI.hs new/hopenssl-2.2.1/test/CheckLowLevelDigestAPI.hs
--- old/hopenssl-1.7/test/CheckLowLevelDigestAPI.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/test/CheckLowLevelDigestAPI.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,34 @@
+module Main ( main ) where
+
+import OpenSesame
+
+import OpenSSL.EVP.Digest
+import OpenSSL.Util
+
+import Control.Exception
+import Foreign
+import Foreign.C.String
+import Test.HUnit
+
+main :: IO ()
+main = runTestTT (TestList tests) >> return ()
+
+tests :: [Test]
+tests = map (uncurry (mkTest "open sesame")) opensesame
+
+mkTest :: String -> String -> String -> Test
+mkTest input algoName expect = TestCase $
+ case digestByName' algoName of
+ Nothing -> return ()
+ Just algo -> digest algo input >>= assertEqual algoName expect
+
+digest :: Algorithm -> String -> IO String
+digest algo input = do
+ let mdSize = digestSize algo
+ md <- bracket newContext freeContext $ \ctx -> do
+ initDigest algo ctx
+ withCStringLen input $ \(ptr,len) -> updateDigest ctx ptr (fromIntegral len)
+ allocaArray mdSize $ \md -> do
+ finalizeDigest ctx md
+ peekArray mdSize md
+ return (md >>= toHex)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/test/OpenSesame.hs new/hopenssl-2.2.1/test/OpenSesame.hs
--- old/hopenssl-1.7/test/OpenSesame.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/test/OpenSesame.hs 2017-07-07 13:30:48.000000000 +0200
@@ -0,0 +1,15 @@
+module OpenSesame where
+
+opensesame :: [(String, String)]
+opensesame = [ ("MD5", "54ef36ec71201fdf9d1423fd26f97f6b")
+ , ("SHA", "2ccefef64c76ac0d42ca1657457977675890c42f")
+ , ("SHA1", "5bcaff7f22ff533ca099b3408ead876c0ebba9a7")
+ , ("DSS", "5bcaff7f22ff533ca099b3408ead876c0ebba9a7")
+ , ("DSS1", "5bcaff7f22ff533ca099b3408ead876c0ebba9a7")
+ , ("RIPEMD160", "bdb2bba6ec93bd566dc1181cadbc92176aa78382")
+ , ("MDC2", "112db2200ce1e9db3c2d132aea4ef7d0")
+ , ("SHA224", "1ee0f9d93a873a67fe781852d716cb3e5904e015aafaa4d1ff1a81bc")
+ , ("SHA256", "41ef4bb0b23661e66301aac36066912dac037827b4ae63a7b1165a5aa93ed4eb")
+ , ("SHA384", "ae2a5d6649035c00efe2bc1b5c97f4d5ff97fa2df06f273afa0231c425e8aff30e4cc1db5e5756e8d2245a1514ad1a2d")
+ , ("SHA512", "8470cdd3bf1ef85d5f092bce5ae5af97ce50820481bf43b2413807fec37e2785b533a65d4c7d71695b141d81ebcd4b6c4def4284e6067f0b9ddc318b1b230205")
+ ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hopenssl-1.7/test/doctests.hs new/hopenssl-2.2.1/test/doctests.hs
--- old/hopenssl-1.7/test/doctests.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hopenssl-2.2.1/test/doctests.hs 2017-07-07 13:30:48.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
1
0
Hello community,
here is the log from the commit of package ghc-hoauth2 for openSUSE:Factory checked in at 2017-08-31 20:47:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hoauth2 (Old)
and /work/SRC/openSUSE:Factory/.ghc-hoauth2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hoauth2"
Thu Aug 31 20:47:36 2017 rev:3 rq:513384 version:1.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hoauth2/ghc-hoauth2.changes 2017-03-24 02:14:52.281650628 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hoauth2.new/ghc-hoauth2.changes 2017-08-31 20:47:36.486029750 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:02 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.3.0.
+
+-------------------------------------------------------------------
Old:
----
hoauth2-0.5.7.tar.gz
New:
----
hoauth2-1.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hoauth2.spec ++++++
--- /var/tmp/diff_new_pack.vDUTlf/_old 2017-08-31 20:47:37.505886598 +0200
+++ /var/tmp/diff_new_pack.vDUTlf/_new 2017-08-31 20:47:37.509886036 +0200
@@ -18,7 +18,7 @@
%global pkg_name hoauth2
Name: ghc-%{pkg_name}
-Version: 0.5.7
+Version: 1.3.0
Release: 0
Summary: Haskell OAuth2 authentication client
License: BSD-3-Clause
@@ -28,17 +28,21 @@
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-aeson-devel
BuildRequires: ghc-bytestring-devel
+BuildRequires: ghc-exceptions-devel
BuildRequires: ghc-http-conduit-devel
BuildRequires: ghc-http-types-devel
+BuildRequires: ghc-microlens-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
BuildRequires: ghc-unordered-containers-devel
+BuildRequires: ghc-uri-bytestring-aeson-devel
+BuildRequires: ghc-uri-bytestring-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Haskell OAuth2 authentication client. Tested with the following services:
-* Google web: <https://developers.google.com/accounts/docs/OAuth2WebServer>
+* Google: <https://developers.google.com/accounts/docs/OAuth2WebServer>
* Github: <http://developer.github.com/v3/oauth/>
@@ -46,6 +50,10 @@
* Fitbit: <http://dev.fitbit.com/docs/oauth2/>
+* StackExchange: <https://api.stackexchange.com/docs/authentication>
+
+* DropBox: <https://www.dropbox.com/developers/reference/oauth-guide>
+
* Weibo: <http://open.weibo.com/wiki/Oauth2>
* Douban: <http://developers.douban.com/wiki/?title=oauth2>.
++++++ hoauth2-0.5.7.tar.gz -> hoauth2-1.3.0.tar.gz ++++++
++++ 1734 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package ghc-hledger-lib for openSUSE:Factory checked in at 2017-08-31 20:47:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hledger-lib (Old)
and /work/SRC/openSUSE:Factory/.ghc-hledger-lib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hledger-lib"
Thu Aug 31 20:47:34 2017 rev:2 rq:513383 version:1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hledger-lib/ghc-hledger-lib.changes 2017-04-18 13:51:20.622441969 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-hledger-lib.new/ghc-hledger-lib.changes 2017-08-31 20:47:34.818263847 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:05 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.2 revision 1.
+
+-------------------------------------------------------------------
Old:
----
hledger-lib-1.1.tar.gz
New:
----
hledger-lib-1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hledger-lib.spec ++++++
--- /var/tmp/diff_new_pack.5UBz5y/_old 2017-08-31 20:47:36.034093187 +0200
+++ /var/tmp/diff_new_pack.5UBz5y/_new 2017-08-31 20:47:36.050090942 +0200
@@ -19,7 +19,7 @@
%global pkg_name hledger-lib
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.1
+Version: 1.2
Release: 0
Summary: Core data types, parsers and functionality for the hledger accounting tools
License: GPL-3.0+
@@ -47,18 +47,15 @@
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-old-time-devel
BuildRequires: ghc-parsec-devel
-BuildRequires: ghc-parsers-devel
BuildRequires: ghc-pretty-show-devel
BuildRequires: ghc-regex-tdfa-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-safe-devel
BuildRequires: ghc-semigroups-devel
BuildRequires: ghc-split-devel
-BuildRequires: ghc-system-filepath-devel
BuildRequires: ghc-text-devel
BuildRequires: ghc-time-devel
BuildRequires: ghc-transformers-devel
-BuildRequires: ghc-trifecta-devel
BuildRequires: ghc-uglymemo-devel
BuildRequires: ghc-utf8-string-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ hledger-lib-1.1.tar.gz -> hledger-lib-1.2.tar.gz ++++++
++++ 3963 lines of diff (skipped)
++++++ hledger-lib.cabal ++++++
--- /var/tmp/diff_new_pack.5UBz5y/_old 2017-08-31 20:47:36.366046592 +0200
+++ /var/tmp/diff_new_pack.5UBz5y/_new 2017-08-31 20:47:36.366046592 +0200
@@ -1,12 +1,10 @@
--- This file has been generated from package.yaml by hpack version 0.15.0.
+-- This file has been generated from package.yaml by hpack version 0.17.0.
--
-- see: https://github.com/sol/hpack
name: hledger-lib
-version: 1.1
+version: 1.2
x-revision: 1
-stability: stable
-category: Finance
synopsis: Core data types, parsers and functionality for the hledger accounting tools
description: This is a reusable library containing hledger's core functionality.
.
@@ -16,15 +14,17 @@
with ledger(1). hledger provides command-line, curses and web
interfaces, and aims to be a reliable, practical tool for daily
use.
-license: GPL
-license-file: LICENSE
-author: Simon Michael <simon(a)joyful.com>
-maintainer: Simon Michael <simon(a)joyful.com>
+category: Finance
+stability: stable
homepage: http://hledger.org
bug-reports: http://bugs.hledger.org
-cabal-version: >= 1.10
-build-type: Simple
+author: Simon Michael <simon(a)joyful.com>
+maintainer: Simon Michael <simon(a)joyful.com>
+license: GPL-3
+license-file: LICENSE
tested-with: GHC==7.10.3, GHC==8.0
+build-type: Simple
+cabal-version: >= 1.10
extra-source-files:
CHANGES
@@ -55,8 +55,7 @@
library
hs-source-dirs:
- other/ledger-parse
- , .
+ ./.
ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans
build-depends:
base >=4.8 && <5
@@ -73,7 +72,7 @@
, directory
, filepath
, hashtables >= 1.2
- , megaparsec >=5.0 && < 5.3
+ , megaparsec >=5.0 && < 5.4
, mtl
, mtl-compat
, old-time
@@ -86,9 +85,6 @@
, uglymemo
, utf8-string >=0.3.5 && <1.1
, HUnit
- , parsers >= 0.5
- , system-filepath
- , trifecta >= 0.91
, parsec
, semigroups
if impl(ghc <7.6)
@@ -111,19 +107,20 @@
Hledger.Data.Dates
Hledger.Data.Journal
Hledger.Data.Ledger
+ Hledger.Data.MarketPrice
Hledger.Data.Period
Hledger.Data.StringFormat
Hledger.Data.Posting
Hledger.Data.RawOptions
Hledger.Data.Timeclock
Hledger.Data.Transaction
+ Hledger.Data.AutoTransaction
Hledger.Data.Types
Hledger.Query
Hledger.Read
Hledger.Read.Common
Hledger.Read.CsvReader
Hledger.Read.JournalReader
- Hledger.Read.LedgerReader
Hledger.Read.TimedotReader
Hledger.Read.TimeclockReader
Hledger.Reports
@@ -144,18 +141,16 @@
Hledger.Utils.Tree
Hledger.Utils.UTF8IOCompat
other-modules:
- Ledger.Parser.Text
Paths_hledger_lib
default-language: Haskell2010
test-suite doctests
type: exitcode-stdio-1.0
+ main-is: doctests.hs
hs-source-dirs:
- other/ledger-parse
- , .
- , tests
+ ./.
+ tests
ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans
- main-is: doctests.hs
build-depends:
base >=4.8 && <5
, base-compat >=0.8.1
@@ -171,7 +166,7 @@
, directory
, filepath
, hashtables >= 1.2
- , megaparsec >=5.0 && < 5.3
+ , megaparsec >=5.0 && < 5.4
, mtl
, mtl-compat
, old-time
@@ -184,25 +179,23 @@
, uglymemo
, utf8-string >=0.3.5 && <1.1
, HUnit
- , parsers >= 0.5
- , system-filepath
- , trifecta >= 0.91
, doctest >=0.8
, Glob >=0.7
if impl(ghc <7.6)
build-depends:
ghc-prim
other-modules:
- Ledger.Parser.Text
Hledger
Hledger.Data
Hledger.Data.Account
Hledger.Data.AccountName
Hledger.Data.Amount
+ Hledger.Data.AutoTransaction
Hledger.Data.Commodity
Hledger.Data.Dates
Hledger.Data.Journal
Hledger.Data.Ledger
+ Hledger.Data.MarketPrice
Hledger.Data.Period
Hledger.Data.Posting
Hledger.Data.RawOptions
@@ -215,7 +208,6 @@
Hledger.Read.Common
Hledger.Read.CsvReader
Hledger.Read.JournalReader
- Hledger.Read.LedgerReader
Hledger.Read.TimeclockReader
Hledger.Read.TimedotReader
Hledger.Reports
@@ -241,9 +233,8 @@
type: exitcode-stdio-1.0
main-is: hunittests.hs
hs-source-dirs:
- other/ledger-parse
- , .
- , tests
+ ./.
+ tests
ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans
build-depends:
base >=4.8 && <5
@@ -260,7 +251,7 @@
, directory
, filepath
, hashtables >= 1.2
- , megaparsec >=5.0 && < 5.3
+ , megaparsec >=5.0 && < 5.4
, mtl
, mtl-compat
, old-time
@@ -273,9 +264,6 @@
, uglymemo
, utf8-string >=0.3.5 && <1.1
, HUnit
- , parsers >= 0.5
- , system-filepath
- , trifecta >= 0.91
, hledger-lib
, parsec
, test-framework
@@ -291,16 +279,17 @@
build-depends:
time >=1.5
other-modules:
- Ledger.Parser.Text
Hledger
Hledger.Data
Hledger.Data.Account
Hledger.Data.AccountName
Hledger.Data.Amount
+ Hledger.Data.AutoTransaction
Hledger.Data.Commodity
Hledger.Data.Dates
Hledger.Data.Journal
Hledger.Data.Ledger
+ Hledger.Data.MarketPrice
Hledger.Data.Period
Hledger.Data.Posting
Hledger.Data.RawOptions
@@ -313,7 +302,6 @@
Hledger.Read.Common
Hledger.Read.CsvReader
Hledger.Read.JournalReader
- Hledger.Read.LedgerReader
Hledger.Read.TimeclockReader
Hledger.Read.TimedotReader
Hledger.Reports
1
0
Hello community,
here is the log from the commit of package ghc-hjsonpointer for openSUSE:Factory checked in at 2017-08-31 20:47:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hjsonpointer (Old)
and /work/SRC/openSUSE:Factory/.ghc-hjsonpointer.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hjsonpointer"
Thu Aug 31 20:47:32 2017 rev:3 rq:513381 version:1.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hjsonpointer/ghc-hjsonpointer.changes 2017-06-04 01:53:48.235273048 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-hjsonpointer.new/ghc-hjsonpointer.changes 2017-08-31 20:47:33.426459208 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:16 UTC 2017 - psimons(a)suse.com
+
+- Update to version 1.2.0 revision 3.
+
+-------------------------------------------------------------------
Old:
----
hjsonpointer-1.1.1.tar.gz
New:
----
hjsonpointer-1.2.0.tar.gz
hjsonpointer.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hjsonpointer.spec ++++++
--- /var/tmp/diff_new_pack.zm8po7/_old 2017-08-31 20:47:34.510307074 +0200
+++ /var/tmp/diff_new_pack.zm8po7/_new 2017-08-31 20:47:34.522305389 +0200
@@ -19,13 +19,14 @@
%global pkg_name hjsonpointer
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.1.1
+Version: 1.2.0
Release: 0
Summary: JSON Pointer library
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/3.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-aeson-devel
@@ -57,6 +58,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ hjsonpointer-1.1.1.tar.gz -> hjsonpointer-1.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hjsonpointer-1.1.1/hjsonpointer.cabal new/hjsonpointer-1.2.0/hjsonpointer.cabal
--- old/hjsonpointer-1.1.1/hjsonpointer.cabal 2017-04-16 23:06:04.000000000 +0200
+++ new/hjsonpointer-1.2.0/hjsonpointer.cabal 2017-06-26 23:10:14.000000000 +0200
@@ -1,5 +1,5 @@
name: hjsonpointer
-version: 1.1.1
+version: 1.2.0
synopsis: JSON Pointer library
homepage: https://github.com/seagreen/hjsonpointer
license: MIT
@@ -22,15 +22,15 @@
exposed-modules:
JSONPointer
build-depends:
- base >= 4.6 && < 4.10
- , aeson >= 0.7 && < 1.3
- , hashable >= 1.2 && < 1.3
- , QuickCheck >= 2.8 && < 2.10
- , unordered-containers >= 0.2 && < 0.3
- , semigroups >= 0.18 && < 1.0
+ base >= 4.6 && < 4.10
+ , aeson >= 0.7
+ , hashable >= 1.2
+ , QuickCheck >= 2.8
+ , unordered-containers >= 0.2
+ , semigroups >= 0.18
-- ^ for GHCs < 8
- , text >= 1.2 && < 1.3
- , vector >= 0.10 && < 1.0
+ , text >= 1.2
+ , vector >= 0.10
test-suite unit
hs-source-dirs:
@@ -48,8 +48,8 @@
aeson
, base
, hjsonpointer
- , hspec >= 2.2 && < 3.0
- , http-types >= 0.8 && < 1.0
+ , hspec >= 2.2
+ , http-types >= 0.8
, QuickCheck
, unordered-containers
, text
++++++ hjsonpointer.cabal ++++++
name: hjsonpointer
version: 1.2.0
cabal-version: >=1.10
build-type: Simple
license: MIT
license-file: MIT-LICENSE.txt
maintainer: ian(a)housejeffries.com
homepage: https://github.com/seagreen/hjsonpointer
synopsis: JSON Pointer library
category: Data
author: Ian Grant Jeffries
extra-source-files:
changelog.md
README.md
x-revision: 3
source-repository head
type: git
location: git://github.com/seagreen/hjsonpointer.git
library
exposed-modules:
JSONPointer
build-depends:
base >=4.6 && <4.10,
aeson >=0.7 && <1.3,
hashable ==1.2.*,
QuickCheck >=2.8 && <2.11,
unordered-containers ==0.2.*,
semigroups ==0.18.*,
text ==1.2.*,
vector >=0.10 && <0.13
default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall
test-suite unit
type: exitcode-stdio-1.0
main-is: Unit.hs
build-depends:
aeson <1.3,
base <4.10,
hjsonpointer <1.3,
hspec >=2.2 && <2.5,
http-types >=0.8 && <0.10,
QuickCheck <2.11,
unordered-containers <0.3,
text <1.3,
vector <0.13
default-language: Haskell2010
default-extensions: OverloadedStrings
hs-source-dirs: test ./
other-modules:
Example
ghc-options: -Wall
1
0
Hello community,
here is the log from the commit of package ghc-hformat for openSUSE:Factory checked in at 2017-08-31 20:47:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hformat (Old)
and /work/SRC/openSUSE:Factory/.ghc-hformat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hformat"
Thu Aug 31 20:47:29 2017 rev:2 rq:513379 version:0.3.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hformat/ghc-hformat.changes 2017-03-08 00:53:33.348046169 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-hformat.new/ghc-hformat.changes 2017-08-31 20:47:30.662847125 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:16 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.3.0.0.
+
+-------------------------------------------------------------------
Old:
----
hformat-0.1.0.1.tar.gz
New:
----
hformat-0.3.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hformat.spec ++++++
--- /var/tmp/diff_new_pack.b1G41g/_old 2017-08-31 20:47:31.466734286 +0200
+++ /var/tmp/diff_new_pack.b1G41g/_new 2017-08-31 20:47:31.474733164 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-hformat
#
-# 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
@@ -19,15 +19,15 @@
%global pkg_name hformat
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.0.1
+Version: 0.3.0.0
Release: 0
Summary: Simple Haskell formatting
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…
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
+BuildRequires: ghc-ansi-terminal-devel
BuildRequires: ghc-base-unicode-symbols-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
@@ -35,7 +35,6 @@
%if %{with tests}
BuildRequires: ghc-hspec-devel
%endif
-# End cabal-rpm deps
%description
String formatting.
@@ -54,20 +53,14 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post devel
%ghc_pkg_recache
++++++ hformat-0.1.0.1.tar.gz -> hformat-0.3.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hformat-0.1.0.1/hformat.cabal new/hformat-0.3.0.0/hformat.cabal
--- old/hformat-0.1.0.1/hformat.cabal 2016-05-24 00:27:53.000000000 +0200
+++ new/hformat-0.3.0.0/hformat.cabal 2017-04-23 23:39:10.000000000 +0200
@@ -1,5 +1,5 @@
name: hformat
-version: 0.1.0.1
+version: 0.3.0.0
synopsis: Simple Haskell formatting
description: String formatting
homepage: http://github.com/mvoidex/hformat
@@ -20,11 +20,14 @@
default-language: Haskell2010
ghc-options: -Wall -fno-warn-tabs
default-extensions: UnicodeSyntax
- exposed-modules:
+ exposed-modules:
Text.Format
+ Text.Format.Flags
+ Text.Format.Colored
build-depends:
base >= 4.8 && < 5,
base-unicode-symbols >= 0.2,
+ ansi-terminal >= 0.6,
text >= 1.2.1
test-suite test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hformat-0.1.0.1/src/Text/Format/Colored.hs new/hformat-0.3.0.0/src/Text/Format/Colored.hs
--- old/hformat-0.1.0.1/src/Text/Format/Colored.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hformat-0.3.0.0/src/Text/Format/Colored.hs 2017-04-23 23:39:10.000000000 +0200
@@ -0,0 +1,62 @@
+module Text.Format.Colored (
+ colored, coloredLine,
+ hColored, hColoredLine
+ ) where
+
+import Prelude.Unicode
+
+import Data.Maybe (mapMaybe)
+import System.Console.ANSI
+import System.IO
+
+import Text.Format
+
+colored ∷ Formatted → IO ()
+colored = hColored stdout
+
+coloredLine ∷ Formatted → IO ()
+coloredLine = hColoredLine stdout
+
+hColored ∷ Handle → Formatted → IO ()
+hColored h (Formatted fs) = mapM_ go fs >> setSGR [] where
+ go (FormattedPart flags v) = setFlags flags >> hPutStr h v >> setSGR []
+ setFlags = setSGR ∘ mapMaybe toSGR
+ toSGR "bold" = Just $ SetConsoleIntensity BoldIntensity
+ toSGR "italic" = Just $ SetItalicized True
+ toSGR "undelined" = Just $ SetUnderlining SingleUnderline
+ toSGR "black" = Just $ SetColor Foreground Vivid Black
+ toSGR "red" = Just $ SetColor Foreground Vivid Red
+ toSGR "green" = Just $ SetColor Foreground Vivid Green
+ toSGR "yellow" = Just $ SetColor Foreground Vivid Yellow
+ toSGR "blue" = Just $ SetColor Foreground Vivid Blue
+ toSGR "magenta" = Just $ SetColor Foreground Vivid Magenta
+ toSGR "cyan" = Just $ SetColor Foreground Vivid Cyan
+ toSGR "white" = Just $ SetColor Foreground Vivid White
+ toSGR "darkgray" = Just $ SetColor Foreground Dull Black
+ toSGR "darkred" = Just $ SetColor Foreground Dull Red
+ toSGR "darkgreen" = Just $ SetColor Foreground Dull Green
+ toSGR "darkyellow" = Just $ SetColor Foreground Dull Yellow
+ toSGR "darkblue" = Just $ SetColor Foreground Dull Blue
+ toSGR "darkmagenta" = Just $ SetColor Foreground Dull Magenta
+ toSGR "darkcyan" = Just $ SetColor Foreground Dull Cyan
+ toSGR "gray" = Just $ SetColor Foreground Dull White
+ toSGR "bg/black" = Just $ SetColor Background Vivid Black
+ toSGR "bg/red" = Just $ SetColor Background Vivid Red
+ toSGR "bg/green" = Just $ SetColor Background Vivid Green
+ toSGR "bg/yellow" = Just $ SetColor Background Vivid Yellow
+ toSGR "bg/blue" = Just $ SetColor Background Vivid Blue
+ toSGR "bg/magenta" = Just $ SetColor Background Vivid Magenta
+ toSGR "bg/cyan" = Just $ SetColor Background Vivid Cyan
+ toSGR "bg/white" = Just $ SetColor Background Vivid White
+ toSGR "bg/darkgray" = Just $ SetColor Background Dull Black
+ toSGR "bg/darkred" = Just $ SetColor Background Dull Red
+ toSGR "bg/darkgreen" = Just $ SetColor Background Dull Green
+ toSGR "bg/darkyellow" = Just $ SetColor Background Dull Yellow
+ toSGR "bg/darkblue" = Just $ SetColor Background Dull Blue
+ toSGR "bg/darkmagenta" = Just $ SetColor Background Dull Magenta
+ toSGR "bg/darkcyan" = Just $ SetColor Background Dull Cyan
+ toSGR "bg/gray" = Just $ SetColor Background Dull White
+ toSGR _ = Nothing
+
+hColoredLine ∷ Handle → Formatted → IO ()
+hColoredLine h f = hColored h f >> hPutStrLn h ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hformat-0.1.0.1/src/Text/Format/Flags.hs new/hformat-0.3.0.0/src/Text/Format/Flags.hs
--- old/hformat-0.1.0.1/src/Text/Format/Flags.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/hformat-0.3.0.0/src/Text/Format/Flags.hs 2017-04-23 23:39:10.000000000 +0200
@@ -0,0 +1,37 @@
+module Text.Format.Flags (
+ FormatFlags,
+ getFlag, hasFlag,
+ baseFlag, preciseFlag
+ ) where
+
+import Prelude.Unicode
+
+import Control.Applicative
+import Data.List (stripPrefix)
+import Data.Maybe (listToMaybe, mapMaybe, fromMaybe)
+import Text.Read
+
+type FormatFlags = [String]
+
+getFlag ∷ (String → Maybe a) → [String] → Maybe a
+getFlag fn = listToMaybe ∘ mapMaybe fn
+
+hasFlag ∷ String → [String] → Bool
+hasFlag = (∈)
+
+getFlagValue ∷ Read a ⇒ String → [String] → Maybe a
+getFlagValue nm fmts = do
+ f ← getFlag (stripPrefix (nm ++ "=")) fmts
+ readMaybe f
+
+baseFlag ∷ (Read a, Integral a) ⇒ [String] → a
+baseFlag fmts
+ | hasFlag "bin" fmts ∨ hasFlag "b" fmts = 2
+ | hasFlag "octal" fmts ∨ hasFlag "o" fmts = 8
+ | hasFlag "hex" fmts ∨ hasFlag "h" fmts = 16
+ | otherwise = fromMaybe 10 (getFlagValue "base" fmts <|> getFlagValue "b" fmts)
+
+preciseFlag ∷ [String] → Maybe Int
+preciseFlag fmts = read <$> listToMaybe (mapMaybe preciseFlag' fmts) where
+ preciseFlag' ('d':d) = Just d
+ preciseFlag' _ = Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hformat-0.1.0.1/src/Text/Format.hs new/hformat-0.3.0.0/src/Text/Format.hs
--- old/hformat-0.1.0.1/src/Text/Format.hs 2016-05-24 00:27:53.000000000 +0200
+++ new/hformat-0.3.0.0/src/Text/Format.hs 2017-04-23 23:39:10.000000000 +0200
@@ -3,9 +3,9 @@
-- | Format string with named args
--
-- >-- Named args
--- >"My name is {name}, I am {age} years old" ~~ ("name" %= "Joe") ~~ ("age" %= 24) ≡ "My name is Joe, I am 24 years old"
+-- >"My name is {name}, I am {age} years old" ~~ ("name" ~% "Joe") ~~ ("age" ~% 24) ≡ "My name is Joe, I am 24 years old"
-- >-- Arg can have default value
--- >"{var:x} = {val:10}" ~~ ("var" %= y) ≡ "y = 10"
+-- >"{var:x} = {val:10}" ~~ ("var" ~% y) ≡ "y = 10"
-- >-- Numeric position can be used
-- >"{0} {1} {0}" ~~ "foo" ~~ "bar" ≡ "foo bar foo"
-- >-- Positions can be omitted
@@ -13,105 +13,164 @@
-- >-- Double braces to escape them
-- >"{} and {{}}" ~~ 10 ≡ "10 and {}"
module Text.Format (
+ FormattedPart(..), Formatted(..), withFlags,
FormatArg(..), Format(..), Formatter(..),
- build,
- FormatBuild(..), Hole(..), fmt, FormatResult(..),
- format, (~~), (%=)
+ prebuild, build,
+ Formattable(..), Hole(..), fmt, FormatResult(..),
+ format, formats, (~~), (~%),
+
+ module Text.Format.Flags
) where
import Prelude.Unicode
import Control.Applicative
-import Data.List (find)
+import Data.Char (intToDigit)
+import Data.List (find, intercalate, nub)
import Data.Maybe (fromMaybe, listToMaybe)
import qualified Data.Text as T
import Data.Text.Lazy (Text, unpack)
-import Data.Text.Lazy.Builder (Builder)
-import qualified Data.Text.Lazy.Builder as B
import Data.String
+import Numeric
import Text.Read (readMaybe)
import Text.ParserCombinators.ReadP
-data FormatArg = FormatNamed String Builder | FormatPos Builder
+import Text.Format.Flags
+
+data FormattedPart = FormattedPart {
+ formattedFlags ∷ FormatFlags,
+ formattedValue ∷ String }
+ deriving (Eq, Ord, Show)
+
+instance IsString FormattedPart where
+ fromString = FormattedPart [] ∘ fromString
+
+newtype Formatted = Formatted { formattedParts ∷ [FormattedPart] } deriving (Eq, Ord, Show)
+
+instance IsString Formatted where
+ fromString = Formatted ∘ return ∘ fromString
+
+instance Monoid Formatted where
+ mempty = Formatted []
+ Formatted l `mappend` Formatted r = Formatted $ l ++ r
+
+withFlags ∷ String → [String] → Formatted
+withFlags v fs = Formatted [FormattedPart fs v]
+
+data FormatArg = FormatNamed String ([String] → Formatted) | FormatPos ([String] → Formatted)
data Format = Format {
formatString ∷ String,
formatArgs ∷ [FormatArg] }
+instance Show Format where
+ show = mconcat ∘ map formattedValue ∘ formattedParts ∘ prebuild
+
instance IsString Format where
fromString str = Format str []
data Formatter = Formatter {
formatter ∷ Either String Int,
- formatterDefault ∷ Maybe String }
+ formatterDefault ∷ Maybe String,
+ formatterFlags ∷ [String] }
instance Show Formatter where
- show (Formatter f def) = "{" ++ either id show f ++ maybe "" (':':) def ++ "}"
+ show (Formatter f def cfgs) = "{" ++ concat parts ++ "}" where
+ parts = [either id show f, fromMaybe "" (fmap ('=':) def), if null cfgs then "" else (':' : intercalate "," cfgs)]
instance Read Formatter where
readsPrec _ = readP_to_S $ between (char '{') (char '}') $ do
- n ← munch1 (∉ ":}")
+ n ← munch (∉ "=:}")
v ← option Nothing $ do
- _ ← char ':'
- v' ← munch1 (≢ '}')
+ _ ← char '='
+ v' ← munch1 (∉ ":}")
return $ Just v'
- return $ Formatter (maybe (Left n) Right $ readMaybe n) v
+ cs ← option [] $ do
+ _ ← char ':'
+ flip sepBy (char ',') (munch1 (∉ ",}"))
+ return $ Formatter (maybe (Left n) Right $ readMaybe n) v cs
-build ∷ Format → Text
-build fstr = B.toLazyText $ mconcat $ build' 0 fstr where
- build' ∷ Int → Format → [Builder]
- build' _ (Format "" _) = []
- build' i (Format ('{':'{':fstr') args) = B.singleton '{' : build' i (Format fstr' args)
- build' i (Format ('}':'}':fstr') args) = B.singleton '}' : build' i (Format fstr' args)
- build' i (Format ('{':'}':fstr') args) = formatArg' (Formatter (Right i) Nothing) args : build' (succ i) (Format fstr' args)
+prebuild ∷ Format → Formatted
+prebuild = buildFormat True
+
+build ∷ Format → Formatted
+build = buildFormat False
+
+buildFormat ∷ Bool → Format → Formatted
+buildFormat pre fstr = build' 0 fstr where
+ build' ∷ Int → Format → Formatted
+ build' _ (Format "" _) = mempty
+ build' i (Format ('{':'{':fstr') args) = fromString "{" `mappend` build' i (Format fstr' args)
+ build' i (Format ('}':'}':fstr') args) = fromString "}" `mappend` build' i (Format fstr' args)
+ build' i (Format ('{':'}':fstr') args) = formatArg' (Formatter (Right i) Nothing []) args `mappend` build' (succ i) (Format fstr' args)
build' i (Format ('{':fstr') args) = case reads ('{':fstr') of
[] → error $ "Can't parse formatter at " ++ fstr'
- (f, fstr''):_ → formatArg' f args : build' i (Format fstr'' args)
- build' i (Format fstr' args) = fromString s : build' i (Format fstr'' args) where
+ (f, fstr''):_ → formatArg' f args `mappend` build' i (Format fstr'' args)
+ build' i (Format fstr' args) = fromString s `mappend` build' i (Format fstr'' args) where
(s, fstr'') = break (∈ "{}") fstr'
- formatArg' ∷ Formatter → [FormatArg] → Builder
- formatArg' (Formatter (Left name) defVal) args = fromMaybe (error $ "Argument " ++ name ++ " not set") (lookArg <|> fmap B.fromString defVal) where
- lookArg = do
- FormatNamed _ fval ← find byName args
- return fval
- byName (FormatNamed n _) = n ≡ name
- byName _ = False
- formatArg' (Formatter (Right i) defVal) args = fromMaybe (error $ "Argument at index " ++ show i ++ " not set") (lookIdx <|> fmap B.fromString defVal) where
- lookIdx = do
- FormatPos fval ← listToMaybe $ drop i $ filter isPos args
- return fval
- isPos (FormatPos _) = True
- isPos _ = False
-
--- | FormatBuild class, by default using @show@
-class FormatBuild a where
- formatBuild ∷ a → Builder
- default formatBuild ∷ Show a ⇒ a → Builder
- formatBuild = B.fromString ∘ show
-
-instance FormatBuild String where
- formatBuild = B.fromString
-
-instance FormatBuild Char where
- formatBuild = B.singleton
-
-instance FormatBuild Int
-instance FormatBuild Integer
-instance FormatBuild Double
-instance FormatBuild Float
-instance FormatBuild Bool
+ formatArg' ∷ Formatter → [FormatArg] → Formatted
+ formatArg' f@(Formatter (Left name) defVal fmtCfgs) args
+ | pre = fromMaybe (formatted f fmtCfgs) lookArg
+ | otherwise = fromMaybe (error $ "Argument " ++ name ++ " not set") (lookArg <|> fmap (flip formatted fmtCfgs) defVal)
+ where
+ lookArg = do
+ FormatNamed _ fval ← find byName args
+ return $ fval fmtCfgs
+ byName (FormatNamed n _) = n ≡ name
+ byName _ = False
+ formatArg' f@(Formatter (Right i) defVal fmtCfgs) args
+ | pre = fromMaybe (formatted f fmtCfgs) lookIdx
+ | otherwise = fromMaybe (error $ "Argument at index " ++ show i ++ " not set") (lookIdx <|> fmap (flip formatted fmtCfgs) defVal)
+ where
+ lookIdx = do
+ FormatPos fval ← listToMaybe $ drop i $ filter isPos args
+ return $ fval fmtCfgs
+ isPos (FormatPos _) = True
+ isPos _ = False
+
+-- | Formattable class, by default using @show@
+class Formattable a where
+ formattable ∷ a → FormatFlags → Formatted
+ default formattable ∷ Show a ⇒ a → FormatFlags → Formatted
+ formattable x _ = fromString ∘ show $ x
+
+formatted ∷ Formattable a ⇒ a → FormatFlags → Formatted
+formatted v fmts = Formatted ∘ map addFmts ∘ formattedParts ∘ formattable v $ fmts where
+ addFmts (FormattedPart flags' v') = FormattedPart (nub $ fmts ++ flags') v'
+
+instance Formattable String where
+ formattable s _ = fromString s
+
+instance Formattable Char where
+ formattable ch _ = fromString [ch]
+
+instance Formattable Int where
+ formattable i fmts = fromString ∘ formatInt (baseFlag fmts) $ i
+instance Formattable Integer where
+ formattable i fmts = fromString ∘ formatInt (baseFlag fmts) $ i
+instance Formattable Double where
+ formattable d fmts = fromString ∘ formatDouble (preciseFlag fmts) $ d
+instance Formattable Float where
+ formattable f fmts = fromString ∘ formatDouble (preciseFlag fmts) $ f
+instance Formattable Bool
+
+instance Formattable Text where
+ formattable s _ = fromString ∘ unpack $ s
-instance FormatBuild Text where
- formatBuild = B.fromLazyText
+instance Formattable T.Text where
+ formattable s _ = fromString ∘ T.unpack $ s
-instance FormatBuild T.Text where
- formatBuild = B.fromText
+instance Formattable Formatter where
+ formattable s _ = fromString ∘ show $ s
class Hole a where
hole ∷ a → [FormatArg]
-instance Hole Builder where
- hole = return ∘ FormatPos
+instance Hole Formatted where
+ hole v = [FormatPos $ const v]
+
+instance {-# OVERLAPPING #-} Hole FormatArg where
+ hole = return
instance {-# OVERLAPPING #-} Hole [FormatArg] where
hole = id
@@ -119,11 +178,11 @@
instance {-# OVERLAPPING #-} Hole [[FormatArg]] where
hole = concat
-instance {-# OVERLAPPABLE #-} FormatBuild a ⇒ Hole a where
- hole = return ∘ FormatPos ∘ formatBuild
+instance {-# OVERLAPPABLE #-} Formattable a ⇒ Hole a where
+ hole v = [FormatPos $ formatted v]
-fmt ∷ Hole a ⇒ a → [FormatArg]
-fmt = hole
+fmt ∷ Formattable a ⇒ a → FormatArg
+fmt v = FormatPos $ formatted v
class FormatResult r where
formatResult ∷ Format → r
@@ -131,21 +190,35 @@
instance FormatResult Format where
formatResult = id
-instance {-# OVERLAPPING #-} FormatResult Text where
- formatResult = build
+instance {-# OVERLAPPING #-} FormatResult String where
+ formatResult = mconcat ∘ map formattedValue ∘ formattedParts ∘ build
instance {-# OVERLAPPABLE #-} IsString s ⇒ FormatResult s where
- formatResult = fromString ∘ unpack ∘ formatResult
+ formatResult = fromString ∘ formatResult
+
+instance {-# OVERLAPPABLE #-} FormatResult Formatted where
+ formatResult = build
format ∷ FormatResult r ⇒ String → r
format = formatResult ∘ fromString
+formats ∷ FormatResult r ⇒ String → [FormatArg] → r
+formats f = formatResult ∘ Format f
+
infixl 7 ~~
(~~) ∷ (Hole a, FormatResult r) ⇒ Format → a → r
fstr ~~ arg = formatResult $ fstr { formatArgs = formatArgs fstr ++ hole arg }
-infixr 8 %=
+infixr 8 ~%
+
+(~%) ∷ Formattable a ⇒ String → a → FormatArg
+name ~% value = FormatNamed name (formatted value)
+
+-- * Util
+
+formatInt ∷ (Show a, Integral a) ⇒ a → a → String
+formatInt base v = showIntAtBase base intToDigit v ""
-(%=) ∷ FormatBuild a ⇒ String → a → [FormatArg]
-name %= value = [FormatNamed name (formatBuild value)]
+formatDouble ∷ RealFloat a ⇒ Maybe Int → a → String
+formatDouble p v = showGFloat p v ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hformat-0.1.0.1/tests/Test.hs new/hformat-0.3.0.0/tests/Test.hs
--- old/hformat-0.1.0.1/tests/Test.hs 2016-05-24 00:27:53.000000000 +0200
+++ new/hformat-0.3.0.0/tests/Test.hs 2017-04-23 23:39:10.000000000 +0200
@@ -1,3 +1,5 @@
+{-# LANGUAGE OverloadedStrings #-}
+
module Main (
main
) where
@@ -11,24 +13,36 @@
main ∷ IO ()
main = hspec $ do
describe "positional arguments" $ do
- it "should format unnamed arguments" $
- (format "{} + {} = {}" ~~ (10 ∷ Int) ~~ (12 ∷ Int) ~~ (22 ∷ Int) ≡ "10 + 12 = 22")
- it "should format positional arguments" $
- (format "{0} + {0} = {1}" ~~ (10 ∷ Int) ~~ (20 ∷ Int) ≡ "10 + 10 = 20")
+ it "should format unnamed arguments"
+ (format "{} + {} = {}" ~~ (10 ∷ Int) ~~ (12 ∷ Int) ~~ (22 ∷ Int) ≡ str "10 + 12 = 22")
+ it "should format positional arguments"
+ (format "{0} + {0} = {1}" ~~ (10 ∷ Int) ~~ (20 ∷ Int) ≡ str "10 + 10 = 20")
describe "named arguments" $
- it "should format named arguments" $
- (format "{x} + {y} = {z}" ~~ "x" %= (1 ∷ Int) ~~ "y" %= (2 ∷ Int) ~~ "z" %= (3 ∷ Int) ≡ "1 + 2 = 3")
+ it "should format named arguments"
+ (format "{x} + {y} = {z}" ~~ "x" ~% (1 ∷ Int) ~~ "y" ~% (2 ∷ Int) ~~ "z" ~% (3 ∷ Int) ≡ str "1 + 2 = 3")
describe "default values" $ do
- it "should accept default values for positional arguments" $
- (format "{0:foo} is {1:bar}" ~~ "blah" ≡ "blah is bar")
- it "should accept default values for named arguments" $
- (format "{x:12} + {y:13}" ~~ "y" %= (10 ∷ Int) ≡ "12 + 10")
- describe "lists" $ do
- it "should accept list of values" $
- (format "{0} + {x:10} = {1}" ~~ [fmt (3 ∷ Int), "x" %= (5 ∷ Int), fmt (8 ∷ Int)] ≡ "3 + 5 = 8")
+ it "should accept default values for positional arguments"
+ (format "{0=foo} is {1=bar}" ~~ str "blah" ≡ str "blah is bar")
+ it "should accept default values for named arguments"
+ (format "{x=12} + {y=13}" ~~ "y" ~% (10 ∷ Int) ≡ str "12 + 10")
+ describe "format options" $ do
+ it "should accept format options"
+ (format "x is {0=foo:octal}" ~~ (10 ∷ Int) ≡ str "x is 12")
+ describe "colorized output" $ do
+ it "should accept colors"
+ (format "x is {0:red}" ~~ (10 ∷ Int) ≡ Formatted [FormattedPart [] "x is ", FormattedPart ["red"] "10"])
+ describe "lists" $
+ it "should accept list of values"
+ (format "{0} + {x:10} = {1}" ~~ [fmt (3 ∷ Int), "x" ~% (5 ∷ Int), fmt (8 ∷ Int)] ≡ str "3 + 5 = 8")
describe "escape" $
- it "should escape curly braces" $
- (format "{} is not {{}}" ~~ "{}" ≡ "{} is not {}")
+ it "should escape curly braces"
+ (format "{} is not {{}}" ~~ str "{}" ≡ str "{} is not {}")
describe "mix" $
- it "should process mixed arguments" $
- (format "{1:foo} and {} are {what:args}" ~~ "what" %= "quux" ~~ (10 ∷ Int) ~~ (20 ∷ Int) ≡ "20 and 10 are quux")
+ it "should process mixed arguments"
+ (format "{1=foo} and {} are {what=args}" ~~ str "what" ~% str "quux" ~~ (10 ∷ Int) ~~ (20 ∷ Int) ≡ str "20 and 10 are quux")
+ describe "prebuild" $
+ it "should show partially formatted" $
+ show (format "{0} ≡ {1}" ~~ str "foo" ∷ Format) ≡ str "foo ≡ {1}"
+
+str ∷ String → String
+str = id
1
0
Hello community,
here is the log from the commit of package ghc-haskell-src-meta for openSUSE:Factory checked in at 2017-08-31 20:47:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-haskell-src-meta (Old)
and /work/SRC/openSUSE:Factory/.ghc-haskell-src-meta.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-haskell-src-meta"
Thu Aug 31 20:47:27 2017 rev:3 rq:513367 version:0.8.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-haskell-src-meta/ghc-haskell-src-meta.changes 2017-06-22 10:37:42.336355403 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-haskell-src-meta.new/ghc-haskell-src-meta.changes 2017-08-31 20:47:28.663127816 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:03:02 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.8.0.1.
+
+-------------------------------------------------------------------
Old:
----
haskell-src-meta-0.7.0.1.tar.gz
haskell-src-meta.cabal
New:
----
haskell-src-meta-0.8.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-haskell-src-meta.spec ++++++
--- /var/tmp/diff_new_pack.u78ZBc/_old 2017-08-31 20:47:29.814966137 +0200
+++ /var/tmp/diff_new_pack.u78ZBc/_new 2017-08-31 20:47:29.818965576 +0200
@@ -17,15 +17,15 @@
%global pkg_name haskell-src-meta
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.7.0.1
+Version: 0.8.0.1
Release: 0
Summary: Parse source to template-haskell abstract syntax
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-haskell-src-exts-devel
BuildRequires: ghc-pretty-devel
@@ -34,6 +34,11 @@
BuildRequires: ghc-template-haskell-devel
BuildRequires: ghc-th-orphans-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%if %{with tests}
+BuildRequires: ghc-HUnit-devel
+BuildRequires: ghc-test-framework-devel
+BuildRequires: ghc-test-framework-hunit-devel
+%endif
%description
The translation from haskell-src-exts abstract syntax to template-haskell
@@ -53,7 +58,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
@@ -61,6 +65,9 @@
%install
%ghc_lib_install
+%check
+%cabal_test
+
%post devel
%ghc_pkg_recache
++++++ haskell-src-meta-0.7.0.1.tar.gz -> haskell-src-meta-0.8.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/ChangeLog new/haskell-src-meta-0.8.0.1/ChangeLog
--- old/haskell-src-meta-0.7.0.1/ChangeLog 2017-01-11 14:37:22.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/ChangeLog 2017-05-31 20:40:48.000000000 +0200
@@ -1,9 +1,23 @@
+0.8.0.1
+- Bump base and template-haskell library to versions shipped with GHC 7.6.
+
+0.8
+- Compatibility with GHC 8.2.
+- Remove deprecated modules.
+
+0.7.0.1
+- Fixed a bug that caused deriving clauses to be ignored on TH 2.11.
+
+0.7.0
+- Compatibility with haskell-src-exts 1.18.
+- Support dropped for GHC < 7.6 and haskell-src-exts < 1.17.
+
0.6.0.14:
- Compatibility with GHC 8.0.
0.6.0.13:
- Compatibility with GHC HEAD, haskell-src-exts 1.17
-- Remove hsBindsToDecs, since it was redundant with toDecs. Technically this
+- Remove hsBindsToDecs, since it was redundant with toDecs. Technically this
requires a minor-version bump, but I doubt anyone was using it.
0.6.0.12:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/haskell-src-meta.cabal new/haskell-src-meta-0.8.0.1/haskell-src-meta.cabal
--- old/haskell-src-meta-0.7.0.1/haskell-src-meta.cabal 2017-01-11 14:37:22.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/haskell-src-meta.cabal 2017-05-31 20:40:48.000000000 +0200
@@ -1,6 +1,6 @@
name: haskell-src-meta
-version: 0.7.0.1
-cabal-version: >= 1.6
+version: 0.8.0.1
+cabal-version: >= 1.8
build-type: Simple
license: BSD3
license-file: LICENSE
@@ -9,8 +9,7 @@
copyright: (c) Matt Morrow
maintainer: Ben Millwood <haskell(a)benmachine.co.uk>
bug-reports: https://github.com/bmillwood/haskell-src-meta/issues
--- That is to say, "builds with". It's not like we have a testsuite.
-tested-with: GHC == 7.6.3, GHC == 7.8.3, GHC == 7.10.3, GHC == 8.0.1
+tested-with: GHC == 7.6.3, GHC == 7.8.3, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1
synopsis: Parse source to template-haskell abstract syntax.
description: The translation from haskell-src-exts abstract syntax
to template-haskell abstract syntax isn't 100% complete yet.
@@ -18,31 +17,37 @@
extra-source-files: ChangeLog README.md examples/*.hs
library
- build-depends: base >= 4.5 && < 4.10,
- haskell-src-exts >= 1.17 && < 1.19,
+ build-depends: base >= 4.6 && < 4.11,
+ haskell-src-exts >= 1.17 && < 1.20,
pretty >= 1.0 && < 1.2,
- syb >= 0.1 && < 0.7,
- template-haskell >= 2.7 && < 2.12,
+ syb >= 0.1 && < 0.8,
+ template-haskell >= 2.8 && < 2.13,
th-orphans >= 0.9.1 && < 0.14
- extensions: CPP,
- RankNTypes,
- StandaloneDeriving,
- TemplateHaskell,
- TypeSynonymInstances,
- FlexibleContexts,
- FlexibleInstances,
- DeriveDataTypeable,
- PatternGuards
+ if impl(ghc < 7.8)
+ build-depends: safe <= 0.3.9
+
hs-source-dirs: src
exposed-modules: Language.Haskell.Meta
Language.Haskell.Meta.Parse
- Language.Haskell.Meta.Parse.Careful
Language.Haskell.Meta.Syntax.Translate
- Language.Haskell.TH.Instances.Lift
Language.Haskell.Meta.Utils
+test-suite unit
+ type: exitcode-stdio-1.0
+ hs-source-dirs: tests
+ main-is: Main.hs
+
+ build-depends:
+ HUnit >= 1.2 && < 1.7,
+ base >= 4.5 && < 4.11,
+ haskell-src-exts >= 1.17 && < 1.20,
+ haskell-src-meta,
+ pretty >= 1.0 && < 1.2,
+ template-haskell >= 2.7 && < 2.13,
+ test-framework >= 0.8 && < 0.9,
+ test-framework-hunit >= 0.3 && < 0.4
+
source-repository head
type: git
location: git://github.com/bmillwood/haskell-src-meta.git
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/src/Language/Haskell/Meta/Parse/Careful.hs new/haskell-src-meta-0.8.0.1/src/Language/Haskell/Meta/Parse/Careful.hs
--- old/haskell-src-meta-0.7.0.1/src/Language/Haskell/Meta/Parse/Careful.hs 2017-01-11 14:37:22.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/src/Language/Haskell/Meta/Parse/Careful.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,60 +0,0 @@
-{- |
-DEPRECATED: haskell-src-meta now requires GHC >= 7.4, so this module is no longer necessary. It will be GHC-warning deprecated soon.
-
-This module provides the tools to handle operator fixities in infix expressions correctly.
-
-The problem we solve is the following. Consider making a quasiquoter which antiquotes to Haskell - for instance, the quasiquoter in <http://hackage.haskell.org/package/hmatrix-static> allows me to write
-
-> myVec :: Vector Double
-> myVec = [vec| 2+3*4, 5-4-3 |]
-
-To correctly parse such expressions, we need to know the fixities and precedences of the operators, so that the above is parsed the same way as
-
-> myVec = [vec| 2+(3*4), (5-4)-3 |]
-
-There is a danger, if we are not careful in parsing, that the above expression instead parses as
-
-> myVec = [vec| (2+3)*4, 5-(4-3) |]
-
-which is a surprising bug, and would only be detected through testing at runtime, rather than at compile time.
-
-When this danger arises, we use this \"careful\" module. It handles \"unresolved infix\" expressions such as @2+3*4@ in two ways, depending on the version of GHC:
-
- * in GHC 7.4 and above (where support for \"unresolved infix\" was added in Template Haskell), resolution of the infix expression is deferred to the compiler, which has all fixities available to it.
-
- * prior to GHC 7.4, any ambiguous infix expression is flagged as a parse error at compile time, and the user is advised to resolve the ambiguity by adding parentheses.
-
--}
-module Language.Haskell.Meta.Parse.Careful(
- parsePat,
- parseExp,
- parseType,
- parseDecs
- ) where
-
-import qualified Language.Haskell.Meta.Parse as Sloppy
-import qualified Language.Haskell.Meta.Syntax.Translate as Translate
-import qualified Language.Haskell.TH as TH
-import qualified Language.Haskell.Exts.Syntax as Hs
-
-doChecked parser translater p =
- case parser p of
- Left s -> Left s
- Right p' | amb p' -> Left "Infix expression could not be resolved as operator fixities are not known. Resolve ambiguity by adding parentheses"
- | otherwise -> Right (translater p')
-
-parsePat :: String -> Either String TH.Pat
-parsePat = doChecked Sloppy.parseHsPat Translate.toPat
-
-parseExp :: String -> Either String TH.Exp
-parseExp = doChecked Sloppy.parseHsExp Translate.toExp
-
-parseType :: String -> Either String TH.Type
-parseType = doChecked Sloppy.parseHsType Translate.toType
-
-parseDecs :: String -> Either String [TH.Dec]
-parseDecs = doChecked Sloppy.parseHsDecls Translate.toDecs
-
--- This was more complicated, but since support for GHC pre-7.4 was dropped,
--- it's no longer necessary
-amb = const False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/src/Language/Haskell/Meta/Syntax/Translate.hs new/haskell-src-meta-0.8.0.1/src/Language/Haskell/Meta/Syntax/Translate.hs
--- old/haskell-src-meta-0.7.0.1/src/Language/Haskell/Meta/Syntax/Translate.hs 2017-01-11 14:37:22.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/src/Language/Haskell/Meta/Syntax/Translate.hs 2017-05-31 20:40:48.000000000 +0200
@@ -42,11 +42,20 @@
class ToTyVars a where toTyVars :: a -> [TyVarBndr]
#if MIN_VERSION_haskell_src_exts(1,18,0)
class ToMaybeKind a where toMaybeKind :: a -> Maybe Kind
+#endif
#if MIN_VERSION_template_haskell(2,11,0)
class ToInjectivityAnn a where toInjectivityAnn :: a -> InjectivityAnn
#endif
+
+#if MIN_VERSION_template_haskell(2,12,0)
+#elif MIN_VERSION_template_haskell(2,11,0)
+type DerivClause = Pred
+#else
+type DerivClause = Name
#endif
+class ToDerivClauses a where toDerivClauses :: a -> [DerivClause]
+
-- for error messages
moduleName = "Language.Haskell.Meta.Syntax.Translate"
@@ -342,7 +351,6 @@
toStrictType :: Hs.Type l -> StrictType
-#if MIN_VERSION_haskell_src_exts(1,18,0)
#if MIN_VERSION_template_haskell(2,11,0)
toStrictType (Hs.TyBang _ s u t) = (Bang (toUnpack u) (toStrict s), toType t)
where
@@ -353,7 +361,7 @@
toUnpack (Hs.NoUnpack _) = SourceNoUnpack
toUnpack (Hs.NoUnpackPragma _) = NoSourceUnpackedness
toStrictType x = (Bang NoSourceUnpackedness NoSourceStrictness, toType x)
-#else
+#elif MIN_VERSION_haskell_src_exts(1,18,0)
-- TyBang l (BangType l) (Unpackedness l) (Type l)
-- data BangType l = BangedTy l | LazyTy l | NoStrictAnnot l
-- data Unpackedness l = Unpack l | NoUnpack l | NoUnpackPragma l
@@ -364,25 +372,12 @@
toStrict _ (Hs.Unpack _) = Unpacked
toStrict _ _ = NotStrict
toStrictType x = (NotStrict, toType x)
-#endif
#else
-#if MIN_VERSION_template_haskell(2,11,0)
-toStrictType (Hs.TyBang _ (Hs.UnpackedTy _) t) = toStrictType2 SourceUnpack t
-toStrictType t = toStrictType2 NoSourceUnpackedness t
-
-toStrictType2 u t(a)(Hs.TyBang _ _ Hs.TyBang{}) =
- nonsense "toStrictType" "double strictness annotation" t
-toStrictType2 u (Hs.TyBang _ (Hs.BangedTy _) t) = (Bang u SourceStrict, toType t)
-toStrictType2 u (Hs.TyBang _ (Hs.UnpackedTy _) t) =
- nonsense "toStrictType" "double unpackedness annotation" t
-toStrictType2 u t = (Bang u NoSourceStrictness, toType t)
-#else /* !MIN_VERSION_template_haskell(2,11,0) */
toStrictType t(a)(Hs.TyBang _ _ Hs.TyBang{}) =
nonsense "toStrictType" "double strictness annotation" t
toStrictType (Hs.TyBang _ (Hs.BangedTy _) t) = (IsStrict, toType t)
toStrictType (Hs.TyBang _ (Hs.UnpackedTy _) t) = (Unpacked, toType t)
toStrictType t = (NotStrict, toType t)
-#endif /* !MIN_VERSION_template_haskell(2,11,0) */
#endif
@@ -402,16 +397,20 @@
toPred a(a)Hs.IParam{} = noTH "toCxt" a
toPred p = todo "toPred" p
-#if MIN_VERSION_template_haskell(2,11,0)
-instance ToCxt (Hs.Deriving l) where
- toCxt (Hs.Deriving _ rule) = toCxt rule
-instance ToCxt [Hs.InstRule l] where
- toCxt = concatMap toCxt
+#if MIN_VERSION_template_haskell(2,12,0)
+instance ToDerivClauses (Hs.Deriving l) where
+ toDerivClauses (Hs.Deriving _ irules) = [DerivClause Nothing (map toType irules)]
+#elif MIN_VERSION_template_haskell(2,11,0)
+instance ToDerivClauses (Hs.Deriving l) where
+ toDerivClauses (Hs.Deriving _ irules) = map toType irules
+#else
+instance ToDerivClauses (Hs.Deriving l) where
+ toDerivClauses (Hs.Deriving _ irules) = concatMap toNames irules
#endif
-instance ToCxt a => ToCxt (Maybe a) where
- toCxt Nothing = []
- toCxt (Just a) = toCxt a
+instance ToDerivClauses a => ToDerivClauses (Maybe a) where
+ toDerivClauses Nothing = []
+ toDerivClauses (Just a) = toDerivClauses a
foldAppT :: Type -> [Type] -> Type
foldAppT t ts = foldl' AppT t ts
@@ -444,13 +443,7 @@
Nothing
#endif
(fmap qualConDeclToCon qcds)
-#if MIN_VERSION_template_haskell(2,11,0)
- -- Convert a Deriving into a list of types, one for each derived class
- -- Assumes that the types do not have any contexts
- (maybe [] (\(Hs.Deriving _ q) -> map toType q) qns)
-#else
- (toNames qns)
-#endif
+ (toDerivClauses qns)
Hs.NewType _ -> let qcd = case qcds of
[x] -> x
_ -> nonsense "toDec" ("newtype with " ++
@@ -462,11 +455,7 @@
Nothing
#endif
(qualConDeclToCon qcd)
-#if MIN_VERSION_template_haskell(2,11,0)
- (maybe [] (\(Hs.Deriving _ q) -> map toType q) qns)
-#else
- (toNames qns)
-#endif
+ (toDerivClauses qns)
-- This type-signature conversion is just wrong.
-- Type variables need to be dealt with. /Jonas
@@ -483,7 +472,6 @@
inline | b = Inline | otherwise = NoInline
#if MIN_VERSION_template_haskell(2,11,0)
-#if MIN_VERSION_haskell_src_exts(1,18,0)
toDec (Hs.TypeFamDecl _ h sig inj)
= OpenTypeFamilyD $ TypeFamilyHead (toName h)
(toTyVars h)
@@ -491,19 +479,7 @@
(fmap toInjectivityAnn inj)
toDec (Hs.DataFamDecl _ _ h sig)
= DataFamilyD (toName h) (toTyVars h) (toMaybeKind sig)
-#else
- toDec (Hs.TypeFamDecl _ h k)
- = OpenTypeFamilyD $ TypeFamilyHead (toName h)
- (toTyVars h)
- (maybe NoSig (KindSig . toKind) k)
- Nothing
- -- TODO: do something with context?
- toDec (Hs.DataFamDecl _ _ h k)
- = DataFamilyD (toName h) (toTyVars h) (fmap toKind k)
-#endif
-
-#else
-#if MIN_VERSION_haskell_src_exts(1,18,0)
+#elif MIN_VERSION_haskell_src_exts(1,18,0)
toDec (Hs.TypeFamDecl _ h sig inj)
= FamilyD TypeFam (toName h) (toTyVars h) (toMaybeKind sig)
toDec (Hs.DataFamDecl _ _ h sig)
@@ -516,7 +492,6 @@
toDec (Hs.DataFamDecl _ _ h k)
= FamilyD DataFam (toName h) (toTyVars h) (fmap toKind k)
#endif
-#endif /* MIN_VERSION_template_haskell(2,11,0) */
toDec a(a)(Hs.FunBind _ mtchs) = hsMatchesToFunD mtchs
toDec (Hs.PatBind _ p rhs bnds) = ValD (toPat p)
@@ -561,12 +536,12 @@
instance ToMaybeKind a => ToMaybeKind (Maybe a) where
toMaybeKind Nothing = Nothing
toMaybeKind (Just a) = toMaybeKind a
+#endif
#if MIN_VERSION_template_haskell(2,11,0)
instance ToInjectivityAnn (Hs.InjectivityInfo l) where
toInjectivityAnn (Hs.InjectivityInfo _ n ns) = InjectivityAnn (toName n) (fmap toName ns)
#endif
-#endif
transAct :: Maybe (Hs.Activation l) -> Phases
transAct Nothing = AllPhases
@@ -610,6 +585,10 @@
Hs.CxSingle _ x' -> [toPred x']
Hs.CxTuple _ xs -> fmap toPred xs
+instance ToCxt a => ToCxt (Maybe a) where
+ toCxt Nothing = []
+ toCxt (Just a) = toCxt a
+
instance ToType (Hs.InstRule l) where
toType (Hs.IRule _ _ _ h) = toType h
toType (Hs.IParen _ irule) = toType irule
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/src/Language/Haskell/TH/Instances/Lift.hs new/haskell-src-meta-0.8.0.1/src/Language/Haskell/TH/Instances/Lift.hs
--- old/haskell-src-meta-0.7.0.1/src/Language/Haskell/TH/Instances/Lift.hs 2017-01-11 14:37:22.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/src/Language/Haskell/TH/Instances/Lift.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-{- |
- Module : Language.Haskell.TH.Instances.Lift
- Copyright : (c) Matt Morrow 2008
- License : BSD3
- Maintainer : Matt Morrow <mjm2002(a)gmail.com>
- Stability : experimental
- Portability : portable (template-haskell)
-
- This module is exported for backwards-compatibility purposes.
- All it does is re-export the instances defined in
- "Language.Haskell.TH.Instances", from the th-orphans package.
--}
-module Language.Haskell.TH.Instances.Lift
- {-# DEPRECATED "Use the th-orphans package instead." #-} () where
-
-import Language.Haskell.TH.Instances
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/haskell-src-meta-0.7.0.1/tests/Main.hs new/haskell-src-meta-0.8.0.1/tests/Main.hs
--- old/haskell-src-meta-0.7.0.1/tests/Main.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/haskell-src-meta-0.8.0.1/tests/Main.hs 2017-05-31 20:40:48.000000000 +0200
@@ -0,0 +1,33 @@
+{-# LANGUAGE CPP #-}
+
+module Main where
+
+import Language.Haskell.Meta.Parse
+#if MIN_VERSION_haskell_src_exts(1,18,0)
+import qualified Language.Haskell.Exts as Exts
+#else
+import qualified Language.Haskell.Exts.Annotated as Exts
+#endif
+import qualified Language.Haskell.TH as TH
+import Test.Framework
+import Test.Framework.Providers.HUnit
+import Test.HUnit (Assertion, (@?=))
+
+main :: IO ()
+main = defaultMain tests
+
+tests :: [Test]
+tests = [derivingClausesTest]
+
+derivingClausesTest :: Test
+derivingClausesTest = testCase "Deriving clauses preserved" $
+ roundTripDecls "data Foo = Foo deriving (A, B, C)"
+
+roundTripDecls :: String -> Assertion
+roundTripDecls s = do
+ declsExts <- liftEither $ parseHsDecls s
+ declsExts' <- liftEither $ parseDecs s >>= parseHsDecls . TH.pprint
+ declsExts' @?= declsExts
+
+liftEither :: Monad m => Either String a -> m a
+liftEither = either fail return
1
0
Hello community,
here is the log from the commit of package ghc-haskell-names for openSUSE:Factory checked in at 2017-08-31 20:47:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-haskell-names (Old)
and /work/SRC/openSUSE:Factory/.ghc-haskell-names.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-haskell-names"
Thu Aug 31 20:47:25 2017 rev:2 rq:513366 version:0.8.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-haskell-names/ghc-haskell-names.changes 2017-04-12 18:06:40.838857563 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-haskell-names.new/ghc-haskell-names.changes 2017-08-31 20:47:26.319456786 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 07:54:15 UTC 2017 - psimons(a)suse.com
+
+- Relax the over-specified version constraint on aeson.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-haskell-names.spec ++++++
--- /var/tmp/diff_new_pack.FYpU01/_old 2017-08-31 20:47:27.143341142 +0200
+++ /var/tmp/diff_new_pack.FYpU01/_new 2017-08-31 20:47:27.143341142 +0200
@@ -63,6 +63,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cabal-tweak-dep-ver aeson '< 1.1' ' < 2'
%build
%ghc_lib_build
1
0
31 Aug '17
Hello community,
here is the log from the commit of package ghc-happstack-authenticate for openSUSE:Factory checked in at 2017-08-31 20:47:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-happstack-authenticate (Old)
and /work/SRC/openSUSE:Factory/.ghc-happstack-authenticate.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-happstack-authenticate"
Thu Aug 31 20:47:22 2017 rev:2 rq:513362 version:2.3.4.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-happstack-authenticate/ghc-happstack-authenticate.changes 2017-05-17 10:52:32.934065153 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-happstack-authenticate.new/ghc-happstack-authenticate.changes 2017-08-31 20:47:24.747677409 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 09:56:13 UTC 2017 - psimons(a)suse.com
+
+- Relax over-specified version constraint on ghc-email-validate.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-happstack-authenticate.spec ++++++
--- /var/tmp/diff_new_pack.lwjqVS/_old 2017-08-31 20:47:25.559563449 +0200
+++ /var/tmp/diff_new_pack.lwjqVS/_new 2017-08-31 20:47:25.571561764 +0200
@@ -84,6 +84,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cabal-tweak-dep-ver email-validate '< 2.3' ' < 2.4'
%build
%ghc_lib_build
1
0
Hello community,
here is the log from the commit of package ghc-gogol-core for openSUSE:Factory checked in at 2017-08-31 20:47:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-gogol-core (Old)
and /work/SRC/openSUSE:Factory/.ghc-gogol-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-gogol-core"
Thu Aug 31 20:47:20 2017 rev:2 rq:513292 version:0.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-gogol-core/ghc-gogol-core.changes 2017-05-10 20:39:47.821608489 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-gogol-core.new/ghc-gogol-core.changes 2017-08-31 20:47:20.928213529 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:38 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.3.0.
+
+-------------------------------------------------------------------
Old:
----
gogol-core-0.1.1.tar.gz
gogol-core.cabal
New:
----
gogol-core-0.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-gogol-core.spec ++++++
--- /var/tmp/diff_new_pack.Y2kiWb/_old 2017-08-31 20:47:21.784093394 +0200
+++ /var/tmp/diff_new_pack.Y2kiWb/_new 2017-08-31 20:47:21.788092832 +0200
@@ -19,14 +19,13 @@
%global pkg_name gogol-core
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.1
+Version: 0.3.0
Release: 0
Summary: Core data types and functionality for Gogol libraries
License: MPL-2.0
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-aeson-devel
BuildRequires: ghc-attoparsec-devel
@@ -42,7 +41,6 @@
BuildRequires: ghc-http-media-devel
BuildRequires: ghc-http-types-devel
BuildRequires: ghc-lens-devel
-BuildRequires: ghc-memory-devel
BuildRequires: ghc-resourcet-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-scientific-devel
@@ -76,7 +74,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ gogol-core-0.1.1.tar.gz -> gogol-core-0.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gogol-core-0.1.1/gogol-core.cabal new/gogol-core-0.3.0/gogol-core.cabal
--- old/gogol-core-0.1.1/gogol-core.cabal 2016-11-03 14:21:01.000000000 +0100
+++ new/gogol-core-0.3.0/gogol-core.cabal 2017-07-12 16:45:05.000000000 +0200
@@ -1,5 +1,5 @@
name: gogol-core
-version: 0.1.1
+version: 0.3.0
synopsis: Core data types and functionality for Gogol libraries.
homepage: https://github.com/brendanhay/gogol
bug-reports: https://github.com/brendanhay/gogol/issues
@@ -36,7 +36,7 @@
ghc-options: -Wall
exposed-modules:
- Network.Google.Data.Base64
+ Network.Google.Data.Bytes
, Network.Google.Data.JSON
, Network.Google.Data.Numeric
, Network.Google.Data.Time
@@ -59,7 +59,6 @@
, http-media >= 0.6
, http-types >= 0.8.6
, lens >= 4.4
- , memory >= 0.8
, resourcet >= 1.1
, scientific >= 0.3
, servant >= 0.4.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gogol-core-0.1.1/src/Network/Google/Data/Base64.hs new/gogol-core-0.3.0/src/Network/Google/Data/Base64.hs
--- old/gogol-core-0.1.1/src/Network/Google/Data/Base64.hs 2016-11-03 14:21:01.000000000 +0100
+++ new/gogol-core-0.3.0/src/Network/Google/Data/Base64.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,53 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
--- |
--- Module : Network.Google.Data.Base64
--- Copyright : (c) 2013-2016 Brendan Hay
--- License : Mozilla Public License, v. 2.0.
--- Maintainer : Brendan Hay <brendan.g.hay(a)gmail.com>
--- Stability : provisional
--- Portability : non-portable (GHC extensions)
---
-module Network.Google.Data.Base64
- ( Base64 (..)
- , _Base64
- ) where
-
-import Control.Lens (Iso', iso)
-import Data.Aeson (FromJSON (..), ToJSON (..))
-import qualified Data.ByteArray.Encoding as BA
-import Data.ByteString (ByteString)
-import qualified Data.ByteString.Char8 as BS8
-import Data.Data (Data, Typeable)
-import Data.Hashable
-import qualified Data.Text.Encoding as Text
-import GHC.Generics (Generic)
-import Network.Google.Data.JSON (parseJSONText, toJSONText)
-import Web.HttpApiData (FromHttpApiData (..),
- ToHttpApiData (..))
-
--- | Base64 encoded binary data.
---
--- Encoding\/decoding is automatically deferred to serialisation and deserialisation
--- respectively.
-newtype Base64 = Base64 { unBase64 :: ByteString }
- deriving (Eq, Read, Ord, Data, Typeable, Generic)
-
-instance Hashable Base64
-
-_Base64 :: Iso' Base64 ByteString
-_Base64 = iso unBase64 Base64
-
-instance ToHttpApiData Base64 where
- toQueryParam = Text.decodeUtf8 . toHeader
- toHeader = BA.convertToBase BA.Base64 . unBase64
-
-instance FromHttpApiData Base64 where
- parseQueryParam = parseHeader . Text.encodeUtf8
- parseHeader = either fail (pure . Base64) . BA.convertFromBase BA.Base64
-
-instance Show Base64 where show = show . BS8.unpack . unBase64
-instance FromJSON Base64 where parseJSON = parseJSONText "Base64"
-instance ToJSON Base64 where toJSON = toJSONText
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gogol-core-0.1.1/src/Network/Google/Data/Bytes.hs new/gogol-core-0.3.0/src/Network/Google/Data/Bytes.hs
--- old/gogol-core-0.1.1/src/Network/Google/Data/Bytes.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/gogol-core-0.3.0/src/Network/Google/Data/Bytes.hs 2017-07-12 16:45:05.000000000 +0200
@@ -0,0 +1,49 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+-- |
+-- Module : Network.Google.Data.Bytes
+-- Copyright : (c) 2013-2016 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay(a)gmail.com>
+-- Stability : provisional
+-- Portability : non-portable (GHC extensions)
+--
+module Network.Google.Data.Bytes
+ ( Bytes (..)
+ , _Bytes
+ ) where
+
+import Control.Lens (Iso', iso)
+import Data.Aeson (FromJSON (..), ToJSON (..))
+import Data.ByteString (ByteString)
+import Data.Data (Data, Typeable)
+import Data.Hashable
+import qualified Data.Text.Encoding as Text
+import GHC.Generics (Generic)
+import Network.Google.Data.JSON (parseJSONText, toJSONText)
+import Web.HttpApiData (FromHttpApiData (..),
+ ToHttpApiData (..))
+-- | Binary data.
+--
+-- This data is passed to/from the serialisation routines as-is, and any
+-- particular encoding or decoding (say, base64) is left up to the caller.
+newtype Bytes = Bytes { unBytes :: ByteString }
+ deriving (Eq, Show, Read, Ord, Data, Typeable, Generic)
+
+instance Hashable Bytes
+
+_Bytes :: Iso' Bytes ByteString
+_Bytes = iso unBytes Bytes
+
+instance ToHttpApiData Bytes where
+ toQueryParam = Text.decodeUtf8 . unBytes
+ toHeader = unBytes
+
+instance FromHttpApiData Bytes where
+ parseQueryParam = pure . Bytes . Text.encodeUtf8
+ parseHeader = pure . Bytes
+
+instance FromJSON Bytes where parseJSON = parseJSONText "Bytes"
+instance ToJSON Bytes where toJSON = toJSONText
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gogol-core-0.1.1/src/Network/Google/Data/Time.hs new/gogol-core-0.3.0/src/Network/Google/Data/Time.hs
--- old/gogol-core-0.1.1/src/Network/Google/Data/Time.hs 2016-11-03 14:21:01.000000000 +0100
+++ new/gogol-core-0.3.0/src/Network/Google/Data/Time.hs 2017-07-12 16:45:05.000000000 +0200
@@ -1,3 +1,4 @@
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -22,6 +23,7 @@
, _Duration
) where
+import Data.Monoid ((<>))
import Control.Lens
import Data.Aeson
import qualified Data.Aeson.Types as Aeson
@@ -86,7 +88,7 @@
instance ToHttpApiData Duration where
toQueryParam =
LText.toStrict
- . Build.toLazyText
+ . (\seconds -> Build.toLazyText seconds <> "s")
. Sci.formatScientificBuilder Sci.Fixed (Just 9)
. unDuration
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gogol-core-0.1.1/src/Network/Google/Prelude.hs new/gogol-core-0.3.0/src/Network/Google/Prelude.hs
--- old/gogol-core-0.1.1/src/Network/Google/Prelude.hs 2016-11-03 14:21:01.000000000 +0100
+++ new/gogol-core-0.3.0/src/Network/Google/Prelude.hs 2017-07-12 16:45:05.000000000 +0200
@@ -27,11 +27,11 @@
import Network.HTTP.Client as Export (RequestBody)
import Numeric.Natural as Export (Natural)
import Prelude as Export hiding (product)
-import Servant.API as Export hiding (Headers, getResponse)
+import Servant.API as Export hiding (Headers, Link, getResponse)
import Servant.Utils.Links as Export hiding (Link)
import Web.HttpApiData as Export (FromHttpApiData (..), ToHttpApiData (..))
-import Network.Google.Data.Base64 as Export
+import Network.Google.Data.Bytes as Export
import Network.Google.Data.JSON as Export
import Network.Google.Data.Numeric as Export
import Network.Google.Data.Time as Export
1
0
Hello community,
here is the log from the commit of package ghc-glazier-pipes for openSUSE:Factory checked in at 2017-08-31 20:47:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-glazier-pipes (Old)
and /work/SRC/openSUSE:Factory/.ghc-glazier-pipes.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-glazier-pipes"
Thu Aug 31 20:47:18 2017 rev:2 rq:513257 version:0.1.5.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-glazier-pipes/ghc-glazier-pipes.changes 2017-05-10 20:47:29.856415309 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-glazier-pipes.new/ghc-glazier-pipes.changes 2017-08-31 20:47:19.512412258 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:15 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.1.5.1.
+
+-------------------------------------------------------------------
Old:
----
glazier-pipes-0.1.4.0.tar.gz
New:
----
glazier-pipes-0.1.5.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-glazier-pipes.spec ++++++
--- /var/tmp/diff_new_pack.xJxXEG/_old 2017-08-31 20:47:20.692246651 +0200
+++ /var/tmp/diff_new_pack.xJxXEG/_new 2017-08-31 20:47:20.696246089 +0200
@@ -18,21 +18,17 @@
%global pkg_name glazier-pipes
Name: ghc-%{pkg_name}
-Version: 0.1.4.0
+Version: 0.1.5.1
Release: 0
-Summary: Converts Glazier widgets into a Pipe
+Summary: A threaded rendering framework using glaizer and pipes
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…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-glazier-devel
-BuildRequires: ghc-lens-devel
BuildRequires: ghc-mmorph-devel
-BuildRequires: ghc-mtl-devel
-BuildRequires: ghc-pipes-concurrency-devel
BuildRequires: ghc-pipes-devel
-BuildRequires: ghc-pipes-misc-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-stm-devel
BuildRequires: ghc-stm-extras-devel
@@ -40,7 +36,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
-Converts Glazier widgets into a Pipe.
+A threaded rendering framework using glaizer and pipes.
%package devel
Summary: Haskell %{pkg_name} library development files
++++++ glazier-pipes-0.1.4.0.tar.gz -> glazier-pipes-0.1.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glazier-pipes-0.1.4.0/LICENSE new/glazier-pipes-0.1.5.1/LICENSE
--- old/glazier-pipes-0.1.4.0/LICENSE 2017-01-14 04:53:33.000000000 +0100
+++ new/glazier-pipes-0.1.5.1/LICENSE 2017-03-06 21:31:29.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright Author name here (c) 2017
+Copyright Louis Pan (c) 2017
All rights reserved.
@@ -13,7 +13,7 @@
disclaimer in the documentation and/or other materials provided
with the distribution.
- * Neither the name of Author name here nor the names of other
+ * Neither the name of Louis Pan nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
@@ -27,4 +27,4 @@
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.
\ No newline at end of file
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glazier-pipes-0.1.4.0/glazier-pipes.cabal new/glazier-pipes-0.1.5.1/glazier-pipes.cabal
--- old/glazier-pipes-0.1.4.0/glazier-pipes.cabal 2017-02-03 22:31:12.000000000 +0100
+++ new/glazier-pipes-0.1.5.1/glazier-pipes.cabal 2017-03-06 21:39:36.000000000 +0100
@@ -1,6 +1,6 @@
name: glazier-pipes
-version: 0.1.4.0
-synopsis: Converts Glazier widgets into a Pipe.
+version: 0.1.5.1
+synopsis: A threaded rendering framework using glaizer and pipes
description: Please see README.md
homepage: https://github.com/louispan/glazier-pipes#readme
license: BSD3
@@ -16,17 +16,11 @@
library
hs-source-dirs: src
- exposed-modules: Glazier.Pipes.Lazy
- Glazier.Pipes.Strict
- Glazier.Pipes.Ui
+ exposed-modules: Glazier.Pipes.Ui
build-depends: base >= 4.7 && < 5
- , glazier >= 0.7 && < 1
- , lens >= 4 && < 5
+ , glazier >= 0.8 && < 1
, mmorph >= 1 && < 2
- , mtl >= 2 && < 3
, pipes >= 4 && < 5
- , pipes-concurrency >= 2 && < 3
- , pipes-misc >= 0.2.3 && < 1
, stm >= 2.4 && < 3
, stm-extras > 0.1 && < 1
, transformers >= 0.4 && < 0.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Lazy.hs new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Lazy.hs
--- old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Lazy.hs 2017-02-02 11:13:33.000000000 +0100
+++ new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Lazy.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,35 +0,0 @@
-{-# LANGUAGE RankNTypes #-}
-
-module Glazier.Pipes.Lazy where
-
-import Control.Concurrent
-import Control.Concurrent.STM
-import Control.Concurrent.STM.TMVar.Extras as STE
-import Control.Lens
-import Control.Monad.Morph
-import Control.Monad.State.Lazy
-import Control.Monad.Trans.Maybe
-import qualified Glazier.Gadget.Lazy as G
-import qualified Pipes as P
-import qualified Pipes.Concurrent as PC
-import qualified Pipes.Lift as PL
-import qualified Pipes.Misc.Concurrent as PM
-import qualified Pipes.Misc.State.Lazy as PM
-
--- | Converts a 'Glazier.Gadget' into a 'Pipes.Pipe'
-gadgetToPipe :: (Monad m, MonadTrans t, MonadState s (t m)) => G.Gadget s m a c -> P.Pipe a c (t m) r
-gadgetToPipe g = forever $ do
- a <- P.await
- s <- get
- -- This is the only line that is different between the Strict and Lazy version
- ~(c, s') <- lift . lift $ view G._Gadget g a s
- put s'
- P.yield c
-{-# INLINABLE gadgetToPipe #-}
-
--- | Convert a 'Pipes.Concurrent.Input' and a 'Glazier.Gadget' into a stateful 'Pipes.Producer' of commands to interpret.
-gadgetToProducer ::
- (MonadState s (t STM), MonadTrans t) =>
- PC.Input a -> G.Gadget s STM a c -> P.Producer' c (t STM) ()
-gadgetToProducer input g = hoist lift (PM.fromInputSTM input) P.>-> gadgetToPipe g
-{-# INLINABLE gadgetToProducer #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Strict.hs new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Strict.hs
--- old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Strict.hs 2017-02-03 22:30:33.000000000 +0100
+++ new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Strict.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,38 +0,0 @@
-{-# LANGUAGE RankNTypes #-}
-
-module Glazier.Pipes.Strict where
-
-import Control.Concurrent
-import Control.Concurrent.STM
-import Control.Concurrent.STM.TMVar.Extras as STE
-import Control.Lens
-import Control.Monad.Morph
-import Control.Monad.State.Strict
-import Control.Monad.Trans.Maybe
-import qualified Glazier.Gadget.Strict as G
-import qualified Pipes as P
-import qualified Pipes.Concurrent as PC
-import qualified Pipes.Lift as PL
-import qualified Pipes.Misc.Concurrent as PM
-import qualified Pipes.Misc.State.Strict as PM
-import qualified Pipes.Prelude as PP
-import qualified Pipes.Internal as PI
-
-
--- | Converts a 'Glazier.Gadget' into a 'Pipes.Pipe'
-gadgetToPipe :: (Monad m, MonadTrans t, MonadState s (t m)) => G.Gadget s m a c -> P.Pipe a c (t m) r
-gadgetToPipe g = forever $ do
- a <- P.await
- s <- get
- -- This is the only line that is different between the Strict and Lazy version
- (c, s') <- lift . lift $ view G._Gadget g a s
- put s'
- P.yield c
-{-# INLINABLE gadgetToPipe #-}
-
--- | Convert a 'Pipes.Concurrent.Input' and a 'Glazier.Gadget' into a stateful 'Pipes.Producer' of commands to interpret.
-gadgetToProducer ::
- (MonadState s (t STM), MonadTrans t) =>
- PC.Input a -> G.Gadget s STM a c -> P.Producer' c (t STM) ()
-gadgetToProducer input g = hoist lift (PM.fromInputSTM input) P.>-> gadgetToPipe g
-{-# INLINABLE gadgetToProducer #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Ui.hs new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Ui.hs
--- old/glazier-pipes-0.1.4.0/src/Glazier/Pipes/Ui.hs 2017-02-03 22:38:47.000000000 +0100
+++ new/glazier-pipes-0.1.5.1/src/Glazier/Pipes/Ui.hs 2017-02-22 22:21:37.000000000 +0100
@@ -15,6 +15,8 @@
-- | This is similar to part of the Elm startApp.
-- This is responsible for running the Glazier Gadget update tick until it quits.
-- This is also responsible for rendering the frame.
+-- This function is only required if you are not using another application framework which
+-- already takes care of rendering and processing user input.
runUi :: (MonadIO io) =>
Int
-> (s -> IO ()) -- render
@@ -57,10 +59,11 @@
lift $ render s)
(const . atomically $ putTMVar finishedRenderThread ())
- -- This is different between the Strict and Lazy version
+ -- application run
s' <- P.runEffect $
appSignal P.>-> PP.mapM
(liftIO . atomically . void . STE.forceSwapTMVar latestState) P.>-> PP.drain
+
-- cleanup
-- allow rendering of the frame one last time
liftIO . atomically $ takeTMVar enableRenderThread
1
0
Hello community,
here is the log from the commit of package ghc-github for openSUSE:Factory checked in at 2017-08-31 20:47:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-github (Old)
and /work/SRC/openSUSE:Factory/.ghc-github.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-github"
Thu Aug 31 20:47:16 2017 rev:3 rq:513253 version:0.16.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-github/ghc-github.changes 2017-05-10 20:49:30.439400258 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-github.new/ghc-github.changes 2017-08-31 20:47:16.704806348 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:55 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.16.0.
+
+-------------------------------------------------------------------
Old:
----
github-0.15.0.tar.gz
github.cabal
New:
----
github-0.16.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-github.spec ++++++
--- /var/tmp/diff_new_pack.109juq/_old 2017-08-31 20:47:17.496695195 +0200
+++ /var/tmp/diff_new_pack.109juq/_new 2017-08-31 20:47:17.500694634 +0200
@@ -19,14 +19,13 @@
%global pkg_name github
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.15.0
+Version: 0.16.0
Release: 0
Summary: Access to the GitHub API, v3
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/3.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-aeson-compat-devel
BuildRequires: ghc-aeson-devel
@@ -92,7 +91,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ github-0.15.0.tar.gz -> github-0.16.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/CHANGELOG.md new/github-0.16.0/CHANGELOG.md
--- old/github-0.15.0/CHANGELOG.md 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/CHANGELOG.md 2017-07-24 17:00:33.000000000 +0200
@@ -1,3 +1,11 @@
+Changes for 0.16.0
+- Add support for `mergeable_state = "blocked".`
+- Fix HTTP status code of merge PR
+- Supports newest versions of dependencies
+- user events
+- release endpoints
+- forkExistingRepo
+
Changes for 0.15.0
- Reworked `PullRequest` (notably `pullRequestsFor`)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/github.cabal new/github-0.16.0/github.cabal
--- old/github-0.15.0/github.cabal 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/github.cabal 2017-07-24 17:00:33.000000000 +0200
@@ -1,5 +1,5 @@
name: github
-version: 0.15.0
+version: 0.16.0
synopsis: Access to the GitHub API, v3.
description:
The GitHub API provides programmatic access to the full
@@ -25,7 +25,7 @@
copyright: Copyright 2012-2013 Mike Burns, Copyright 2013-2015 John Wiegley, Copyright 2016 Oleg Grenrus
category: Network
build-type: Simple
-tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.1
+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.1
cabal-version: >=1.10
extra-source-files:
README.md,
@@ -81,6 +81,7 @@
GitHub.Data.Name
GitHub.Data.Options
GitHub.Data.PullRequests
+ GitHub.Data.Releases
GitHub.Data.Repos
GitHub.Data.Request
GitHub.Data.Search
@@ -111,20 +112,21 @@
GitHub.Endpoints.Repos.Collaborators
GitHub.Endpoints.Repos.Comments
GitHub.Endpoints.Repos.Commits
+ GitHub.Endpoints.Repos.DeployKeys
GitHub.Endpoints.Repos.Forks
+ GitHub.Endpoints.Repos.Releases
GitHub.Endpoints.Repos.Webhooks
- GitHub.Endpoints.Repos.DeployKeys
GitHub.Endpoints.Search
GitHub.Endpoints.Users
GitHub.Endpoints.Users.Followers
GitHub.Request
-- Packages needed in order to build this package.
- build-depends: base >=4.7 && <4.10,
- aeson >=0.7.0.6 && <1.1,
+ build-depends: base >=4.7 && <4.11,
+ aeson >=0.7.0.6 && <1.3,
base-compat >=0.9.1 && <0.10,
base16-bytestring >=0.1.1.6 && <0.2,
- binary >=0.7.1.0 && <0.9,
+ binary >=0.7.1.0 && <0.10,
binary-orphans >=0.1.0.0 && <0.2,
byteable >=0.1.1 && <0.2,
bytestring >=0.10.4.0 && <0.11,
@@ -143,12 +145,12 @@
network-uri >=2.6.0.3 && <2.7,
semigroups >=0.16.2.2 && <0.19,
text >=1.2.0.6 && <1.3,
- time >=1.4 && <1.7,
+ time >=1.4 && <1.9,
transformers >=0.3.0.0 && <0.6,
transformers-compat >=0.4.0.3 && <0.6,
unordered-containers >=0.2 && <0.3,
- vector >=0.10.12.3 && <0.12,
- vector-instances >=3.3.0.1 && <3.4,
+ vector >=0.10.12.3 && <0.13,
+ vector-instances >=3.3.0.1 && <3.5,
tls >=1.3.5
@@ -169,9 +171,11 @@
GitHub.OrganizationsSpec
GitHub.IssuesSpec
GitHub.PullRequestsSpec
+ GitHub.ReleasesSpec
GitHub.ReposSpec
GitHub.SearchSpec
GitHub.UsersSpec
+ GitHub.EventsSpec
main-is: Spec.hs
ghc-options: -Wall
build-depends: base,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/spec/GitHub/EventsSpec.hs new/github-0.16.0/spec/GitHub/EventsSpec.hs
--- old/github-0.15.0/spec/GitHub/EventsSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/github-0.16.0/spec/GitHub/EventsSpec.hs 2017-07-24 17:00:33.000000000 +0200
@@ -0,0 +1,36 @@
+{-# LANGUAGE OverloadedStrings #-}
+module GitHub.EventsSpec where
+
+import Data.Either (isRight)
+import Data.String (fromString)
+import Prelude ()
+import Prelude.Compat
+import System.Environment (lookupEnv)
+import Test.Hspec (Spec, describe, it, shouldSatisfy,
+ pendingWith)
+
+import qualified GitHub
+import GitHub.Data (Auth(..))
+
+fromRightS :: Show a => Either a b -> b
+fromRightS (Left xs) = error $ "Should be Right" ++ show xs
+fromRightS (Right xs) = xs
+
+withAuth :: (Auth -> IO ()) -> IO ()
+withAuth action = do
+ mtoken <- lookupEnv "GITHUB_TOKEN"
+ case mtoken of
+ Nothing -> pendingWith "no GITHUB_TOKEN"
+ Just token -> action (OAuth $ fromString token)
+
+spec :: Spec
+spec = do
+ describe "repositoryEventsR" $ do
+ it "returns non empty list of events" $ shouldSucceed $
+ GitHub.repositoryEventsR "phadej" "github" 1
+ describe "userEventsR" $ do
+ it "returns non empty list of events" $ shouldSucceed $ GitHub.userEventsR "phadej" 1
+ where shouldSucceed f = withAuth $ \auth -> do
+ cs <- GitHub.executeRequest auth $ f
+ cs `shouldSatisfy` isRight
+ length (fromRightS cs) `shouldSatisfy` (> 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/spec/GitHub/ReleasesSpec.hs new/github-0.16.0/spec/GitHub/ReleasesSpec.hs
--- old/github-0.15.0/spec/GitHub/ReleasesSpec.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/github-0.16.0/spec/GitHub/ReleasesSpec.hs 2017-07-24 17:00:33.000000000 +0200
@@ -0,0 +1,54 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell #-}
+module GitHub.ReleasesSpec where
+
+import qualified GitHub
+
+import GitHub.Auth (Auth (..))
+import GitHub.Endpoints.Repos.Releases
+ (Release (..), latestReleaseR, releaseByTagNameR, releaseR, releasesR)
+import GitHub.Request (executeRequest)
+
+import Data.Either.Compat (isRight)
+import Data.Proxy (Proxy (..))
+import Data.String (fromString)
+import System.Environment (lookupEnv)
+import Test.Hspec
+ (Spec, describe, it, pendingWith, shouldBe, shouldSatisfy)
+
+import qualified Data.Vector as V
+
+fromRightS :: Show a => Either a b -> b
+fromRightS (Right b) = b
+fromRightS (Left a) = error $ "Expected a Right and got a Left" ++ show a
+
+withAuth :: (Auth -> IO ()) -> IO ()
+withAuth action = do
+ mtoken <- lookupEnv "GITHUB_TOKEN"
+ case mtoken of
+ Nothing -> pendingWith "no GITHUB_TOKEN"
+ Just token -> action (OAuth $ fromString token)
+
+spec :: Spec
+spec = do
+ let v154Id = GitHub.mkId (Proxy :: Proxy Release) 5254449
+ v154Text = "v1.5.4"
+ describe "releasesR" $ do
+ it "works" $ withAuth $ \auth -> do
+ rs <- executeRequest auth $ releasesR "calleerlandsson" "pick" GitHub.FetchAll
+ rs `shouldSatisfy` isRight
+ V.length (fromRightS rs) `shouldSatisfy` (> 14)
+ describe "releaseR" $ do
+ it "works" $ withAuth $ \auth -> do
+ rs <- executeRequest auth $ releaseR "calleerlandsson" "pick" v154Id
+ rs `shouldSatisfy` isRight
+ releaseTagName (fromRightS rs)`shouldBe` v154Text
+ describe "latestReleaseR" $ do
+ it "works" $ withAuth $ \auth -> do
+ rs <- executeRequest auth $ latestReleaseR "calleerlandsson" "pick"
+ rs `shouldSatisfy` isRight
+ describe "releaseByTagNameR" $ do
+ it "works" $ withAuth $ \auth -> do
+ rs <- executeRequest auth $ releaseByTagNameR "calleerlandsson" "pick" v154Text
+ rs `shouldSatisfy` isRight
+ releaseId (fromRightS rs)`shouldBe` v154Id
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/Options.hs new/github-0.16.0/src/GitHub/Data/Options.hs
--- old/github-0.15.0/src/GitHub/Data/Options.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Data/Options.hs 2017-07-24 17:00:33.000000000 +0200
@@ -95,6 +95,7 @@
| StateClean
| StateDirty
| StateUnstable
+ | StateBlocked
deriving
(Eq, Ord, Show, Enum, Bounded, Generic, Typeable, Data)
@@ -103,13 +104,15 @@
toJSON StateClean = String "clean"
toJSON StateDirty = String "dirty"
toJSON StateUnstable = String "unstable"
+ toJSON StateBlocked = String "blocked"
instance FromJSON MergeableState where
parseJSON (String "unknown") = pure StateUnknown
parseJSON (String "clean") = pure StateClean
parseJSON (String "dirty") = pure StateDirty
parseJSON (String "unstable") = pure StateUnstable
- parseJSON v = typeMismatch "MergeableState" v
+ parseJSON (String "blocked") = pure StateBlocked
+ parseJSON v = typeMismatch "MergeableState" v
instance NFData MergeableState where rnf = genericRnf
instance Binary MergeableState
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/PullRequests.hs new/github-0.16.0/src/GitHub/Data/PullRequests.hs
--- old/github-0.15.0/src/GitHub/Data/PullRequests.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Data/PullRequests.hs 2017-07-24 17:00:33.000000000 +0200
@@ -90,6 +90,9 @@
{ editPullRequestTitle :: !(Maybe Text)
, editPullRequestBody :: !(Maybe Text)
, editPullRequestState :: !(Maybe IssueState)
+ , editPullRequestBase :: !(Maybe Text)
+ , editPullRequestMaintainerCanModify
+ :: !(Maybe Bool)
}
deriving (Show, Generic)
@@ -198,8 +201,15 @@
<*> o .: "id"
instance ToJSON EditPullRequest where
- toJSON (EditPullRequest t b s) =
- object $ filter notNull [ "title" .= t, "body" .= b, "state" .= s ]
+ toJSON (EditPullRequest t b s base mcm) =
+ object $ filter notNull
+ [ "title" .= t
+ , "body" .= b
+ , "state" .= s
+ , "base" .= base
+ , "maintainer_can_modify"
+ .= mcm
+ ]
where
notNull (_, Null) = False
notNull (_, _) = True
@@ -299,7 +309,7 @@
statusMerge :: StatusMap MergeResult
statusMerge =
- [ (204, MergeSuccessful)
+ [ (200, MergeSuccessful)
, (405, MergeCannotPerform)
, (409, MergeConflict)
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/Releases.hs new/github-0.16.0/src/GitHub/Data/Releases.hs
--- old/github-0.15.0/src/GitHub/Data/Releases.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Data/Releases.hs 2017-07-24 17:00:33.000000000 +0200
@@ -0,0 +1,85 @@
+module GitHub.Data.Releases where
+
+import GitHub.Data.Definitions
+import GitHub.Data.Id (Id)
+import GitHub.Data.URL (URL)
+import GitHub.Internal.Prelude
+import Prelude ()
+
+data Release = Release
+ { releaseUrl :: !URL
+ , releaseHtmlUrl :: !URL
+ , releaseAssetsurl :: !URL
+ , releaseUploadUrl :: !URL
+ , releaseTarballUrl :: !URL
+ , releaseZipballUrl :: !URL
+ , releaseId :: !(Id Release)
+ , releaseTagName :: !Text
+ , releaseTargetCommitish :: !Text
+ , releaseName :: !Text
+ , releaseBody :: !Text
+ , releaseDraft :: !Bool
+ , releasePrerelease :: !Bool
+ , releaseCreatedAt :: !UTCTime
+ , releasePublishedAt :: !(Maybe UTCTime)
+ , releaseAuthor :: !SimpleUser
+ , releaseAssets :: !(Vector ReleaseAsset)
+ }
+ deriving (Show, Data, Typeable, Eq, Ord, Generic)
+
+instance FromJSON Release where
+ parseJSON = withObject "Event" $ \o -> Release
+ <$> o .: "url"
+ <*> o .: "html_url"
+ <*> o .: "assets_url"
+ <*> o .: "upload_url"
+ <*> o .: "tarball_url"
+ <*> o .: "zipball_url"
+ <*> o .: "id"
+ <*> o .: "tag_name"
+ <*> o .: "target_commitish"
+ <*> o .: "name"
+ <*> o .: "body"
+ <*> o .: "draft"
+ <*> o .: "prerelease"
+ <*> o .: "created_at"
+ <*> o .:? "published_at"
+ <*> o .: "author"
+ <*> o .: "assets"
+
+instance NFData Release where rnf = genericRnf
+instance Binary Release
+
+data ReleaseAsset = ReleaseAsset
+ { releaseAssetUrl :: !URL
+ , releaseAssetBrowserDownloadUrl :: !Text
+ , releaseAssetId :: !(Id ReleaseAsset)
+ , releaseAssetName :: !Text
+ , releaseAssetLabel :: !(Maybe Text)
+ , releaseAssetState :: !Text
+ , releaseAssetContentType :: !Text
+ , releaseAssetSize :: !Int
+ , releaseAssetDownloadCount :: !Int
+ , releaseAssetCreatedAt :: !UTCTime
+ , releaseAssetUpdatedAt :: !UTCTime
+ , releaseAssetUploader :: !SimpleUser
+ }
+ deriving (Show, Data, Typeable, Eq, Ord, Generic)
+
+instance FromJSON ReleaseAsset where
+ parseJSON = withObject "Event" $ \o -> ReleaseAsset
+ <$> o .: "url"
+ <*> o .: "browser_download_url"
+ <*> o .: "id"
+ <*> o .: "name"
+ <*> o .:? "label"
+ <*> o .: "state"
+ <*> o .: "content_type"
+ <*> o .: "size"
+ <*> o .: "download_count"
+ <*> o .: "created_at"
+ <*> o .: "updated_at"
+ <*> o .: "uploader"
+
+instance NFData ReleaseAsset where rnf = genericRnf
+instance Binary ReleaseAsset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data.hs new/github-0.16.0/src/GitHub/Data.hs
--- old/github-0.15.0/src/GitHub/Data.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Data.hs 2017-07-24 17:00:33.000000000 +0200
@@ -43,6 +43,7 @@
module GitHub.Data.Milestone,
module GitHub.Data.Options,
module GitHub.Data.PullRequests,
+ module GitHub.Data.Releases,
module GitHub.Data.Repos,
module GitHub.Data.Request,
module GitHub.Data.Search,
@@ -69,6 +70,7 @@
import GitHub.Data.Name
import GitHub.Data.Options
import GitHub.Data.PullRequests
+import GitHub.Data.Releases
import GitHub.Data.Repos
import GitHub.Data.Request
import GitHub.Data.Search
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Activity/Events.hs new/github-0.16.0/src/GitHub/Endpoints/Activity/Events.hs
--- old/github-0.15.0/src/GitHub/Endpoints/Activity/Events.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Endpoints/Activity/Events.hs 2017-07-24 17:00:33.000000000 +0200
@@ -7,6 +7,7 @@
module GitHub.Endpoints.Activity.Events (
-- * Events
repositoryEventsR,
+ userEventsR,
module GitHub.Data,
) where
@@ -19,3 +20,9 @@
repositoryEventsR :: Name Owner -> Name Repo -> FetchCount -> Request 'RO (Vector Event)
repositoryEventsR user repo =
pagedQuery ["repos", toPathPart user, toPathPart repo, "events"] []
+
+-- | List user public events.
+-- See <https://developer.github.com/v3/activity/events/#list-public-events-perform…>
+userEventsR :: Name User -> FetchCount -> Request 'RO (Vector Event)
+userEventsR user =
+ pagedQuery ["users", toPathPart user, "events", "public"] []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/PullRequests.hs new/github-0.16.0/src/GitHub/Endpoints/PullRequests.hs
--- old/github-0.15.0/src/GitHub/Endpoints/PullRequests.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Endpoints/PullRequests.hs 2017-07-24 17:00:33.000000000 +0200
@@ -7,6 +7,7 @@
-- <http://developer.github.com/v3/pulls/>.
module GitHub.Endpoints.PullRequests (
pullRequestsFor,
+ pullRequestsFor',
pullRequestsForR,
pullRequest',
pullRequest,
@@ -40,6 +41,13 @@
pullRequestsFor user repo =
executeRequest' $ pullRequestsForR user repo mempty FetchAll
+-- | All open pull requests for the repo, by owner and repo name.
+--
+-- > pullRequestsFor "rails" "rails"
+pullRequestsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest))
+pullRequestsFor' auth user repo =
+ executeRequestMaybe auth $ pullRequestsForR user repo mempty FetchAll
+
-- | List pull requests.
-- See <https://developer.github.com/v3/pulls/#list-pull-requests>
pullRequestsForR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Repos/Releases.hs new/github-0.16.0/src/GitHub/Endpoints/Repos/Releases.hs
--- old/github-0.15.0/src/GitHub/Endpoints/Repos/Releases.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Endpoints/Repos/Releases.hs 2017-07-24 17:00:33.000000000 +0200
@@ -0,0 +1,110 @@
+-- The Release API, as described at
+-- <https://developer.github.com/v3/repos/releases/>.
+module GitHub.Endpoints.Repos.Releases (
+ releases,
+ releases',
+ releasesR,
+ release,
+ release',
+ releaseR,
+ latestRelease,
+ latestRelease',
+ latestReleaseR,
+ releaseByTagName,
+ releaseByTagName',
+ releaseByTagNameR,
+ module GitHub.Data,
+ ) where
+
+import GitHub.Data
+import GitHub.Internal.Prelude
+import GitHub.Request
+import Prelude ()
+
+-- | All releases for the given repo.
+--
+-- > releases "calleerlandsson" "pick"
+releases :: Name Owner -> Name Repo -> IO (Either Error (Vector Release))
+releases = releases' Nothing
+
+-- | All releases for the given repo with authentication.
+--
+-- > releases' (Just (User (user, password))) "calleerlandsson" "pick"
+releases' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Release))
+releases' auth user repo =
+ executeRequestMaybe auth $ releasesR user repo FetchAll
+
+-- | List releases for a repository.
+-- See <https://developer.github.com/v3/repos/releases/#list-releases-for-a-reposit…>
+releasesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Release)
+releasesR user repo =
+ pagedQuery ["repos", toPathPart user, toPathPart repo, "releases"] []
+
+-- | Query a single release.
+--
+-- > release "calleerlandsson" "pick"
+release :: Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)
+release = release' Nothing
+
+-- | Query a single release with authentication.
+--
+-- > release' (Just (User (user, password))) "calleerlandsson" "pick"
+release' :: Maybe Auth -> Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)
+release' auth user repo reqReleaseId =
+ executeRequestMaybe auth $ releaseR user repo reqReleaseId
+
+-- | Get a single release.
+-- See <https://developer.github.com/v3/repos/releases/#get-a-single-release>
+releaseR :: Name Owner -> Name Repo -> Id Release -> Request k Release
+releaseR user repo reqReleaseId =
+ query ["repos", toPathPart user, toPathPart repo, "releases", toPathPart reqReleaseId ] []
+
+-- | Query latest release.
+--
+-- > latestRelease "calleerlandsson" "pick"
+latestRelease :: Name Owner -> Name Repo -> IO (Either Error Release)
+latestRelease = latestRelease' Nothing
+
+-- | Query latest release with authentication.
+--
+-- > latestRelease' (Just (User (user, password))) "calleerlandsson" "pick"
+latestRelease' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Release)
+latestRelease' auth user repo =
+ executeRequestMaybe auth $ latestReleaseR user repo
+
+-- | Get the latest release.
+-- See <https://developer.github.com/v3/repos/releases/#get-the-latest-release>
+latestReleaseR :: Name Owner -> Name Repo -> Request k Release
+latestReleaseR user repo =
+ query ["repos", toPathPart user, toPathPart repo, "releases", "latest" ] []
+
+-- | Query release by tag name.
+--
+-- > releaseByTagName "calleerlandsson" "pick"
+releaseByTagName :: Name Owner -> Name Repo -> Text -> IO (Either Error Release)
+releaseByTagName = releaseByTagName' Nothing
+
+-- | Query release by tag name with authentication.
+--
+-- > releaseByTagName' (Just (User (user, password))) "calleerlandsson" "pick"
+releaseByTagName' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> IO (Either Error Release)
+releaseByTagName' auth user repo reqTagName =
+ executeRequestMaybe auth $ releaseByTagNameR user repo reqTagName
+
+-- | Get a release by tag name
+-- See <https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name>
+releaseByTagNameR :: Name Owner -> Name Repo -> Text -> Request k Release
+releaseByTagNameR user repo reqTagName =
+ query ["repos", toPathPart user, toPathPart repo, "releases", "tags" , reqTagName ] []
+
+{-
+-- TODO: implement the following:
+ https://developer.github.com/v3/repos/releases/#create-a-release
+ https://developer.github.com/v3/repos/releases/#edit-a-release
+ https://developer.github.com/v3/repos/releases/#delete-a-release
+ https://developer.github.com/v3/repos/releases/#list-assets-for-a-release
+ https://developer.github.com/v3/repos/releases/#upload-a-release-asset
+ https://developer.github.com/v3/repos/releases/#get-a-single-release-asset
+ https://developer.github.com/v3/repos/releases/#edit-a-release-asset
+ https://developer.github.com/v3/repos/releases/#delete-a-release-asset
+-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Repos.hs new/github-0.16.0/src/GitHub/Endpoints/Repos.hs
--- old/github-0.15.0/src/GitHub/Endpoints/Repos.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub/Endpoints/Repos.hs 2017-07-24 17:00:33.000000000 +0200
@@ -42,6 +42,7 @@
createRepoR,
createOrganizationRepo',
createOrganizationRepoR,
+ forkExistingRepoR,
-- ** Edit
editRepo,
@@ -172,6 +173,13 @@
createRepoR nrepo =
command Post ["user", "repos"] (encode nrepo)
+-- | Fork an existing repository.
+-- See <https://developer.github.com/v3/repos/forks/#create-a-fork>
+-- TODO: The third paramater (an optional Organisation) is not used yet.
+forkExistingRepoR :: Name Owner -> Name Repo -> Maybe (Name Owner) -> Request 'RW Repo
+forkExistingRepoR owner repo _morg =
+ command Post ["repos", toPathPart owner, toPathPart repo, "forks" ] mempty
+
-- | Create a new repository for an organization.
--
-- > createOrganizationRepo (BasicAuth (user, password)) "thoughtbot" (newRepo "some_repo") {newRepoHasIssues = Just False}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub.hs new/github-0.16.0/src/GitHub.hs
--- old/github-0.15.0/src/GitHub.hs 2016-11-04 19:15:15.000000000 +0100
+++ new/github-0.16.0/src/GitHub.hs 2017-07-24 17:00:33.000000000 +0200
@@ -18,7 +18,7 @@
-- ** Events
-- | See https://developer.github.com/v3/activity/events/#events
repositoryEventsR,
-
+ userEventsR,
-- ** Starring
-- | See <https://developer.github.com/v3/activity/starring/>
--
@@ -270,6 +270,12 @@
pingRepoWebhookR,
deleteRepoWebhookR,
+ -- * Releases
+ releasesR,
+ releaseR,
+ latestReleaseR,
+ releaseByTagNameR,
+
-- * Search
-- | See <https://developer.github.com/v3/search/>
--
@@ -334,6 +340,7 @@
import GitHub.Endpoints.Repos.Comments
import GitHub.Endpoints.Repos.Commits
import GitHub.Endpoints.Repos.Forks
+import GitHub.Endpoints.Repos.Releases
import GitHub.Endpoints.Repos.Webhooks
import GitHub.Endpoints.Search
import GitHub.Endpoints.Users
1
0
Hello community,
here is the log from the commit of package ghc-ghc-events for openSUSE:Factory checked in at 2017-08-31 20:47:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-ghc-events (Old)
and /work/SRC/openSUSE:Factory/.ghc-ghc-events.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-ghc-events"
Thu Aug 31 20:47:14 2017 rev:2 rq:513248 version:0.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-ghc-events/ghc-ghc-events.changes 2017-03-24 01:56:31.385478822 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-ghc-events.new/ghc-ghc-events.changes 2017-08-31 20:47:15.560966903 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:07:49 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.6.0.
+
+-------------------------------------------------------------------
Old:
----
1.cabal
ghc-events-0.4.4.0.tar.gz
New:
----
ghc-events-0.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-ghc-events.spec ++++++
--- /var/tmp/diff_new_pack.cpa6Mx/_old 2017-08-31 20:47:16.360854627 +0200
+++ /var/tmp/diff_new_pack.cpa6Mx/_new 2017-08-31 20:47:16.364854066 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-ghc-events
#
-# 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
@@ -19,20 +19,19 @@
%global pkg_name ghc-events
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.4.4.0
+Version: 0.6.0
Release: 0
Summary: Library and tool for parsing .eventlog files from GHC
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: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-array-devel
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
-BuildRequires: ghc-mtl-devel
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -53,13 +52,13 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
%install
%ghc_lib_install
+%ghc_fix_rpath %{pkg_name}-%{version}
%check
%cabal_test
@@ -77,5 +76,6 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
+%doc CHANGELOG.md README.md
%changelog
++++++ ghc-events-0.4.4.0.tar.gz -> ghc-events-0.6.0.tar.gz ++++++
++++ 15821 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package ghc-generic-xmlpickler for openSUSE:Factory checked in at 2017-08-31 20:47:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-generic-xmlpickler (Old)
and /work/SRC/openSUSE:Factory/.ghc-generic-xmlpickler.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-generic-xmlpickler"
Thu Aug 31 20:47:10 2017 rev:2 rq:513246 version:0.1.0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-generic-xmlpickler/ghc-generic-xmlpickler.changes 2017-03-08 01:02:39.590748229 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-generic-xmlpickler.new/ghc-generic-xmlpickler.changes 2017-08-31 20:47:12.349417693 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 03:01:26 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.1.0.5 revision 2.
+
+-------------------------------------------------------------------
Old:
----
1.cabal
New:
----
generic-xmlpickler.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-generic-xmlpickler.spec ++++++
--- /var/tmp/diff_new_pack.fVO1iY/_old 2017-08-31 20:47:14.229153843 +0200
+++ /var/tmp/diff_new_pack.fVO1iY/_new 2017-08-31 20:47:14.233153282 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-generic-xmlpickler
#
-# 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
@@ -26,7 +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
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-generic-deriving-devel
BuildRequires: ghc-hxt-devel
++++++ generic-xmlpickler.cabal ++++++
name: generic-xmlpickler
version: 0.1.0.5
x-revision: 2
description: Generic generation of HXT XmlPickler instances using GHC Generics.
synopsis: Generic generation of HXT XmlPickler instances using GHC Generics.
category: XML, Data
cabal-version: >= 1.8
author: Silk
copyright: (c) 2015, Silk
maintainer: code(a)silk.co
homepage: http://github.com/silkapp/generic-xmlpickler
license: BSD3
license-file: LICENSE
build-type: Simple
extra-source-files:
CHANGELOG.md
LICENSE
README.md
source-repository head
type: git
location: https://github.com/silkapp/regular-xmlpickler.git
library
ghc-options: -Wall
hs-source-dirs: src
exposed-modules: Generics.XmlPickler
build-depends:
base >= 4.5 && < 4.11
, generic-deriving >= 1.6 && < 1.12
, hxt >= 9.2 && < 9.4
, text
if impl(ghc < 7.6)
build-depends: ghc-prim >= 0.2 && < 0.5
test-suite tests
ghc-options: -Wall
hs-source-dirs: tests
main-is: Main.hs
type: exitcode-stdio-1.0
build-depends:
base >= 4.5 && < 5
, generic-xmlpickler
, hxt >= 9.2 && < 9.4
, hxt-pickle-utils == 0.1.*
, tasty >= 0.10 && < 0.12
, tasty-hunit == 0.9.*
, tasty-th == 0.1.*
if impl(ghc < 7.6)
build-depends: ghc-prim >= 0.2 && < 0.5
1
0
Hello community,
here is the log from the commit of package ghc-generic-random for openSUSE:Factory checked in at 2017-08-31 20:47:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-generic-random (Old)
and /work/SRC/openSUSE:Factory/.ghc-generic-random.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-generic-random"
Thu Aug 31 20:47:08 2017 rev:2 rq:513245 version:0.5.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-generic-random/ghc-generic-random.changes 2017-06-12 15:27:52.366938725 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-generic-random.new/ghc-generic-random.changes 2017-08-31 20:47:09.777778660 +0200
@@ -1,0 +2,10 @@
+Fri Jul 28 03:01:23 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.5.0.0 revision 2.
+
+-------------------------------------------------------------------
+Thu Jul 27 14:06:57 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.5.0.0 revision 1.
+
+-------------------------------------------------------------------
Old:
----
generic-random-0.4.1.0.tar.gz
New:
----
generic-random-0.5.0.0.tar.gz
generic-random.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-generic-random.spec ++++++
--- /var/tmp/diff_new_pack.Sa7dhr/_old 2017-08-31 20:47:10.721646174 +0200
+++ /var/tmp/diff_new_pack.Sa7dhr/_new 2017-08-31 20:47:10.725645614 +0200
@@ -18,16 +18,16 @@
%global pkg_name generic-random
Name: ghc-%{pkg_name}
-Version: 0.4.1.0
+Version: 0.5.0.0
Release: 0
Summary: Generic random generators
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/2.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-QuickCheck-devel
-BuildRequires: ghc-boltzmann-samplers-devel
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -47,6 +47,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ generic-random-0.4.1.0.tar.gz -> generic-random-0.5.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/generic-random-0.4.1.0/CHANGELOG.md new/generic-random-0.5.0.0/CHANGELOG.md
--- old/generic-random-0.4.1.0/CHANGELOG.md 2017-03-05 21:30:37.000000000 +0100
+++ new/generic-random-0.5.0.0/CHANGELOG.md 2017-04-10 17:25:58.000000000 +0200
@@ -1,3 +1,9 @@
+# 0.5.0.0
+
+- Turn off dependency on boltzmann-samplers by default
+- Add genericArbitraryU, genericArbitraryU0 and genericArbitraryU1
+- Compatible with GHC 7.8.4 and GHC 7.10.3
+
# 0.4.1.0
- Move Boltzmann sampler modules to another package: boltzmann-samplers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/generic-random-0.4.1.0/generic-random.cabal new/generic-random-0.5.0.0/generic-random.cabal
--- old/generic-random-0.4.1.0/generic-random.cabal 2017-03-05 21:30:37.000000000 +0100
+++ new/generic-random-0.5.0.0/generic-random.cabal 2017-04-10 17:25:58.000000000 +0200
@@ -1,5 +1,5 @@
name: generic-random
-version: 0.4.1.0
+version: 0.5.0.0
synopsis: Generic random generators
description: Please see the README.
homepage: http://github.com/lysxia/generic-random
@@ -18,7 +18,7 @@
Description:
Dependency on boltzmann-samplers for backwards compatibility.
Manual: False
- Default: True
+ Default: False
library
hs-source-dirs: src
@@ -26,7 +26,7 @@
Generic.Random.Generic
Generic.Random.Internal.Generic
build-depends:
- base >= 4.9 && < 4.10,
+ base >= 4.7 && < 4.10,
QuickCheck
if flag(boltzmann)
exposed-modules:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/generic-random-0.4.1.0/src/Generic/Random/Generic.hs new/generic-random-0.5.0.0/src/Generic/Random/Generic.hs
--- old/generic-random-0.4.1.0/src/Generic/Random/Generic.hs 2017-03-05 21:30:37.000000000 +0100
+++ new/generic-random-0.5.0.0/src/Generic/Random/Generic.hs 2017-04-10 17:25:58.000000000 +0200
@@ -27,7 +27,9 @@
--
-- The list of weights is built up with the @('%')@ operator as a cons, and using
-- the unit @()@ as the empty list, in the order corresponding to the data type
--- definition.
+-- definition. The uniform distribution can be obtained with 'uniform'.
+--
+-- === Example
--
-- For @Tree@, 'genericArbitrary' produces code equivalent to the following:
--
@@ -40,6 +42,20 @@
-- ]
-- @
--
+-- === Uniform distribution
+--
+-- You can specify the uniform distribution (all weights equal) with 'uniform'.
+-- 'genericArbitraryU' is available as a shorthand for
+-- @'genericArbitrary' 'uniform'@.
+--
+-- Note that for many types, a uniform distribution tends to produce big
+-- values. For instance for @Tree a@, generated values are finite but the
+-- __average__ number of @Leaf@ and @Node@ constructors is __infinite__.
+--
+-- === Checked weights
+--
+-- /GHC 8.0.1 and above only./
+--
-- The weights actually have type @'W' \"ConstructorName\"@ (just a newtype
-- around 'Int'), so that you can annotate a weight with its corresponding
-- constructor, and it will be checked that you got the order right.
@@ -60,26 +76,6 @@
-- 'weighted' (x '%' y '%' z '%' ()) :: 'Weights' (Tree a)
-- @
--
--- === Uniform distribution
---
--- You can specify the uniform distribution with 'uniform'.
---
--- For @Tree@, @'genericArbitrary' 'uniform'@ produces code equivalent to the
--- following:
---
--- @
--- 'genericArbitrary' 'uniform' :: Arbitrary a => Gen (Tree a)
--- 'genericArbitrary' 'uniform' =
--- oneof
--- [ Leaf \<$\> arbitrary -- Uses Arbitrary a
--- , Node \<$\> arbitrary \<*\> arbitrary -- Uses Arbitrary (Tree a)
--- ]
--- @
---
--- Note that for many types, a uniform distribution tends to produce big
--- values. For instance for @Tree a@, generated values are finite but the
--- __average__ number of @Leaf@ and @Node@ constructors is __infinite__.
---
-- == Ensuring termination
--
-- As was just mentioned, one must be careful with recursive types
@@ -191,7 +187,10 @@
(
-- * Arbitrary implementations
genericArbitrary
+ , genericArbitraryU
, genericArbitrary'
+ , genericArbitraryU0
+ , genericArbitraryU1
-- * Specifying finite distributions
, Weights
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/generic-random-0.4.1.0/src/Generic/Random/Internal/Generic.hs new/generic-random-0.5.0.0/src/Generic/Random/Internal/Generic.hs
--- old/generic-random-0.4.1.0/src/Generic/Random/Internal/Generic.hs 2017-03-05 21:30:37.000000000 +0100
+++ new/generic-random-0.5.0.0/src/Generic/Random/Internal/Generic.hs 2017-04-10 17:25:58.000000000 +0200
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
@@ -15,8 +16,8 @@
import Control.Applicative
import Data.Coerce
-import GHC.Exts (Proxy#, proxy#)
-import GHC.Generics hiding ( S )
+import Data.Proxy
+import GHC.Generics hiding (S, Arity)
import GHC.TypeLits
import Test.QuickCheck
@@ -27,12 +28,19 @@
genericArbitrary
:: forall a
. (Generic a, GA Unsized (Rep a))
- => Weights a
+ => Weights a -- ^ List of weights for every constructor
-> Gen a
genericArbitrary (Weights w n) = (unGen' . fmap to) (ga w n :: Gen' Unsized (Rep a p))
--- | Like 'genericArbitrary'', with bounded size to ensure termination for
--- recursive types.
+-- | Shorthand for @'genericArbitrary' 'uniform'@.
+genericArbitraryU
+ :: forall a
+ . (Generic a, GA Unsized (Rep a), UniformWeight (Weights_ (Rep a)))
+ => Gen a
+genericArbitraryU = genericArbitrary uniform
+
+-- | Like 'genericArbitrary'', with decreasing size to ensure termination for
+-- recursive types, looking for base cases once the size reaches 0.
genericArbitrary'
:: forall n a
. (Generic a, GA (Sized n) (Rep a))
@@ -42,13 +50,32 @@
genericArbitrary' _ (Weights w n) =
(unGen' . fmap to) (ga w n :: Gen' (Sized n) (Rep a p))
+-- | Shorthand for @'genericArbitrary'' 'Z' 'uniform'@, using nullary
+-- constructors as the base cases.
+genericArbitraryU0
+ :: forall n a
+ . (Generic a, GA (Sized Z) (Rep a), UniformWeight (Weights_ (Rep a)))
+ => Gen a
+genericArbitraryU0 = genericArbitrary' Z uniform
+
+-- | Shorthand for @'genericArbitrary'' ('S' 'Z') 'uniform'@, using nullary
+-- constructors and constructors whose fields are all nullary as base cases.
+genericArbitraryU1
+ :: forall n a
+ . (Generic a, GA (Sized (S Z)) (Rep a), UniformWeight (Weights_ (Rep a)))
+ => Gen a
+genericArbitraryU1 = genericArbitrary' (S Z) uniform
-- * Internal
type family Weights_ (f :: * -> *) :: * where
Weights_ (f :+: g) = Weights_ f :| Weights_ g
Weights_ (M1 D _c f) = Weights_ f
+#if __GLASGOW_HASKELL__ >= 800
Weights_ (M1 C ('MetaCons c _i _j) _f) = L c
+#else
+ Weights_ (M1 C _c _f) = ()
+#endif
data a :| b = N a Int b
data L (c :: Symbol) = L
@@ -110,6 +137,10 @@
type Prec (L c) r = r
W m % prec = (L, m, prec)
+instance WeightBuilder () where
+ type Prec () r = r
+ W m % prec = ((), m, prec)
+
class UniformWeight a where
uniformWeight :: (a, Int)
@@ -124,6 +155,9 @@
instance UniformWeight (L c) where
uniformWeight = (L, 1)
+instance UniformWeight () where
+ uniformWeight = ((), 1)
+
newtype Gen' sized a = Gen' { unGen' :: Gen a }
deriving (Functor, Applicative, Monad)
@@ -144,9 +178,9 @@
ga _ _ = (Gen' . fmap M1) gaProduct
instance (GAProduct f, KnownNat (Arity f)) => GA (Sized n) (M1 C c f) where
- ga _ _ = Gen' (scale (`div` arity) gaProduct)
+ ga _ _ = Gen' (sized $ \n -> resize (n `div` arity) gaProduct)
where
- arity = fromInteger (natVal' (proxy# :: Proxy# (Arity f)))
+ arity = fromInteger (natVal (Proxy :: Proxy (Arity f)))
instance (GASum (Sized n) f, GASum (Sized n) g, BaseCases n f, BaseCases n g)
=> GA (Sized n) (f :+: g) where
++++++ generic-random.cabal ++++++
name: generic-random
version: 0.5.0.0
x-revision: 2
synopsis: Generic random generators
description:
Please see the README.
Note: this package no longer exports Boltzmann samplers by default although they appear below.
("Generic.Random.Data", "Generic.Random.Boltzmann")
homepage: http://github.com/lysxia/generic-random
license: MIT
license-file: LICENSE
stability: Experimental
author: Li-yao Xia
maintainer: lysxia(a)gmail.com
category: Generics, Testing
build-type: Simple
extra-source-files: README.md CHANGELOG.md
cabal-version: >=1.10
tested-with: GHC == 8.0.1
flag boltzmann
Description:
Dependency on boltzmann-samplers for backwards compatibility.
Manual: False
Default: False
library
hs-source-dirs: src
exposed-modules:
Generic.Random.Generic
Generic.Random.Internal.Generic
build-depends:
base >= 4.7 && < 4.11,
QuickCheck
if flag(boltzmann)
exposed-modules:
Generic.Random.Boltzmann
Generic.Random.Data
build-depends:
boltzmann-samplers <= 0.2
default-language: Haskell2010
ghc-options: -Wall -fno-warn-name-shadowing
source-repository head
type: git
location: https://github.com/lysxia/generic-random
1
0
Hello community,
here is the log from the commit of package ghc-generic-aeson for openSUSE:Factory checked in at 2017-08-31 20:47:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-generic-aeson (Old)
and /work/SRC/openSUSE:Factory/.ghc-generic-aeson.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-generic-aeson"
Thu Aug 31 20:47:06 2017 rev:4 rq:513244 version:0.2.0.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-generic-aeson/ghc-generic-aeson.changes 2017-06-04 01:53:23.186811955 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-generic-aeson.new/ghc-generic-aeson.changes 2017-08-31 20:47:06.994169381 +0200
@@ -1,0 +2,5 @@
+Fri Jul 28 03:01:25 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.2.0.9 revision 1.
+
+-------------------------------------------------------------------
New:
----
generic-aeson.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-generic-aeson.spec ++++++
--- /var/tmp/diff_new_pack.1JNqqU/_old 2017-08-31 20:47:07.958034089 +0200
+++ /var/tmp/diff_new_pack.1JNqqU/_new 2017-08-31 20:47:07.970032405 +0200
@@ -25,6 +25,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-aeson-devel
BuildRequires: ghc-attoparsec-devel
@@ -53,6 +54,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ generic-aeson.cabal ++++++
name: generic-aeson
version: 0.2.0.9
x-revision: 1
synopsis: Derivation of Aeson instances using GHC generics.
description: Derivation of Aeson instances using GHC generics.
author: Silk
maintainer: code(a)silk.co
license: BSD3
license-file: LICENSE
category: Data
build-type: Simple
cabal-version: >=1.8
extra-source-files:
CHANGELOG.md
LICENSE
README.md
source-repository head
type: git
location: https://github.com/silkapp/generic-aeson.git
library
ghc-options: -Wall
hs-source-dirs: src
exposed-modules:
Generics.Generic.Aeson
Generics.Generic.Aeson.Util
Generics.Generic.IsEnum
build-depends:
base >= 4.4 && < 4.11
, aeson >= 0.6 && < 1.3
, attoparsec >= 0.11 && < 0.14
, generic-deriving >= 1.6 && < 1.12
, mtl >= 2.0 && < 2.3
, tagged >= 0.2 && < 0.9
, text >= 0.11 && < 1.3
, unordered-containers == 0.2.*
, vector >= 0.10 && < 0.13
if impl(ghc < 7.6)
build-depends: ghc-prim
1
0