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
February 2017
- 1 participants
- 1918 discussions
Hello community,
here is the log from the commit of package ghc-xmlhtml for openSUSE:Factory checked in at 2017-02-02 15:42:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-xmlhtml (Old)
and /work/SRC/openSUSE:Factory/.ghc-xmlhtml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-xmlhtml"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-xmlhtml/ghc-xmlhtml.changes …
[View More]2017-01-18 21:42:40.145264193 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-xmlhtml.new/ghc-xmlhtml.changes 2017-02-03 17:40:37.891814926 +0100
@@ -1,0 +2,20 @@
+Mon Jan 23 20:28:12 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.2.3.5 revision 3 with cabal2obs.
+
+-------------------------------------------------------------------
+Fri Oct 21 13:19:13 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.2.3.5 revision 2 with cabal2obs.
+
+-------------------------------------------------------------------
+Sun Oct 9 15:27:54 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.2.3.5 revision 1 with cabal2obs.
+
+-------------------------------------------------------------------
+Wed Aug 17 18:32:36 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.2.3.5 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
1.cabal
xmlhtml-0.2.3.4.tar.gz
New:
----
xmlhtml-0.2.3.5.tar.gz
xmlhtml.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-xmlhtml.spec ++++++
--- /var/tmp/diff_new_pack.npQAv6/_old 2017-02-03 17:40:38.415740768 +0100
+++ /var/tmp/diff_new_pack.npQAv6/_new 2017-02-03 17:40:38.419740202 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-xmlhtml
#
-# 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,15 +17,16 @@
%global pkg_name xmlhtml
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.3.4
+Version: 0.2.3.5
Release: 0
Summary: XML parser and renderer with HTML 5 quirks mode
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/3.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-blaze-builder-devel
BuildRequires: ghc-blaze-html-devel
@@ -37,6 +38,14 @@
BuildRequires: ghc-text-devel
BuildRequires: ghc-unordered-containers-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%if %{with tests}
+BuildRequires: ghc-HUnit-devel
+BuildRequires: ghc-QuickCheck-devel
+BuildRequires: ghc-directory-devel
+BuildRequires: ghc-test-framework-devel
+BuildRequires: ghc-test-framework-hunit-devel
+BuildRequires: ghc-test-framework-quickcheck2-devel
+%endif
%description
Contains renderers and parsers for both XML and HTML 5 document fragments,
@@ -69,14 +78,14 @@
%setup -q -n %{pkg_name}-%{version}
cp -p %{SOURCE1} %{pkg_name}.cabal
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
+%check
+%cabal_test
%post devel
%ghc_pkg_recache
@@ -90,6 +99,5 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
-%doc README
%changelog
++++++ xmlhtml-0.2.3.4.tar.gz -> xmlhtml-0.2.3.5.tar.gz ++++++
++++ 4437 lines of diff (skipped)
++++++ xmlhtml.cabal ++++++
++++ 867 lines (skipped)
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-wuss for openSUSE:Factory checked in at 2017-01-31 12:41:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-wuss (Old)
and /work/SRC/openSUSE:Factory/.ghc-wuss.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-wuss"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-wuss/ghc-wuss.changes 2017-01-18 21:41:42.…
[View More]785377257 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-wuss.new/ghc-wuss.changes 2017-02-03 17:40:35.812109289 +0100
@@ -1,0 +2,10 @@
+Sun Dec 4 19:48:21 UTC 2016 - psimons(a)suse.com
+
+- Update to version 1.1.3 with cabal2obs.
+
+-------------------------------------------------------------------
+Thu Sep 15 06:47:22 UTC 2016 - psimons(a)suse.com
+
+- Update to version 1.1.1 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
wuss-1.0.4.tar.gz
New:
----
wuss-1.1.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-wuss.spec ++++++
--- /var/tmp/diff_new_pack.DEicl8/_old 2017-02-03 17:40:36.124065134 +0100
+++ /var/tmp/diff_new_pack.DEicl8/_new 2017-02-03 17:40:36.128064568 +0100
@@ -18,22 +18,20 @@
%global pkg_name wuss
Name: ghc-%{pkg_name}
-Version: 1.0.4
+Version: 1.1.3
Release: 0
Summary: Secure WebSocket (WSS) clients
License: MIT
-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-connection-devel
BuildRequires: ghc-network-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-websockets-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# End cabal-rpm deps
%description
Wuss is a library that lets you easily create secure WebSocket clients over the
@@ -58,15 +56,12 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%post devel
%ghc_pkg_recache
++++++ wuss-1.0.4.tar.gz -> wuss-1.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wuss-1.0.4/Wuss.hs new/wuss-1.1.3/Wuss.hs
--- old/wuss-1.0.4/Wuss.hs 2016-04-15 22:37:07.000000000 +0200
+++ new/wuss-1.1.3/Wuss.hs 2016-11-30 14:27:53.000000000 +0100
@@ -1,3 +1,5 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
{- |
Wuss is a library that lets you easily create secure WebSocket clients over
the WSS protocol. It is a small addition to
@@ -39,17 +41,25 @@
module Wuss
( runSecureClient
, runSecureClientWith
+ , Config(..)
+ , defaultConfig
+ , runSecureClientWithConfig
) where
-import qualified Data.ByteString as BS
-import Data.ByteString.Lazy (toStrict)
-import qualified Data.ByteString.Lazy as BL
-import Network.Connection (Connection, ConnectionParams (..), TLSSettings (..),
- connectTo, connectionGetChunk, connectionPut, initConnectionContext)
-import Network.Socket (HostName, PortNumber)
-import Network.WebSockets (ClientApp, ConnectionOptions, Headers,
- defaultConnectionOptions, runClientWithStream)
-import Network.WebSockets.Stream (makeStream)
+import qualified Control.Applicative as Applicative
+import qualified Control.Exception as Exception
+import qualified Data.Bool as Bool
+import qualified Data.ByteString as StrictBytes
+import qualified Data.ByteString.Lazy as LazyBytes
+import qualified Data.Maybe as Maybe
+import qualified Data.String as String
+import qualified Network.Connection as Connection
+import qualified Network.Socket as Socket
+import qualified Network.WebSockets as WebSockets
+import qualified Network.WebSockets.Stream as Stream
+import qualified System.IO as IO
+import qualified System.IO.Error as IO.Error
+
{- |
A secure replacement for 'Network.WebSockets.runClient'.
@@ -58,15 +68,16 @@
>>> runSecureClient "echo.websocket.org" 443 "/" app
-}
runSecureClient
- :: HostName -- ^ Host
- -> PortNumber -- ^ Port
- -> String -- ^ Path
- -> ClientApp a -- ^ Application
- -> IO a
-runSecureClient host port path app =
- let options = defaultConnectionOptions
- headers = []
- in runSecureClientWith host port path options headers app
+ :: Socket.HostName -- ^ Host
+ -> Socket.PortNumber -- ^ Port
+ -> String.String -- ^ Path
+ -> WebSockets.ClientApp a -- ^ Application
+ -> IO.IO a
+runSecureClient host port path app = do
+ let options = WebSockets.defaultConnectionOptions
+ let headers = []
+ runSecureClientWith host port path options headers app
+
{- |
A secure replacement for 'Network.WebSockets.runClientWith'.
@@ -107,36 +118,101 @@
> return ()
-}
runSecureClientWith
- :: HostName -- ^ Host
- -> PortNumber -- ^ Port
- -> String -- ^ Path
- -> ConnectionOptions -- ^ Options
- -> Headers -- ^ Headers
- -> ClientApp a -- ^ Application
- -> IO a
+ :: Socket.HostName -- ^ Host
+ -> Socket.PortNumber -- ^ Port
+ -> String.String -- ^ Path
+ -> WebSockets.ConnectionOptions -- ^ Options
+ -> WebSockets.Headers -- ^ Headers
+ -> WebSockets.ClientApp a -- ^ Application
+ -> IO.IO a
runSecureClientWith host port path options headers app = do
- context <- initConnectionContext
- connection <- connectTo context (connectionParams host port)
- stream <- makeStream (reader connection) (writer connection)
- runClientWithStream stream host path options headers app
-
-connectionParams :: HostName -> PortNumber -> ConnectionParams
-connectionParams host port = ConnectionParams
- { connectionHostname = host
- , connectionPort = port
- , connectionUseSecure = Just tlsSettings
- , connectionUseSocks = Nothing
- }
+ let config = defaultConfig
+ runSecureClientWithConfig host port path config options headers app
+
-tlsSettings :: TLSSettings
-tlsSettings = TLSSettingsSimple
- { settingDisableCertificateValidation = False
- , settingDisableSession = False
- , settingUseServerName = False
+-- | Configures a secure WebSocket connection.
+data Config = Config
+ { connectionGet :: Connection.Connection -> IO.IO StrictBytes.ByteString
+ -- ^ How to get bytes from the connection. Typically
+ -- 'Connection.connectionGetChunk', but could be something else like
+ -- 'Connection.connectionGetLine'.
}
-reader :: Connection -> IO (Maybe BS.ByteString)
-reader connection = fmap Just (connectionGetChunk connection)
-writer :: Connection -> Maybe BL.ByteString -> IO ()
-writer connection = maybe (return ()) (connectionPut connection . toStrict)
+-- | The default 'Config' value used by 'runSecureClientWith'.
+defaultConfig
+ :: Config
+defaultConfig = do
+ Config
+ { connectionGet = Connection.connectionGetChunk
+ }
+
+
+-- | Runs a secure WebSockets client with the given 'Config'.
+runSecureClientWithConfig
+ :: Socket.HostName -- ^ Host
+ -> Socket.PortNumber -- ^ Port
+ -> String.String -- ^ Path
+ -> Config -- ^ Config
+ -> WebSockets.ConnectionOptions -- ^ Options
+ -> WebSockets.Headers -- ^ Headers
+ -> WebSockets.ClientApp a -- ^ Application
+ -> IO.IO a
+runSecureClientWithConfig host port path config options headers app = do
+ context <- Connection.initConnectionContext
+ Exception.bracket
+ (Connection.connectTo context (connectionParams host port))
+ Connection.connectionClose
+ (\connection -> do
+ stream <-
+ Stream.makeStream (reader config connection) (writer connection)
+ WebSockets.runClientWithStream stream host path options headers app)
+
+
+connectionParams
+ :: Socket.HostName
+ -> Socket.PortNumber
+ -> Connection.ConnectionParams
+connectionParams host port = do
+ Connection.ConnectionParams
+ { Connection.connectionHostname = host
+ , Connection.connectionPort = port
+ , Connection.connectionUseSecure = Maybe.Just tlsSettings
+ , Connection.connectionUseSocks = Maybe.Nothing
+ }
+
+
+tlsSettings
+ :: Connection.TLSSettings
+tlsSettings = do
+ Connection.TLSSettingsSimple
+ { Connection.settingDisableCertificateValidation = Bool.False
+ , Connection.settingDisableSession = Bool.False
+ , Connection.settingUseServerName = Bool.False
+ }
+
+
+reader
+ :: Config
+ -> Connection.Connection
+ -> IO.IO (Maybe.Maybe StrictBytes.ByteString)
+reader config connection =
+ IO.Error.catchIOError (do
+ chunk <- (connectionGet config) connection
+ Applicative.pure (Maybe.Just chunk))
+ (\e ->
+ if IO.Error.isEOFError e
+ then Applicative.pure Maybe.Nothing
+ else Exception.throwIO e)
+
+
+writer
+ :: Connection.Connection
+ -> Maybe.Maybe LazyBytes.ByteString
+ -> IO.IO ()
+writer connection maybeBytes = do
+ case maybeBytes of
+ Maybe.Nothing -> do
+ Applicative.pure ()
+ Maybe.Just bytes -> do
+ Connection.connectionPut connection (LazyBytes.toStrict bytes)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wuss-1.0.4/package.yaml new/wuss-1.1.3/package.yaml
--- old/wuss-1.0.4/package.yaml 2016-04-15 22:37:07.000000000 +0200
+++ new/wuss-1.1.3/package.yaml 2016-11-30 14:27:53.000000000 +0100
@@ -16,13 +16,13 @@
library:
dependencies:
- base ==4.*
- - bytestring
+ - bytestring ==0.10.*
- connection ==0.2.*
- network
- - websockets ==0.9.*
+ - websockets >=0.9 && <0.11
exposed-modules: Wuss
license: MIT
maintainer: Taylor Fausak
name: wuss
synopsis: Secure WebSocket (WSS) clients
-version: '1.0.4'
+version: '1.1.3'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wuss-1.0.4/stack.yaml new/wuss-1.1.3/stack.yaml
--- old/wuss-1.0.4/stack.yaml 2016-04-15 22:37:07.000000000 +0200
+++ new/wuss-1.1.3/stack.yaml 2016-11-30 14:27:53.000000000 +0100
@@ -1,3 +1 @@
-install-ghc: true
-require-stack-version: ! '>=1.0.4'
-resolver: lts-5.12
+resolver: nightly-2016-07-05
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wuss-1.0.4/wuss.cabal new/wuss-1.1.3/wuss.cabal
--- old/wuss-1.0.4/wuss.cabal 2016-04-15 22:38:07.000000000 +0200
+++ new/wuss-1.1.3/wuss.cabal 2016-11-30 14:28:47.000000000 +0100
@@ -1,9 +1,9 @@
--- This file has been generated from package.yaml by hpack version 0.9.0.
+-- This file has been generated from package.yaml by hpack version 0.14.0.
--
-- see: https://github.com/sol/hpack
name: wuss
-version: 1.0.4
+version: 1.1.3
synopsis: Secure WebSocket (WSS) clients
description: Wuss is a library that lets you easily create secure WebSocket clients over the WSS protocol. It is a small addition to <https://hackage.haskell.org/package/websockets the websockets package> and is adapted from existing solutions by <https://gist.github.com/jaspervdj/7198388 @jaspervdj>, <https://gist.github.com/mpickering/f1b7ba3190a4bb5884f3 @mpickering>, and <https://gist.github.com/elfenlaid/7b5c28065e67e4cf0767 @elfenlaid>.
category: Network
@@ -28,10 +28,10 @@
ghc-options: -Wall
build-depends:
base ==4.*
- , bytestring
+ , bytestring ==0.10.*
, connection ==0.2.*
, network
- , websockets ==0.9.*
+ , websockets >=0.9 && <0.11
exposed-modules:
Wuss
other-modules:
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-websockets for openSUSE:Factory checked in at 2017-01-31 12:41:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-websockets (Old)
and /work/SRC/openSUSE:Factory/.ghc-websockets.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-websockets"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-websockets/ghc-…
[View More]websockets.changes 2017-01-18 21:40:34.942972891 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-websockets.new/ghc-websockets.changes 2017-02-03 17:40:34.260328929 +0100
@@ -1,0 +2,10 @@
+Sun Dec 4 19:48:14 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.9.8.2 with cabal2obs.
+
+-------------------------------------------------------------------
+Mon Aug 1 10:39:22 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.9.7.0 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
1.cabal
websockets-0.9.6.2.tar.gz
New:
----
websockets-0.9.8.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-websockets.spec ++++++
--- /var/tmp/diff_new_pack.dCdGeC/_old 2017-02-03 17:40:34.648274019 +0100
+++ /var/tmp/diff_new_pack.dCdGeC/_new 2017-02-03 17:40:34.652273453 +0100
@@ -19,16 +19,14 @@
%global pkg_name websockets
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.9.6.2
+Version: 0.9.8.2
Release: 0
Summary: A sensible and clean way to write WebSocket-capable servers in Haskell
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
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-SHA-devel
BuildRequires: ghc-attoparsec-devel
BuildRequires: ghc-base64-bytestring-devel
@@ -50,7 +48,6 @@
BuildRequires: ghc-test-framework-hunit-devel
BuildRequires: ghc-test-framework-quickcheck2-devel
%endif
-# End cabal-rpm deps
%description
This library allows you to write WebSocket-capable servers.
@@ -82,22 +79,15 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post devel
%ghc_pkg_recache
++++++ websockets-0.9.6.2.tar.gz -> websockets-0.9.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websockets-0.9.6.2/CHANGELOG new/websockets-0.9.8.2/CHANGELOG
--- old/websockets-0.9.6.2/CHANGELOG 2016-05-29 13:58:38.000000000 +0200
+++ new/websockets-0.9.8.2/CHANGELOG 2016-11-29 11:15:35.000000000 +0100
@@ -1,3 +1,18 @@
+- 0.9.8.2
+ * Bump `HUnit` dependency to 1.5
+
+- 0.9.8.1
+ * Restore state of the package to version `0.9.7.0`
+
+- 0.9.8.0
+ * This release contained a feature which broke backwards-compatibility.
+ Hence, it was marked as broken a new release containing the changes will
+ be uploaded as `0.10.0.0`.
+
+- 0.9.7.0
+ * Fix issue trying to kill builtin server
+ * Bump `QuickCheck` dependency to 2.9
+
- 0.9.6.2
* Bump `binary` dependency for GHC 8.0 compatibility
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websockets-0.9.6.2/src/Network/WebSockets/Server.hs new/websockets-0.9.8.2/src/Network/WebSockets/Server.hs
--- old/websockets-0.9.6.2/src/Network/WebSockets/Server.hs 2016-05-29 13:58:38.000000000 +0200
+++ new/websockets-0.9.8.2/src/Network/WebSockets/Server.hs 2016-11-29 11:15:35.000000000 +0100
@@ -15,8 +15,9 @@
--------------------------------------------------------------------------------
import Control.Concurrent (forkIOWithUnmask)
-import Control.Exception (bracket, bracketOnError,
- finally, throwIO, mask_)
+import Control.Exception (allowInterrupt, bracket,
+ bracketOnError, finally, mask_,
+ throwIO)
import Control.Monad (forever, void)
import Network.Socket (Socket)
import qualified Network.Socket as S
@@ -60,7 +61,8 @@
(makeListenSocket host port)
S.sClose
(\sock ->
- forever $ mask_ $ do
+ mask_ $ forever $ do
+ allowInterrupt
(conn, _) <- S.accept sock
void $ forkIOWithUnmask $ \unmask ->
finally (unmask $ runApp conn opts app) (S.sClose conn)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websockets-0.9.6.2/websockets.cabal new/websockets-0.9.8.2/websockets.cabal
--- old/websockets-0.9.6.2/websockets.cabal 2016-05-29 13:58:38.000000000 +0200
+++ new/websockets-0.9.8.2/websockets.cabal 2016-11-29 11:15:35.000000000 +0100
@@ -1,5 +1,5 @@
Name: websockets
-Version: 0.9.6.2
+Version: 0.9.8.2
Synopsis:
A sensible and clean way to write WebSocket-capable servers in Haskell.
@@ -70,7 +70,7 @@
Build-depends:
attoparsec >= 0.10 && < 0.14,
- base >= 4 && < 5,
+ base >= 4.4 && < 5,
base64-bytestring >= 0.1 && < 1.1,
binary >= 0.5 && < 0.9,
blaze-builder >= 0.3 && < 0.5,
@@ -97,8 +97,8 @@
Network.WebSockets.Tests.Util
Build-depends:
- HUnit >= 1.2 && < 1.4,
- QuickCheck >= 2.7 && < 2.9,
+ HUnit >= 1.2 && < 1.6,
+ QuickCheck >= 2.7 && < 2.10,
test-framework >= 0.4 && < 0.9,
test-framework-hunit >= 0.2 && < 0.4,
test-framework-quickcheck2 >= 0.2 && < 0.4,
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-web-routes for openSUSE:Factory checked in at 2017-01-31 12:40:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-web-routes (Old)
and /work/SRC/openSUSE:Factory/.ghc-web-routes.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-web-routes"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-web-routes/ghc-web-…
[View More]routes.changes 2017-01-18 21:40:10.650408808 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-web-routes.new/ghc-web-routes.changes 2017-02-03 17:40:32.676553098 +0100
@@ -1,0 +2,5 @@
+Mon Aug 1 10:36:21 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.27.11 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
web-routes-0.27.10.tar.gz
New:
----
web-routes-0.27.11.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-web-routes.spec ++++++
--- /var/tmp/diff_new_pack.wJwZuT/_old 2017-02-03 17:40:33.012505547 +0100
+++ /var/tmp/diff_new_pack.wJwZuT/_new 2017-02-03 17:40:33.012505547 +0100
@@ -19,15 +19,14 @@
%global pkg_name web-routes
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.27.10
+Version: 0.27.11
Release: 0
Summary: Portable, type-safe URL routing
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-blaze-builder-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-exceptions-devel
@@ -44,7 +43,6 @@
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-hspec-devel
%endif
-# End cabal-rpm deps
%description
A collection of types and functions that ensure that URLs generated by an
@@ -64,20 +62,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
++++++ web-routes-0.27.10.tar.gz -> web-routes-0.27.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/web-routes-0.27.10/Web/Routes/Base.hs new/web-routes-0.27.11/Web/Routes/Base.hs
--- old/web-routes-0.27.10/Web/Routes/Base.hs 2015-12-18 17:49:17.000000000 +0100
+++ new/web-routes-0.27.11/Web/Routes/Base.hs 2016-07-26 02:27:35.000000000 +0200
@@ -14,6 +14,7 @@
module Web.Routes.Base
( encodePathInfo
, decodePathInfo
+ , decodePathInfoParams
) where
import Blaze.ByteString.Builder (Builder, toByteString)
@@ -22,7 +23,7 @@
import Data.List (intercalate, intersperse)
import Data.Text (Text)
import Data.Text.Encoding as Text (encodeUtf8, decodeUtf8)
-import Network.HTTP.Types (encodePath, decodePathSegments, queryTextToQuery)
+import Network.HTTP.Types (Query, encodePath, decodePath, decodePathSegments, queryTextToQuery, queryToQueryText)
{-
@@ -281,3 +282,13 @@
-}
decodePathInfo :: ByteString -> [Text]
decodePathInfo = decodePathSegments
+
+-- | Returns path segments as well as possible query string components
+--
+-- For example:
+--
+-- > decodePathInfoParams "/home?q=1"
+-- (["home"],[("q",Just "1")])
+--
+decodePathInfoParams :: ByteString -> ([Text], [(Text, Maybe Text)])
+decodePathInfoParams = fmap queryToQueryText . decodePath
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/web-routes-0.27.10/Web/Routes/PathInfo.hs new/web-routes-0.27.11/Web/Routes/PathInfo.hs
--- old/web-routes-0.27.10/Web/Routes/PathInfo.hs 2015-12-18 17:49:17.000000000 +0100
+++ new/web-routes-0.27.11/Web/Routes/PathInfo.hs 2016-07-26 02:27:35.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances #-}
+{-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances, TupleSections #-}
#if __GLASGOW_HASKELL__ > 702
{-# LANGUAGE DefaultSignatures, OverloadedStrings, ScopedTypeVariables, TypeOperators #-}
@@ -18,6 +18,7 @@
, toPathInfo
, toPathInfoParams
, fromPathInfo
+ , fromPathInfoParams
, mkSitePI
, showParseError
#if __GLASGOW_HASKELL__ > 702
@@ -41,7 +42,7 @@
import Text.ParserCombinators.Parsec.Error (ParseError, errorPos, errorMessages, showErrorMessages)
import Text.ParserCombinators.Parsec.Pos (incSourceLine, sourceName, sourceLine, sourceColumn)
import Text.ParserCombinators.Parsec.Prim ((<?>), GenParser, getInput, setInput, getPosition, token, parse, many)
-import Web.Routes.Base (decodePathInfo, encodePathInfo)
+import Web.Routes.Base (decodePathInfoParams, decodePathInfo, encodePathInfo)
import Web.Routes.Site (Site(..))
#if __GLASGOW_HASKELL__ > 702
@@ -286,11 +287,25 @@
fromPathInfo :: (PathInfo url) => ByteString -> Either String url
fromPathInfo pi =
parseSegments fromPathSegments (decodePathInfo $ dropSlash pi)
+
+-- | parse a 'String' into '(url, Query)' using 'PathInfo'.
+--
+-- returns @Left "parse error"@ on failure
+--
+-- returns @Right (url, Query@ on success
+
+fromPathInfoParams :: (PathInfo url) => ByteString -> Either String (url, [(Text, Maybe Text)])
+fromPathInfoParams pi =
+ (,query) <$> parseSegments fromPathSegments url
where
- dropSlash s =
- if ((B.singleton '/') `B.isPrefixOf` s)
- then B.tail s
- else s
+ (url, query) = decodePathInfoParams $ dropSlash pi
+
+-- | Removes a leading slash, if it exists
+dropSlash :: ByteString -> ByteString
+dropSlash s =
+ if ((B.singleton '/') `B.isPrefixOf` s)
+ then B.tail s
+ else s
-- | turn a routing function into a 'Site' value using the 'PathInfo' class
mkSitePI :: (PathInfo url) =>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/web-routes-0.27.10/test/Test.hs new/web-routes-0.27.11/test/Test.hs
--- old/web-routes-0.27.10/test/Test.hs 2015-12-18 17:49:17.000000000 +0100
+++ new/web-routes-0.27.11/test/Test.hs 2016-07-26 02:27:35.000000000 +0200
@@ -2,6 +2,7 @@
module Main (main) where
+import Data.Text (Text)
import Test.HUnit
import Test.QuickCheck
import Test.Hspec
@@ -28,6 +29,11 @@
do toPathInfo Home @?= "/home"
toPathInfo (Article 0) @?= "/article/0"
+case_toPathInfoParams :: Assertion
+case_toPathInfoParams =
+ do toPathInfoParams Home [("q",Just "1"),("r",Just "2")] @?= "/home?q=1&r=2"
+ toPathInfoParams (Article 0) [("q",Just "1"),("r",Just "2")] @?= "/article/0?q=1&r=2"
+
case_fromPathInfo :: Assertion
case_fromPathInfo =
do fromPathInfo "/home" @?= Right Home
@@ -36,8 +42,18 @@
Left _ -> return ()
url -> assertFailure $ "expected a Left, but got: " ++ show url
+case_fromPathInfoParams :: Assertion
+case_fromPathInfoParams =
+ do fromPathInfoParams "/home?q=1&r=2" @?= Right (Home, [("q",Just "1"),("r",Just "2")])
+ fromPathInfoParams "/article/0?q=1&r=2" @?= Right (Article 0, [("q",Just "1"),("r",Just "2")])
+ case fromPathInfoParams "/?q=1&r=2" :: Either String (Sitemap, [(Text, Maybe Text)]) of
+ Left _ -> return ()
+ url -> assertFailure $ "expected a Left, but got: " ++ show url
+
main :: IO ()
main = hspec $ do
prop "toPathInfo" case_toPathInfo
+ prop "toPathInfoParams" case_toPathInfoParams
prop "fromPathInfo" case_fromPathInfo
- prop "PathInfo_isomorphism" prop_PathInfo_isomorphism
+ prop "fromPathInfoParams" case_fromPathInfoParams
+ prop "PathInfo_isomorphism" prop_PathInfo_isomorphism
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/web-routes-0.27.10/web-routes.cabal new/web-routes-0.27.11/web-routes.cabal
--- old/web-routes-0.27.10/web-routes.cabal 2015-12-18 17:49:17.000000000 +0100
+++ new/web-routes-0.27.11/web-routes.cabal 2016-07-26 02:27:35.000000000 +0200
@@ -1,5 +1,5 @@
Name: web-routes
-Version: 0.27.10
+Version: 0.27.11
License: BSD3
License-File: LICENSE
Author: jeremy(a)seereason.com
@@ -20,6 +20,7 @@
HUnit,
hspec,
QuickCheck,
+ text,
web-routes
Library
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-web-routes-th for openSUSE:Factory checked in at 2017-01-31 12:40:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-web-routes-th (Old)
and /work/SRC/openSUSE:Factory/.ghc-web-routes-th.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-web-routes-th"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-web-…
[View More]routes-th/ghc-web-routes-th.changes 2017-01-18 21:40:23.872538685 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-web-routes-th.new/ghc-web-routes-th.changes 2017-02-03 17:40:33.496437051 +0100
@@ -1,0 +2,5 @@
+Sun Nov 6 21:26:01 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.22.6 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
web-routes-th-0.22.5.tar.gz
New:
----
web-routes-th-0.22.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-web-routes-th.spec ++++++
--- /var/tmp/diff_new_pack.l8fG9D/_old 2017-02-03 17:40:33.828390066 +0100
+++ /var/tmp/diff_new_pack.l8fG9D/_new 2017-02-03 17:40:33.832389500 +0100
@@ -19,15 +19,14 @@
%global pkg_name web-routes-th
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.22.5
+Version: 0.22.6
Release: 0
Summary: Support for deriving PathInfo using Template Haskell
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-parsec-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-split-devel
@@ -40,7 +39,6 @@
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-hspec-devel
%endif
-# End cabal-rpm deps
%description
Web-routes is a portable library for type-safe URLs. This module adds support
@@ -60,20 +58,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
++++++ web-routes-th-0.22.5.tar.gz -> web-routes-th-0.22.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/web-routes-th-0.22.5/web-routes-th.cabal new/web-routes-th-0.22.6/web-routes-th.cabal
--- old/web-routes-th-0.22.5/web-routes-th.cabal 2016-06-04 01:44:32.000000000 +0200
+++ new/web-routes-th-0.22.6/web-routes-th.cabal 2016-11-03 01:39:34.000000000 +0100
@@ -1,10 +1,10 @@
Name: web-routes-th
-Version: 0.22.5
+Version: 0.22.6
License: BSD3
License-File: LICENSE
Author: jeremy(a)seereason.com
Maintainer: partners(a)seereason.com
-Bug-Reports: http://bugzilla.seereason.com/
+Homepage: https://github.com/happstack/web-routes-th
Category: Web, Language
Synopsis: Support for deriving PathInfo using Template Haskell
Description: web-routes is a portable library for type-safe URLs. This module adds
@@ -14,12 +14,16 @@
Build-type: Simple
tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1
+source-repository head
+ type: git
+ location: https://github.com/happstack/web-routes-th
+
test-suite Test
type : exitcode-stdio-1.0
main-is : Test.hs
hs-source-dirs : test
build-depends : base == 4.*,
- hspec == 2.2.*,
+ hspec >= 2.2 && < 2.4,
HUnit,
QuickCheck,
web-routes,
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-vinyl for openSUSE:Factory checked in at 2017-01-31 12:40:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vinyl (Old)
and /work/SRC/openSUSE:Factory/.ghc-vinyl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vinyl"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-vinyl/ghc-vinyl.changes 2017-01-18 21:…
[View More]39:07.659318149 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-vinyl.new/ghc-vinyl.changes 2017-02-03 17:40:30.556853123 +0100
@@ -1,0 +2,5 @@
+Mon Dec 19 10:18:43 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.5.3 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
vinyl-0.5.2.tar.gz
New:
----
vinyl-0.5.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-vinyl.spec ++++++
--- /var/tmp/diff_new_pack.2TvwDO/_old 2017-02-03 17:40:30.968794816 +0100
+++ /var/tmp/diff_new_pack.2TvwDO/_new 2017-02-03 17:40:30.972794250 +0100
@@ -19,23 +19,21 @@
%global pkg_name vinyl
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.5.2
+Version: 0.5.3
Release: 0
Summary: Extensible Records
License: MIT
-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
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# Begin cabal-rpm deps:
%if %{with tests}
BuildRequires: ghc-doctest-devel
BuildRequires: ghc-lens-devel
BuildRequires: ghc-singletons-devel
%endif
-# End cabal-rpm deps
%description
Extensible records for Haskell with lenses using modern GHC features.
@@ -54,20 +52,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
++++++ vinyl-0.5.2.tar.gz -> vinyl-0.5.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vinyl-0.5.2/CHANGELOG.md new/vinyl-0.5.3/CHANGELOG.md
--- old/vinyl-0.5.2/CHANGELOG.md 2016-02-23 00:07:01.000000000 +0100
+++ new/vinyl-0.5.3/CHANGELOG.md 2016-12-14 02:47:29.000000000 +0100
@@ -1,3 +1,7 @@
+# 0.5.3
+
+Added a concise `Show` instance for `Const`.
+
# 0.5.2
Ported the tutorial to haddocks (andrewthad)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vinyl-0.5.2/Data/Vinyl/Core.hs new/vinyl-0.5.3/Data/Vinyl/Core.hs
--- old/vinyl-0.5.2/Data/Vinyl/Core.hs 2016-02-23 00:07:01.000000000 +0100
+++ new/vinyl-0.5.3/Data/Vinyl/Core.hs 2016-08-19 20:53:23.000000000 +0200
@@ -25,6 +25,8 @@
import Data.Typeable (Proxy(..))
import Data.List (intercalate)
import Data.Vinyl.TypeLevel
+import Data.Type.Equality (TestEquality (..), (:~:) (..))
+import Data.Type.Coercion (TestCoercion (..), Coercion (..))
-- | A record is parameterized by a universe @u@, an interpretation @f@ and a
-- list of rows @rs@. The labels or indices of the record are given by
@@ -39,6 +41,22 @@
infixl 8 <<$>>
infixl 8 <<*>>
+instance TestEquality f => TestEquality (Rec f) where
+ testEquality RNil RNil = Just Refl
+ testEquality (x :& xs) (y :& ys) = do
+ Refl <- testEquality x y
+ Refl <- testEquality xs ys
+ Just Refl
+ testEquality _ _ = Nothing
+
+instance TestCoercion f => TestCoercion (Rec f) where
+ testCoercion RNil RNil = Just Coercion
+ testCoercion (x :& xs) (y :& ys) = do
+ Coercion <- testCoercion x y
+ Coercion <- testCoercion xs ys
+ Just Coercion
+ testCoercion _ _ = Nothing
+
-- | Two records may be pasted together.
rappend
:: Rec f as
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vinyl-0.5.2/Data/Vinyl/Functor.hs new/vinyl-0.5.3/Data/Vinyl/Functor.hs
--- old/vinyl-0.5.2/Data/Vinyl/Functor.hs 2016-02-23 00:07:01.000000000 +0100
+++ new/vinyl-0.5.3/Data/Vinyl/Functor.hs 2016-12-14 02:47:13.000000000 +0100
@@ -79,6 +79,9 @@
, Storable
)
+instance Show a => Show (Const a b) where
+ show (Const x) = "(Const "++show x ++")"
+
instance (Functor f, Functor g) => Functor (Compose f g) where
fmap f (Compose x) = Compose (fmap (fmap f) x)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vinyl-0.5.2/tests/Intro.lhs new/vinyl-0.5.3/tests/Intro.lhs
--- old/vinyl-0.5.2/tests/Intro.lhs 2016-02-23 00:07:01.000000000 +0100
+++ new/vinyl-0.5.3/tests/Intro.lhs 2016-05-12 00:06:01.000000000 +0200
@@ -36,7 +36,7 @@
> data Fields = Name | Age | Sleeping | Master deriving Show
Any record can be now described by a type-level list of these labels.
-The `DataKinds` extension must be enabled to autmatically turn all the
+The `DataKinds` extension must be enabled to automatically turn all the
constructors of the `Field` type into types.
> type LifeForm = [Name, Age, Sleeping]
@@ -155,7 +155,7 @@
> upcastedTucker = rcast tucker
The subtyping relationship between record types is expressed with the
-`(<:)` constraint; so, rcast is of the following type:
+`(<:)` constraint; so, `rcast` is of the following type:
< rcast :: r1 <: r2 => Rec f r1 -> Rec f r2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vinyl-0.5.2/vinyl.cabal new/vinyl-0.5.3/vinyl.cabal
--- old/vinyl-0.5.2/vinyl.cabal 2016-02-23 00:07:01.000000000 +0100
+++ new/vinyl-0.5.3/vinyl.cabal 2016-12-14 02:45:36.000000000 +0100
@@ -1,5 +1,5 @@
name: vinyl
-version: 0.5.2
+version: 0.5.3
synopsis: Extensible Records
-- description:
license: MIT
[View Less]
1
0
03 Feb '17
Hello community,
here is the log from the commit of package ghc-vector-binary-instances for openSUSE:Factory checked in at 2017-01-31 12:45:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vector-binary-instances (Old)
and /work/SRC/openSUSE:Factory/.ghc-vector-binary-instances.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vector-binary-instances"
Changes:
--------
--…
[View More]- /work/SRC/openSUSE:Factory/ghc-vector-binary-instances/ghc-vector-binary-instances.changes 2016-12-06 14:26:15.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-vector-binary-instances.new/ghc-vector-binary-instances.changes 2017-02-03 17:40:29.632983888 +0100
@@ -1,0 +2,5 @@
+Wed Jan 18 09:00:04 UTC 2017 - psimons(a)suse.com
+
+- Update to version 0.2.3.4 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
vector-binary-instances-0.2.3.3.tar.gz
New:
----
vector-binary-instances-0.2.3.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-vector-binary-instances.spec ++++++
--- /var/tmp/diff_new_pack.1N2yWE/_old 2017-02-03 17:40:29.968936336 +0100
+++ /var/tmp/diff_new_pack.1N2yWE/_new 2017-02-03 17:40:29.968936336 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-vector-binary-instances
#
-# 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,7 +19,7 @@
%global pkg_name vector-binary-instances
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.3.3
+Version: 0.2.3.4
Release: 0
Summary: Instances of Data.Binary and Data.Serialize for vector
License: BSD-3-Clause
++++++ vector-binary-instances-0.2.3.3.tar.gz -> vector-binary-instances-0.2.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-binary-instances-0.2.3.3/vector-binary-instances.cabal new/vector-binary-instances-0.2.3.4/vector-binary-instances.cabal
--- old/vector-binary-instances-0.2.3.3/vector-binary-instances.cabal 2016-11-13 23:35:16.000000000 +0100
+++ new/vector-binary-instances-0.2.3.4/vector-binary-instances.cabal 2017-01-08 16:45:37.000000000 +0100
@@ -1,5 +1,5 @@
Name: vector-binary-instances
-Version: 0.2.3.3
+Version: 0.2.3.4
Synopsis: Instances of Data.Binary and Data.Serialize for vector
Description:
Instances for Binary for the types defined in the vector package,
@@ -51,7 +51,7 @@
-- Packages needed in order to build this package.
Build-depends:
base > 3 && < 4.10,
- vector >= 0.6 && < 0.12,
+ vector >= 0.6 && < 0.13,
binary >= 0.5 && < 0.9
Benchmark benchmarks
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-validation for openSUSE:Factory checked in at 2017-01-31 12:40:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-validation (Old)
and /work/SRC/openSUSE:Factory/.ghc-validation.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-validation"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-validation/ghc-…
[View More]validation.changes 2017-01-18 21:38:45.126505126 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-validation.new/ghc-validation.changes 2017-02-03 17:40:28.805101067 +0100
@@ -1,0 +2,5 @@
+Tue Nov 29 11:30:40 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.5.4 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
validation-0.5.3.tar.gz
New:
----
validation-0.5.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-validation.spec ++++++
--- /var/tmp/diff_new_pack.D2ML9v/_old 2017-02-03 17:40:29.129055214 +0100
+++ /var/tmp/diff_new_pack.D2ML9v/_new 2017-02-03 17:40:29.133054649 +0100
@@ -19,11 +19,11 @@
%global pkg_name validation
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.5.3
+Version: 0.5.4
Release: 0
Summary: A data-type like Either but with an accumulating Applicative
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
@@ -111,19 +111,15 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
%cabal_test
-
%post devel
%ghc_pkg_recache
++++++ validation-0.5.3.tar.gz -> validation-0.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validation-0.5.3/changelog new/validation-0.5.4/changelog
--- old/validation-0.5.3/changelog 2016-07-20 05:23:09.000000000 +0200
+++ new/validation-0.5.4/changelog 2016-11-24 08:23:10.000000000 +0100
@@ -1,3 +1,8 @@
+0.5.4
+
+* remove redundant constraints.
+* add instance `Validate` for `ValidationB Identity`.
+
0.5.3
* Update `transformers` dependency to work with GHC8.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validation-0.5.3/src/Data/Validation.hs new/validation-0.5.4/src/Data/Validation.hs
--- old/validation-0.5.3/src/Data/Validation.hs 2016-07-20 05:23:09.000000000 +0200
+++ new/validation-0.5.4/src/Data/Validation.hs 2016-11-24 08:23:10.000000000 +0100
@@ -1,5 +1,6 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE TypeFamilies #-}
-- | Data types similar to @Data.Either@ that are explicit about failure and success.
module Data.Validation
@@ -36,7 +37,7 @@
import Data.Functor.Alt(Alt((<!>)))
import Data.Functor.Apply(Apply((<.>)))
import Data.Functor.Bind(Bind((>>-)), liftF2)
-import Data.Functor.Identity(Identity(Identity))
+import Data.Functor.Identity(Identity(Identity, runIdentity))
import Data.Monoid(Monoid(mappend, mempty))
import Data.Ord(Ord)
import Data.Semigroup(Semigroup((<>)))
@@ -125,7 +126,7 @@
AccSuccess a
{-# INLINE altAccValidation #-}
-instance Semigroup err => Alt (AccValidation err) where
+instance Alt (AccValidation err) where
(<!>) =
altAccValidation
@@ -488,7 +489,7 @@
aplValidationT
altValidationT ::
- (Functor m, Monad m) =>
+ Monad m =>
ValidationT err m a
-> ValidationT err m a
-> ValidationT err m a
@@ -625,7 +626,7 @@
aplValidationB
altValidationB ::
- (Functor m, Monad m) =>
+ Monad m =>
ValidationB m err a
-> ValidationB m err a
-> ValidationB m err a
@@ -866,6 +867,12 @@
_Either =
id
+instance (m ~ Identity) => Validate (ValidationB m) where
+ _Validation =
+ iso
+ (\(ValidationB x) -> runIdentity x)
+ (ValidationB . Identity)
+
_Failure ::
Validate f =>
Prism (f e1 a) (f e2 a) e1 e2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/validation-0.5.3/validation.cabal new/validation-0.5.4/validation.cabal
--- old/validation-0.5.3/validation.cabal 2016-07-20 05:23:09.000000000 +0200
+++ new/validation-0.5.4/validation.cabal 2016-11-24 08:23:10.000000000 +0100
@@ -1,5 +1,5 @@
name: validation
-version: 0.5.3
+version: 0.5.4
license: BSD3
license-file: LICENSE
author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>, Nick Partridge <nkpart>
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-utility-ht for openSUSE:Factory checked in at 2017-01-31 12:40:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-utility-ht (Old)
and /work/SRC/openSUSE:Factory/.ghc-utility-ht.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-utility-ht"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-utility-ht/ghc-…
[View More]utility-ht.changes 2017-01-18 21:38:21.561838033 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-utility-ht.new/ghc-utility-ht.changes 2017-02-03 17:40:27.641265797 +0100
@@ -1,0 +2,5 @@
+Thu Sep 15 06:35:12 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.0.12 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
utility-ht-0.0.11.tar.gz
New:
----
utility-ht-0.0.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-utility-ht.spec ++++++
--- /var/tmp/diff_new_pack.56rb2D/_old 2017-02-03 17:40:27.965219944 +0100
+++ /var/tmp/diff_new_pack.56rb2D/_new 2017-02-03 17:40:27.965219944 +0100
@@ -19,21 +19,19 @@
%global pkg_name utility-ht
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.0.11
+Version: 0.0.12
Release: 0
Summary: Various small helper functions for Lists, Maybes, Tuples, Functions
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
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# Begin cabal-rpm deps:
%if %{with tests}
BuildRequires: ghc-QuickCheck-devel
%endif
-# End cabal-rpm deps
%description
Various small helper functions for Lists, Maybes, Tuples, Functions.
@@ -64,20 +62,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
++++++ utility-ht-0.0.11.tar.gz -> utility-ht-0.0.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Control/Applicative/HT.hs new/utility-ht-0.0.12/src/Control/Applicative/HT.hs
--- old/utility-ht-0.0.11/src/Control/Applicative/HT.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Control/Applicative/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,31 @@
+module Control.Applicative.HT where
+
+import qualified Data.Tuple.HT as Tuple
+
+import Control.Applicative (Applicative, liftA2, liftA3, (<$>), (<*>), )
+
+mapPair :: (Applicative f) => (a -> f c, b -> f d) -> (a,b) -> f (c,d)
+mapPair fg = uncurry (liftA2 (,)) . Tuple.mapPair fg
+
+mapTriple ::
+ (Applicative m) => (a -> m d, b -> m e, c -> m f) -> (a,b,c) -> m (d,e,f)
+mapTriple fgh = Tuple.uncurry3 (liftA3 (,,)) . Tuple.mapTriple fgh
+
+
+{-# INLINE liftA4 #-}
+liftA4 :: Applicative f =>
+ (a -> b -> c -> d -> e) ->
+ f a -> f b -> f c -> f d -> f e
+liftA4 f a b c d = f <$> a <*> b <*> c <*> d
+
+{-# INLINE liftA5 #-}
+liftA5 :: Applicative f =>
+ (a -> b -> c -> d -> e -> g) ->
+ f a -> f b -> f c -> f d -> f e -> f g
+liftA5 f a b c d e = f <$> a <*> b <*> c <*> d <*> e
+
+{-# INLINE liftA6 #-}
+liftA6 :: Applicative f =>
+ (a -> b -> c -> d -> e -> g -> h) ->
+ f a -> f b -> f c -> f d -> f e -> f g -> f h
+liftA6 f a b c d e g = f <$> a <*> b <*> c <*> d <*> e <*> g
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Control/Functor/HT.hs new/utility-ht-0.0.12/src/Control/Functor/HT.hs
--- old/utility-ht-0.0.11/src/Control/Functor/HT.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Control/Functor/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -28,6 +28,24 @@
unzip3 :: Functor f => f (a, b, c) -> (f a, f b, f c)
unzip3 x = (fmap fst3 x, fmap snd3 x, fmap thd3 x)
+
+mapFst :: Functor f => (a -> f c) -> (a, b) -> f (c, b)
+mapFst f ~(a,b) = fmap (flip (,) b) $ f a
+
+mapSnd :: Functor f => (b -> f c) -> (a, b) -> f (a, c)
+mapSnd f ~(a,b) = fmap ((,) a) $ f b
+
+
+mapFst3 :: Functor f => (a -> f d) -> (a,b,c) -> f (d,b,c)
+mapFst3 f ~(a,b,c) = fmap (\x -> (x,b,c)) $ f a
+
+mapSnd3 :: Functor f => (b -> f d) -> (a,b,c) -> f (a,d,c)
+mapSnd3 f ~(a,b,c) = fmap (\x -> (a,x,c)) $ f b
+
+mapThd3 :: Functor f => (c -> f d) -> (a,b,c) -> f (a,b,d)
+mapThd3 f ~(a,b,c) = fmap ((,,) a b) $ f c
+
+
{- |
Generalization of 'Data.List.HT.outerProduct'.
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Control/Monad/HT.hs new/utility-ht-0.0.12/src/Control/Monad/HT.hs
--- old/utility-ht-0.0.11/src/Control/Monad/HT.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Control/Monad/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -45,6 +45,15 @@
in aux m
{- |
+I think this makes only sense in a lazy monad
+like @Trans.State.Lazy@ or @IO.Lazy@.
+-}
+iterate :: Monad m => (a -> m a) -> a -> m [a]
+iterate f =
+ let go x = lift (x:) $ go =<< f x
+ in go
+
+{- |
Lazy monadic conjunction.
That is, when the first action returns @False@,
then @False@ is immediately returned, without running the second action.
@@ -84,6 +93,7 @@
chain :: (Monad m) => [a -> m a] -> (a -> m a)
chain = foldr (flip (<=<)) return
+-- there is also mfilter, but this should be part of Control.Monad.Plus
filter :: Monad m => (a -> m Bool) -> [a] -> m [a]
filter = M.filterM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/Bits/HT.hs new/utility-ht-0.0.12/src/Data/Bits/HT.hs
--- old/utility-ht-0.0.11/src/Data/Bits/HT.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Data/Bits/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,20 @@
+module Data.Bits.HT where
+
+import Data.Bits (Bits, shiftL, shiftR)
+
+
+infixl 7 .<<., .>>.
+
+{- |
+Infix variant of 'shiftL'.
+Precedence is chosen like multiplication since @a .<<. k == a * 2^k@.
+-}
+(.<<.) :: Bits a => a -> Int -> a
+(.<<.) = shiftL
+
+{- |
+Infix variant of 'shiftR'.
+Precedence is chosen like division since @a .>>. k == a / 2^k@.
+-}
+(.>>.) :: Bits a => a -> Int -> a
+(.>>.) = shiftR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/List/HT/Private.hs new/utility-ht-0.0.12/src/Data/List/HT/Private.hs
--- old/utility-ht-0.0.11/src/Data/List/HT/Private.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/List/HT/Private.hs 2016-09-01 19:19:05.000000000 +0200
@@ -5,10 +5,12 @@
import Data.Maybe as Maybe (fromMaybe, catMaybes, )
import Data.Maybe.HT (toMaybe, )
import Control.Monad (guard, msum, )
+import Control.Applicative ((<*>), )
import Data.Tuple.HT (mapPair, mapFst, mapSnd, forcePair, swap, )
import qualified Data.List.Key.Private as Key
import qualified Data.List.Match.Private as Match
+import qualified Data.List.Reverse.StrictElement as Rev
import Prelude hiding (unzip, break, span, )
@@ -180,7 +182,7 @@
in recourse
-chopAtRun :: (Eq a) => (a -> Bool) -> [a] -> [[a]]
+chopAtRun :: (a -> Bool) -> [a] -> [[a]]
chopAtRun p =
let recourse [] = [[]]
recourse y =
@@ -193,7 +195,10 @@
Like 'break', but splits after the matching element.
-}
breakAfter :: (a -> Bool) -> [a] -> ([a], [a])
-breakAfter p =
+breakAfter = breakAfterRec
+
+breakAfterRec :: (a -> Bool) -> [a] -> ([a], [a])
+breakAfterRec p =
let recourse [] = ([],[])
recourse (x:xs) =
mapFst (x:) $
@@ -202,6 +207,38 @@
else recourse xs
in forcePair . recourse
+{-
+The use of 'foldr' might allow for fusion,
+but unfortunately this simple implementation would copy the tail of the list.
+-}
+breakAfterFoldr :: (a -> Bool) -> [a] -> ([a], [a])
+breakAfterFoldr p =
+ forcePair .
+ foldr
+ (\x yzs -> mapFst (x:) $ if p x then ([], uncurry (++) yzs) else yzs)
+ ([],[])
+
+breakAfterBreak :: (a -> Bool) -> [a] -> ([a], [a])
+breakAfterBreak p xs =
+ case break p xs of
+ (ys, []) -> (ys, [])
+ (ys, z:zs) -> (ys++[z], zs)
+
+breakAfterTakeUntil :: (a -> Bool) -> [a] -> ([a], [a])
+breakAfterTakeUntil p xs =
+ forcePair $
+ (\ys -> (map fst ys, maybe [] (snd . snd) $ viewR ys)) $
+ takeUntil (p . fst) $ zip xs $ tail $ tails xs
+
+{- |
+Take all elements until one matches.
+The matching element is returned, too.
+This is the key difference to @takeWhile (not . p)@.
+It holds @takeUntil p xs == fst (breakAfter p xs)@.
+-}
+takeUntil :: (a -> Bool) -> [a] -> [a]
+takeUntil p = foldr (\x ys -> x : if p x then [] else ys) []
+
{- |
Split the list after each occurence of a terminator.
@@ -452,43 +489,39 @@
dropRev :: Int -> [a] -> [a]
dropRev n xs = Match.take (drop n xs) xs
-
{- |
-Remove the longest suffix of elements satisfying p.
-In contrast to @reverse . dropWhile p . reverse@
-this works for infinite lists, too.
+@splitAtRev n xs == (dropRev n xs, takeRev n xs)@.
+It holds @xs == uncurry (++) (splitAtRev n xs)@
-}
+splitAtRev :: Int -> [a] -> ([a], [a])
+splitAtRev n xs = Match.splitAt (drop n xs) xs
+
+
dropWhileRev :: (a -> Bool) -> [a] -> [a]
dropWhileRev p =
- foldr (\x xs -> if p x && null xs then [] else x:xs) []
-
-dropWhileRev' :: (a -> Bool) -> [a] -> [a]
-dropWhileRev' p =
concat . init . segmentAfter (not . p)
-{- |
-Alternative version of @reverse . takeWhile p . reverse@.
--}
-takeWhileRev :: (a -> Bool) -> [a] -> [a]
-takeWhileRev p =
+takeWhileRev0 :: (a -> Bool) -> [a] -> [a]
+takeWhileRev0 p =
last . segmentAfter (not . p)
{- |
Doesn't seem to be superior to the naive implementation.
-}
-takeWhileRev' :: (a -> Bool) -> [a] -> [a]
-takeWhileRev' p =
- (\xs -> if fst (head xs)
- then map snd xs
- else []) .
- last . Key.aux groupBy (==) p
+takeWhileRev1 :: (a -> Bool) -> [a] -> [a]
+takeWhileRev1 p =
+ (\mx ->
+ case mx of
+ Just (_, xs@((True,_):_)) -> map snd xs
+ _ -> []) .
+ viewR . Key.aux groupBy (==) p
{- |
However it is more inefficient,
because of repeatedly appending single elements. :-(
-}
-takeWhileRev'' :: (a -> Bool) -> [a] -> [a]
-takeWhileRev'' p =
+takeWhileRev2 :: (a -> Bool) -> [a] -> [a]
+takeWhileRev2 p =
foldl (\xs x -> if p x then xs++[x] else []) []
@@ -498,12 +531,18 @@
@maybePrefixOf xs ys@ is @Just zs@ if @xs@ is a prefix of @ys@,
where @zs@ is @ys@ without the prefix @xs@.
Otherwise it is @Nothing@.
+It is the same as 'Data.List.stripPrefix'.
-}
maybePrefixOf :: Eq a => [a] -> [a] -> Maybe [a]
maybePrefixOf (x:xs) (y:ys) = guard (x==y) >> maybePrefixOf xs ys
maybePrefixOf [] ys = Just ys
maybePrefixOf _ [] = Nothing
+maybeSuffixOf :: Eq a => [a] -> [a] -> Maybe [a]
+maybeSuffixOf xs ys =
+ fmap reverse $ maybePrefixOf (reverse xs) (reverse ys)
+
+
{- |
Partition a list into elements which evaluate to @Just@ or @Nothing@ by @f@.
@@ -699,7 +738,7 @@
transposeFill =
unfoldr (\xs ->
toMaybe (not (null xs))
- (mapSnd (dropWhileRev null) $ unzipCons xs))
+ (mapSnd (Rev.dropWhile null) $ unzipCons xs))
unzipCons :: [[a]] -> ([Maybe a], [[a]])
unzipCons =
@@ -732,7 +771,7 @@
zipConc (a:as) (b:bs) = (a++b) : zipConc as bs
zipConc [] bs = bs
zipConc as [] = as
- in y : zipConc ys (shear' (dropWhileRev null zs))
+ in y : zipConc ys (shear' (Rev.dropWhile null zs))
{- Dropping trailing empty lists is necessary,
otherwise finite lists are filled with empty lists. -}
shear' [] = []
@@ -947,6 +986,13 @@
mapAdjacent f xs = zipWith f xs (tail xs)
{- |
+<http://mail.haskell.org/libraries/2016-April/026912.html>
+-}
+mapAdjacentPointfree :: (a -> a -> b) -> [a] -> [b]
+mapAdjacentPointfree f = zipWith f <*> tail
+
+
+{- |
> mapAdjacent f a0 [(a1,b1), (a2,b2), (a3,b3)]
> ==
> [f a0 a1 b1, f a1 a2 b2, f a2 a3 b3]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/List/HT.hs new/utility-ht-0.0.12/src/Data/List/HT.hs
--- old/utility-ht-0.0.11/src/Data/List/HT.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/List/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -11,6 +11,7 @@
-- * Split
L.chop,
L.breakAfter,
+ L.takeUntil,
L.segmentAfter,
L.segmentBefore,
L.segmentAfterMaybe,
@@ -26,10 +27,12 @@
-- * List processing starting at the end
L.dropRev,
L.takeRev,
- L.dropWhileRev,
- L.takeWhileRev,
+ L.splitAtRev,
+ dropWhileRev,
+ takeWhileRev,
-- * List processing with Maybe and Either
L.maybePrefixOf,
+ L.maybeSuffixOf,
L.partitionMaybe,
L.takeWhileJust,
L.unzipEithers,
@@ -63,3 +66,12 @@
) where
import qualified Data.List.HT.Private as L
+import qualified Data.List.Reverse.StrictElement as Rev
+
+{-# DEPRECATED dropWhileRev "Use dropWhile from Data.List.Reverse.StrictElement or Data.List.Reverse.StrictSpine instead" #-}
+dropWhileRev :: (a -> Bool) -> [a] -> [a]
+dropWhileRev = Rev.dropWhile
+
+{-# DEPRECATED takeWhileRev "Use takeWhile from Data.List.Reverse.StrictElement or Data.List.Reverse.StrictSpine instead" #-}
+takeWhileRev :: (a -> Bool) -> [a] -> [a]
+takeWhileRev = Rev.takeWhile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/List/Reverse/StrictElement.hs new/utility-ht-0.0.12/src/Data/List/Reverse/StrictElement.hs
--- old/utility-ht-0.0.11/src/Data/List/Reverse/StrictElement.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Data/List/Reverse/StrictElement.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,44 @@
+{- |
+The functions in this module process the list formally from the end.
+Actually they traverse the list from the start and check every element.
+This way they are strict in the elements and lazy in the list spline.
+Thus you can apply them to infinite lists.
+Use these functions if the list is long or the test is cheap.
+-}
+module Data.List.Reverse.StrictElement where
+
+import Data.Tuple.HT (mapFst, mapSnd, forcePair, )
+
+import Prelude hiding (dropWhile, takeWhile, span, )
+
+
+{- |
+Remove the longest suffix of elements satisfying p.
+In contrast to @reverse . dropWhile p . reverse@
+this works for infinite lists, too.
+-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+dropWhile p =
+ foldr (\x xs -> if p x && null xs then [] else x:xs) []
+
+{- |
+Alternative version of @reverse . takeWhile p . reverse@.
+-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+takeWhile p =
+ snd .
+ foldr
+ (\x xys ->
+ (if p x && fst xys then mapSnd (x:) else mapFst (const False)) xys)
+ (True, [])
+
+{- |
+@span p xs == (dropWhile p xs, takeWhile p xs)@
+-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+span p =
+ forcePair .
+ foldr
+ (\x xys ->
+ (if p x && null (fst xys) then mapSnd else mapFst) (x:) xys)
+ ([], [])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/List/Reverse/StrictSpine.hs new/utility-ht-0.0.12/src/Data/List/Reverse/StrictSpine.hs
--- old/utility-ht-0.0.11/src/Data/List/Reverse/StrictSpine.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Data/List/Reverse/StrictSpine.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,41 @@
+{- |
+The functions in this module process the list from the end.
+They do not access elements at the beginning if not necessary.
+You can apply the function only to infinite lists.
+Use these functions if the list is short and the test is expensive.
+-}
+module Data.List.Reverse.StrictSpine where
+
+import Data.Tuple.HT (mapFst, mapSnd, forcePair, )
+
+import Prelude hiding (dropWhile, takeWhile, span, )
+
+
+{- |
+Like @reverse . List.dropWhile p . reverse@.
+-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+dropWhile p =
+ foldr (\x xs -> if null xs && p x then [] else x:xs) []
+
+{- |
+Like @reverse . List.takeWhile p . reverse@.
+-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+takeWhile p =
+ snd .
+ foldr
+ (\x xys ->
+ (if fst xys && p x then mapSnd (x:) else mapFst (const False)) xys)
+ (True, [])
+
+{- |
+@span p xs == (dropWhile p xs, takeWhile p xs)@
+-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+span p =
+ forcePair .
+ foldr
+ (\x xys ->
+ (if null (fst xys) && p x then mapSnd else mapFst) (x:) xys)
+ ([], [])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/String/HT.hs new/utility-ht-0.0.12/src/Data/String/HT.hs
--- old/utility-ht-0.0.11/src/Data/String/HT.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/String/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -1,8 +1,14 @@
module Data.String.HT where
+import qualified Data.List.Reverse.StrictSpine as Rev
import Data.Char (isSpace, )
-import Data.List.HT (dropWhileRev, )
--- | remove leading and trailing spaces
+{- |
+Remove leading and trailing spaces.
+
+We use spine strict 'Rev.dropWhile' instead of the element strict version.
+This is more efficient for finite 'String's because 'isSpace' is expensive.
+The downside is that 'trim' does not work for infinite 'String's.
+-}
trim :: String -> String
-trim = dropWhileRev isSpace . dropWhile isSpace
+trim = Rev.dropWhile isSpace . dropWhile isSpace
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/Tuple/HT.hs new/utility-ht-0.0.12/src/Data/Tuple/HT.hs
--- old/utility-ht-0.0.11/src/Data/Tuple/HT.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/Tuple/HT.hs 2016-09-01 19:19:05.000000000 +0200
@@ -4,6 +4,7 @@
mapFst,
mapSnd,
swap,
+ sortPair,
forcePair,
-- * Triple
@@ -36,3 +37,7 @@
{-# INLINE curry3 #-}
curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
curry3 f a b c = f (a,b,c)
+
+sortPair, _sortPairMinMax :: (Ord a) => (a,a) -> (a,a)
+sortPair (x,y) = if x<=y then (x,y) else (y,x)
+_sortPairMinMax (x,y) = (min x y, max x y)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/Tuple/Lazy.hs new/utility-ht-0.0.12/src/Data/Tuple/Lazy.hs
--- old/utility-ht-0.0.11/src/Data/Tuple/Lazy.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/Tuple/Lazy.hs 2016-09-01 19:19:05.000000000 +0200
@@ -15,12 +15,12 @@
where one variant is definitely better than the other one.
-}
{-
-Instead of lazy pattern matching with \code{(x,y)}
+Instead of lazy pattern matching with \code{(a,b)}
we may use \function{fst} and \function{snd}.
-}
{-# INLINE mapPair #-}
mapPair :: (a -> c, b -> d) -> (a,b) -> (c,d)
-mapPair ~(f,g) ~(x,y) = (f x, g y)
+mapPair ~(f,g) ~(a,b) = (f a, g b)
-- | 'Control.Arrow.first'
{-# INLINE mapFst #-}
@@ -32,21 +32,25 @@
mapSnd :: (b -> c) -> (a,b) -> (a,c)
mapSnd f ~(a,b) = (a, f b)
+{-# INLINE zipWithPair #-}
+zipWithPair :: (a -> c -> e, b -> d -> f) -> (a,b) -> (c,d) -> (e,f)
+zipWithPair ~(e,f) ~(a,b) ~(c,d) = (e a c, f b d)
+
{-# INLINE swap #-}
swap :: (a,b) -> (b,a)
-swap ~(x,y) = (y,x)
+swap ~(a,b) = (b,a)
{-# INLINE forcePair #-}
forcePair :: (a,b) -> (a,b)
-forcePair ~(x,y) = (x,y)
+forcePair ~(a,b) = (a,b)
-- * Triple
{-# INLINE mapTriple #-}
mapTriple :: (a -> d, b -> e, c -> f) -> (a,b,c) -> (d,e,f)
-mapTriple ~(f,g,h) ~(x,y,z) = (f x, g y, h z)
+mapTriple ~(f,g,h) ~(a,b,c) = (f a, g b, h c)
{-# INLINE mapFst3 #-}
mapFst3 :: (a -> d) -> (a,b,c) -> (d,b,c)
@@ -60,6 +64,11 @@
mapThd3 :: (c -> d) -> (a,b,c) -> (a,b,d)
mapThd3 f ~(a,b,c) = (a, b, f c)
+{-# INLINE zipWithTriple #-}
+zipWithTriple ::
+ (a -> d -> g, b -> e -> h, c -> f -> i) -> (a,b,c) -> (d,e,f) -> (g,h,i)
+zipWithTriple ~(g,h,i) ~(a,b,c) ~(d,e,f) = (g a d, h b e, i c f)
+
{-# INLINE uncurry3 #-}
uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d)
uncurry3 f ~(a,b,c) = f a b c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Data/Tuple/Strict.hs new/utility-ht-0.0.12/src/Data/Tuple/Strict.hs
--- old/utility-ht-0.0.11/src/Data/Tuple/Strict.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Data/Tuple/Strict.hs 2016-09-01 19:19:05.000000000 +0200
@@ -4,7 +4,7 @@
{-# INLINE mapPair #-}
mapPair :: (a -> c, b -> d) -> (a,b) -> (c,d)
-mapPair (f,g) (x,y) = (f x, g y)
+mapPair (f,g) (a,b) = (f a, g b)
{-# INLINE mapFst #-}
mapFst :: (a -> c) -> (a,b) -> (c,b)
@@ -14,17 +14,21 @@
mapSnd :: (b -> c) -> (a,b) -> (a,c)
mapSnd f (a,b) = (a, f b)
+{-# INLINE zipWithPair #-}
+zipWithPair :: (a -> c -> e, b -> d -> f) -> (a,b) -> (c,d) -> (e,f)
+zipWithPair (e,f) (a,b) (c,d) = (e a c, f b d)
+
{-# INLINE swap #-}
swap :: (a,b) -> (b,a)
-swap (x,y) = (y,x)
+swap (a,b) = (b,a)
-- * Triple
{-# INLINE mapTriple #-}
mapTriple :: (a -> d, b -> e, c -> f) -> (a,b,c) -> (d,e,f)
-mapTriple (f,g,h) (x,y,z) = (f x, g y, h z)
+mapTriple (f,g,h) (a,b,c) = (f a, g b, h c)
{-# INLINE mapFst3 #-}
mapFst3 :: (a -> d) -> (a,b,c) -> (d,b,c)
@@ -38,6 +42,11 @@
mapThd3 :: (c -> d) -> (a,b,c) -> (a,b,d)
mapThd3 f (a,b,c) = (a, b, f c)
+{-# INLINE zipWithTriple #-}
+zipWithTriple ::
+ (a -> d -> g, b -> e -> h, c -> f -> i) -> (a,b,c) -> (d,e,f) -> (g,h,i)
+zipWithTriple (g,h,i) (a,b,c) (d,e,f) = (g a d, h b e, i c f)
+
{-# INLINE uncurry3 #-}
uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d)
uncurry3 f (a,b,c) = f a b c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Test/Data/List/Reverse/StrictElement.hs new/utility-ht-0.0.12/src/Test/Data/List/Reverse/StrictElement.hs
--- old/utility-ht-0.0.11/src/Test/Data/List/Reverse/StrictElement.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Test/Data/List/Reverse/StrictElement.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,53 @@
+module Test.Data.List.Reverse.StrictElement where
+
+import qualified Data.List.Reverse.StrictElement as Rev
+import qualified Data.List as List
+import Data.Tuple.HT (mapPair, swap, )
+
+import Test.QuickCheck (Testable, quickCheck, )
+
+import Prelude hiding (takeWhile, dropWhile, span, )
+
+
+takeWhile :: (Ord a) => (a -> Bool) -> [a] -> Bool
+takeWhile p xs =
+ Rev.takeWhile p xs == reverse (List.takeWhile p (reverse xs))
+
+dropWhile :: (Ord a) => (a -> Bool) -> [a] -> Bool
+dropWhile p xs =
+ Rev.dropWhile p xs == reverse (List.dropWhile p (reverse xs))
+
+span :: (Ord a) => (a -> Bool) -> [a] -> Bool
+span p xs =
+ Rev.span p xs == swap (mapPair (reverse, reverse) (List.span p (reverse xs)))
+
+spanTakeDrop :: (Ord a) => (a -> Bool) -> [a] -> Bool
+spanTakeDrop p xs =
+ Rev.span p xs == (Rev.dropWhile p xs, Rev.takeWhile p xs)
+
+dropWhileInf :: (Ord a) => a -> [a] -> Bool
+dropWhileInf x xs =
+ let ys = List.take 1000 $ Rev.dropWhile (x/=) $ cycle $ x:xs
+ in ys==ys
+
+spanInf :: (Ord a) => a -> [a] -> Bool
+spanInf x xs =
+ let ys = List.take 1000 $ fst $ Rev.span (x/=) $ cycle $ x:xs
+ in ys==ys
+
+
+simple ::
+ (Testable test) =>
+ (Float -> [Float] -> test) -> IO ()
+simple = quickCheck
+
+
+tests :: [(String, IO ())]
+tests =
+ ("takeWhile", simple (\a -> takeWhile (a>=))) :
+ ("dropWhile", simple (\a -> dropWhile (a>=))) :
+ ("span", simple (\a -> span (a>=))) :
+ ("spanTakeDrop", simple (\a -> spanTakeDrop (a>=))) :
+ ("dropWhileInf", simple dropWhileInf) :
+ ("spanInf", simple spanInf) :
+ []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Test/Data/List/Reverse/StrictSpine.hs new/utility-ht-0.0.12/src/Test/Data/List/Reverse/StrictSpine.hs
--- old/utility-ht-0.0.11/src/Test/Data/List/Reverse/StrictSpine.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/utility-ht-0.0.12/src/Test/Data/List/Reverse/StrictSpine.hs 2016-09-01 19:19:05.000000000 +0200
@@ -0,0 +1,62 @@
+module Test.Data.List.Reverse.StrictSpine where
+
+import qualified Data.List.Reverse.StrictSpine as Rev
+import qualified Data.List.Match as Match
+import qualified Data.List as List
+import Data.Tuple.HT (mapFst, mapPair, swap, )
+
+import Test.QuickCheck (Testable, quickCheck, )
+
+import Prelude hiding (takeWhile, dropWhile, span, )
+
+
+takeWhile :: (Ord a) => (a -> Bool) -> [a] -> Bool
+takeWhile p xs =
+ Rev.takeWhile p xs == reverse (List.takeWhile p (reverse xs))
+
+dropWhile :: (Ord a) => (a -> Bool) -> [a] -> Bool
+dropWhile p xs =
+ Rev.dropWhile p xs == reverse (List.dropWhile p (reverse xs))
+
+span :: (Ord a) => (a -> Bool) -> [a] -> Bool
+span p xs =
+ Rev.span p xs == swap (mapPair (reverse, reverse) (List.span p (reverse xs)))
+
+spanTakeDrop :: (Ord a) => (a -> Bool) -> [a] -> Bool
+spanTakeDrop p xs =
+ Rev.span p xs == (Rev.dropWhile p xs, Rev.takeWhile p xs)
+
+takeWhileBottom :: (Ord a) => a -> [a] -> [a] -> Bool
+takeWhileBottom x xs pad =
+ let ys = Rev.takeWhile (x/=) $ Match.replicate pad undefined ++ x:xs
+ in ys==ys
+
+dropWhileBottom :: (Ord a) => a -> [a] -> [a] -> Bool
+dropWhileBottom x xs pad =
+ let n = length $ Rev.dropWhile (x/=) $ Match.replicate pad undefined ++ x:xs
+ in n==n
+
+spanBottom :: (Ord a) => a -> [a] -> [a] -> Bool
+spanBottom x xs pad =
+ let (n,ys) =
+ mapFst length $ Rev.span (x/=) $
+ Match.replicate pad undefined ++ x:xs
+ in n==n && ys==ys
+
+
+simple ::
+ (Testable test) =>
+ (Float -> [Float] -> test) -> IO ()
+simple = quickCheck
+
+
+tests :: [(String, IO ())]
+tests =
+ ("takeWhile", simple (\a -> takeWhile (a>=))) :
+ ("dropWhile", simple (\a -> dropWhile (a>=))) :
+ ("span", simple (\a -> span (a>=))) :
+ ("spanTakeDrop", simple (\a -> spanTakeDrop (a>=))) :
+ ("takeWhileBottom", simple takeWhileBottom) :
+ ("dropWhileBottom", simple dropWhileBottom) :
+ ("spanBottom", simple spanBottom) :
+ []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Test/Data/List.hs new/utility-ht-0.0.12/src/Test/Data/List.hs
--- old/utility-ht-0.0.11/src/Test/Data/List.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Test/Data/List.hs 2016-09-01 19:19:05.000000000 +0200
@@ -1,5 +1,6 @@
module Test.Data.List where
+import qualified Data.List.Reverse.StrictElement as Rev
import qualified Data.List.HT.Private as ListHT
import qualified Data.List as List
import Control.Monad (liftM2, )
@@ -11,13 +12,21 @@
-takeWhileRev :: (Ord a) => (a -> Bool) -> [a] -> Bool
-takeWhileRev p xs =
- ListHT.takeWhileRev p xs == reverse (takeWhile p (reverse xs))
+takeWhileRev0 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+takeWhileRev0 p xs =
+ ListHT.takeWhileRev0 p xs == Rev.takeWhile p xs
+
+takeWhileRev1 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+takeWhileRev1 p xs =
+ ListHT.takeWhileRev1 p xs == Rev.takeWhile p xs
+
+takeWhileRev2 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+takeWhileRev2 p xs =
+ ListHT.takeWhileRev2 p xs == Rev.takeWhile p xs
-dropWhileRev :: (Ord a) => (a -> Bool) -> [a] -> Bool
+dropWhileRev :: (Eq a) => (a -> Bool) -> [a] -> Bool
dropWhileRev p xs =
- ListHT.dropWhileRev p xs == reverse (dropWhile p (reverse xs))
+ ListHT.dropWhileRev p xs == Rev.dropWhile p xs
takeRev :: (Eq a) => Int -> [a] -> Bool
@@ -28,6 +37,31 @@
dropRev n xs =
ListHT.dropRev n xs == reverse (drop n (reverse xs))
+splitAtRev :: (Eq a) => Int -> [a] -> Bool
+splitAtRev n xs =
+ xs == uncurry (++) (ListHT.splitAtRev n xs)
+
+
+breakAfterAppend :: (Eq a) => (a -> Bool) -> [a] -> Bool
+breakAfterAppend p xs =
+ uncurry (++) (ListHT.breakAfter p xs) == xs
+
+breakAfter0 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+breakAfter0 p xs =
+ ListHT.breakAfterRec p xs == ListHT.breakAfterFoldr p xs
+
+breakAfter1 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+breakAfter1 p xs =
+ ListHT.breakAfterRec p xs == ListHT.breakAfterBreak p xs
+
+breakAfter2 :: (Eq a) => (a -> Bool) -> [a] -> Bool
+breakAfter2 p xs =
+ ListHT.breakAfterRec p xs == ListHT.breakAfterTakeUntil p xs
+
+breakAfterUntil :: (Eq a) => (a -> Bool) -> [a] -> Bool
+breakAfterUntil p xs =
+ ListHT.takeUntil p xs == fst (ListHT.breakAfter p xs)
+
sieve :: Eq a => Int -> [a] -> Property
sieve n x =
@@ -84,19 +118,36 @@
mapAdjacent x xs =
ListHT.mapAdjacent subtract (scanl (+) x xs) == xs
+mapAdjacentPointfree :: (Num a, Eq a) => [a] -> Bool
+mapAdjacentPointfree xs =
+ ListHT.mapAdjacent (+) xs == ListHT.mapAdjacentPointfree (+) xs
+
simple ::
(Testable test) =>
(Int -> [Integer] -> test) -> IO ()
simple = quickCheck
+elemCheck ::
+ (Testable test) =>
+ (Float -> [Float] -> test) -> IO ()
+elemCheck = quickCheck
+
tests :: [(String, IO ())]
tests =
- ("takeWhileRev", quickCheck (\a -> takeWhileRev ((a::Integer)>=))) :
- ("dropWhileRev", quickCheck (\a -> dropWhileRev ((a::Integer)>=))) :
+ ("takeWhileRev0", elemCheck (\a -> takeWhileRev0 (a>=))) :
+ ("takeWhileRev1", elemCheck (\a -> takeWhileRev1 (a>=))) :
+ ("takeWhileRev2", elemCheck (\a -> takeWhileRev2 (a>=))) :
+ ("dropWhileRev", elemCheck (\a -> dropWhileRev (a>=))) :
("takeRev", simple takeRev) :
("dropRev", simple dropRev) :
+ ("splitAtRev", simple splitAtRev) :
+ ("breakAfterAppend", elemCheck (\a -> breakAfterAppend (a>=))) :
+ ("breakAfter0", elemCheck (\a -> breakAfter0 (a>=))) :
+ ("breakAfter1", elemCheck (\a -> breakAfter1 (a>=))) :
+ ("breakAfter2", elemCheck (\a -> breakAfter2 (a>=))) :
+ ("breakAfterUntil", elemCheck (\a -> breakAfterUntil (a>=))) :
("sieve", simple sieve) :
("sliceHorizontal", simple sliceHorizontal) :
("sliceVertical", simple sliceVertical) :
@@ -105,4 +156,6 @@
("outerProduct", quickCheck (outerProduct :: [Integer] -> [Int] -> Bool)) :
("iterate", quickCheck (iterate (+) :: Integer -> Bool)) :
("mapAdjacent", quickCheck (mapAdjacent :: Integer -> [Integer] -> Bool)) :
+ ("mapAdjacentPointfree",
+ quickCheck (mapAdjacentPointfree :: [Integer] -> Bool)) :
[]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/src/Test.hs new/utility-ht-0.0.12/src/Test.hs
--- old/utility-ht-0.0.11/src/Test.hs 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/src/Test.hs 2016-09-01 19:19:05.000000000 +0200
@@ -1,5 +1,7 @@
module Main where
+import qualified Test.Data.List.Reverse.StrictElement as RevElem
+import qualified Test.Data.List.Reverse.StrictSpine as RevSpine
import qualified Test.Data.List as ListHT
import qualified Test.Data.ListMatch as ListMatch
import qualified Test.Data.Maybe as MaybeHT
@@ -14,6 +16,8 @@
main =
mapM_ (\(msg,io) -> putStr (msg++": ") >> io) $
concat $
+ prefix "ReverseSpine" RevSpine.tests :
+ prefix "ReverseElem" RevElem.tests :
prefix "List" ListHT.tests :
prefix "ListMatch" ListMatch.tests :
prefix "Maybe" MaybeHT.tests :
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/utility-ht-0.0.11/utility-ht.cabal new/utility-ht-0.0.12/utility-ht.cabal
--- old/utility-ht-0.0.11/utility-ht.cabal 2015-08-19 15:11:14.000000000 +0200
+++ new/utility-ht-0.0.12/utility-ht.cabal 2016-09-01 19:19:05.000000000 +0200
@@ -1,5 +1,5 @@
Name: utility-ht
-Version: 0.0.11
+Version: 0.0.12
License: BSD3
License-File: LICENSE
Author: Henning Thielemann <haskell(a)henning-thielemann.de>
@@ -27,6 +27,7 @@
Tested-With: GHC==7.0.2, GHC==7.2.2, GHC==7.4.1, GHC==7.8.2
Cabal-Version: >=1.10
Build-Type: Simple
+Stability: Stable
-- workaround for Cabal-1.10
Extra-Source-Files:
@@ -44,7 +45,7 @@
Source-Repository this
type: darcs
location: http://code.haskell.org/~thielema/utility/
- tag: 0.0.11
+ tag: 0.0.12
Library
Build-Depends:
@@ -54,6 +55,7 @@
GHC-Options: -Wall
Hs-Source-Dirs: src
Exposed-Modules:
+ Data.Bits.HT
Data.Bool.HT
Data.Eq.HT
Data.Function.HT
@@ -61,6 +63,8 @@
Data.List.HT
Data.List.Key
Data.List.Match
+ Data.List.Reverse.StrictElement
+ Data.List.Reverse.StrictSpine
Data.Maybe.HT
Data.Monoid.HT
Data.Ord.HT
@@ -70,6 +74,7 @@
Data.Tuple.Lazy
Data.Tuple.Strict
Control.Monad.HT
+ Control.Applicative.HT
Control.Functor.HT
Data.Strictness.HT
Text.Read.HT
@@ -96,6 +101,8 @@
Other-Modules:
Test.Data.List
Test.Data.ListMatch
+ Test.Data.List.Reverse.StrictElement
+ Test.Data.List.Reverse.StrictSpine
Test.Data.Maybe
Test.Data.Function
Test.Utility
[View Less]
1
0
Hello community,
here is the log from the commit of package ghc-uri-bytestring for openSUSE:Factory checked in at 2017-01-31 12:40:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-uri-bytestring (Old)
and /work/SRC/openSUSE:Factory/.ghc-uri-bytestring.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-uri-bytestring"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-…
[View More]uri-bytestring/ghc-uri-bytestring.changes 2017-01-18 21:38:07.131878951 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-uri-bytestring.new/ghc-uri-bytestring.changes 2017-02-03 17:40:25.261602617 +0100
@@ -1,0 +2,10 @@
+Tue Nov 29 11:31:01 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.2.2.1 with cabal2obs.
+
+-------------------------------------------------------------------
+Wed Aug 17 18:24:02 UTC 2016 - psimons(a)suse.com
+
+- Update to version 0.2.2.0 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
uri-bytestring-0.2.1.2.tar.gz
New:
----
uri-bytestring-0.2.2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-uri-bytestring.spec ++++++
--- /var/tmp/diff_new_pack.CZODRS/_old 2017-02-03 17:40:25.669544876 +0100
+++ /var/tmp/diff_new_pack.CZODRS/_new 2017-02-03 17:40:25.677543744 +0100
@@ -19,15 +19,14 @@
%global pkg_name uri-bytestring
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.1.2
+Version: 0.2.2.1
Release: 0
Summary: Haskell URI parsing as ByteStrings
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-attoparsec-devel
BuildRequires: ghc-blaze-builder-devel
BuildRequires: ghc-bytestring-devel
@@ -37,7 +36,7 @@
%if %{with tests}
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-QuickCheck-devel
-BuildRequires: ghc-derive-devel
+BuildRequires: ghc-generics-sop-devel
BuildRequires: ghc-lens-simple-devel
BuildRequires: ghc-quickcheck-instances-devel
BuildRequires: ghc-semigroups-devel
@@ -45,7 +44,6 @@
BuildRequires: ghc-tasty-hunit-devel
BuildRequires: ghc-tasty-quickcheck-devel
%endif
-# End cabal-rpm deps
%description
Uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient
@@ -65,20 +63,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
++++++ uri-bytestring-0.2.1.2.tar.gz -> uri-bytestring-0.2.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/README.md new/uri-bytestring-0.2.2.1/README.md
--- old/uri-bytestring-0.2.1.2/README.md 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/README.md 2016-11-23 20:55:10.000000000 +0100
@@ -13,3 +13,4 @@
* [Timo von Holtz](http://github.com/tvh)
* [Brendan Hay](http://github.com/brendanhay)
* [k0ral](https://github.com/k0ral)
+* [Michael Hatfield](https://github.com/mikehat)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/changelog.md new/uri-bytestring-0.2.2.1/changelog.md
--- old/uri-bytestring-0.2.1.2/changelog.md 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/changelog.md 2016-11-23 20:55:10.000000000 +0100
@@ -1,3 +1,10 @@
+0.2.2.1
+* Drop dependency on derive in tests.
+
+0.2.2.0
+* Internally use attoparsec's numeric parser. Raise lower bounds on attoparsec.
+* Allow blank fragments.
+
0.2.1.2
* Fixed bug introduced at 0.2.1.1 where RelativeRefs would fail to serialize their port numbers.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/src/URI/ByteString/Internal.hs new/uri-bytestring-0.2.2.1/src/URI/ByteString/Internal.hs
--- old/uri-bytestring-0.2.1.2/src/URI/ByteString/Internal.hs 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/src/URI/ByteString/Internal.hs 2016-11-23 20:55:10.000000000 +0100
@@ -13,6 +13,7 @@
import Control.Monad
import Data.Attoparsec.ByteString
import qualified Data.Attoparsec.ByteString as A
+import qualified Data.Attoparsec.ByteString.Char8 as A ( decimal )
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
@@ -512,12 +513,12 @@
, dot
, decOctet]
where
+ decOctet :: Parser ByteString
decOctet = do
- s <- A.takeWhile1 isDigit
+ (s,num) <- A.match A.decimal
let len = BS.length s
- guard $ len > 0 && len <= 3
- let num = bsToNum s
- guard $ num >= 1 && num <= 255
+ guard $ len <= 3
+ guard $ num >= (1 :: Int) && num <= 255
return s
dot = string "."
@@ -540,7 +541,7 @@
-- | Parses port number from the hostname. Colon separator must be
-- handled elsewhere.
portParser :: URIParser Port
-portParser = (Port . bsToNum <$> A.takeWhile1 isDigit) `orFailWith` MalformedPort
+portParser = (Port <$> A.decimal) `orFailWith` MalformedPort
-------------------------------------------------------------------------------
@@ -620,13 +621,13 @@
-------------------------------------------------------------------------------
-- | Only parses a fragment if the # signifiier is there
mFragmentParser :: URIParser (Maybe ByteString)
-mFragmentParser = word8' hash `thenJust` fragmentParser
+mFragmentParser = mParse $ word8' hash *> fragmentParser
-------------------------------------------------------------------------------
-- | The final piece of a uri, e.g. #fragment, minus the #.
fragmentParser :: URIParser ByteString
-fragmentParser = A.takeWhile1 validFragmentWord `orFailWith` MalformedFragment
+fragmentParser = Parser' $ A.takeWhile validFragmentWord
where
validFragmentWord = inClass ('?':'/':pchar)
@@ -755,17 +756,6 @@
-- | ByteString Utilities
-------------------------------------------------------------------------------
--- FIXME: theres probably a much better way to do this
-
--------------------------------------------------------------------------------
--- | Convert a bytestring into an int representation. Assumes the
--- entire string is comprised of 0-9 digits.
-bsToNum :: ByteString -> Int
-bsToNum s = sum $ zipWith (*) (reverse ints) [10 ^ x | x <- [0..] :: [Int]]
- where
- w2i w = fromEnum $ w - 48
- ints = map w2i . BS.unpack $ s
-
-------------------------------------------------------------------------------
-- | Decoding specifically for the query string, which decodes + as
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/test/URI/ByteString/Arbitrary.hs new/uri-bytestring-0.2.2.1/test/URI/ByteString/Arbitrary.hs
--- old/uri-bytestring-0.2.1.2/test/URI/ByteString/Arbitrary.hs 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/test/URI/ByteString/Arbitrary.hs 2016-11-23 20:55:10.000000000 +0100
@@ -1,13 +1,16 @@
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module URI.ByteString.Arbitrary where
-------------------------------------------------------------------------------
import Control.Applicative
-import Data.Derive.Arbitrary (makeArbitrary)
-import Data.DeriveTH (derive)
+import Data.Proxy (Proxy (..))
+import qualified Generics.SOP as SOP
+import qualified Generics.SOP.GGP as SOP
+import GHC.Generics (Generic)
import Test.QuickCheck
import Test.QuickCheck.Instances ()
-------------------------------------------------------------------------------
@@ -17,6 +20,19 @@
-------------------------------------------------------------------------------
+-- this workaround can go away when
+-- <https://github.com/nick8325/quickcheck/pull/40> is merged.
+sopArbitrary :: (Generic a, SOP.GTo a, SOP.All SOP.SListI (SOP.GCode a), SOP.All2 Arbitrary (SOP.GCode a)) => Gen a
+sopArbitrary = fmap SOP.gto sopArbitrary'
+
+
+sopArbitrary' :: (SOP.All SOP.SListI xss, SOP.All2 Arbitrary xss) => Gen (SOP.SOP SOP.I xss)
+sopArbitrary' = oneof (map SOP.hsequence $ SOP.apInjs_POP $ SOP.hcpure p arbitrary)
+ where
+ p :: Proxy Arbitrary
+ p = Proxy
+
+
instance Arbitrary UserInfo where
arbitrary = UserInfo <$> arbitrary
<*> arbitrary
@@ -73,5 +89,12 @@
<*> arbitrary
<*> arbitrary
-$(derive makeArbitrary ''SchemaError)
-$(derive makeArbitrary ''URIParseError)
+
+instance Arbitrary SchemaError where
+ arbitrary = sopArbitrary
+ shrink = genericShrink
+
+
+instance Arbitrary URIParseError where
+ arbitrary = sopArbitrary
+ shrink = genericShrink
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/test/URI/ByteStringTests.hs new/uri-bytestring-0.2.2.1/test/URI/ByteStringTests.hs
--- old/uri-bytestring-0.2.1.2/test/URI/ByteStringTests.hs 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/test/URI/ByteStringTests.hs 2016-11-23 20:55:10.000000000 +0100
@@ -91,6 +91,12 @@
"/foo"
mempty
(Just "bar")
+ , testParses "http://www.example.org/foo#" $
+ URI (Scheme "http")
+ (Just (Authority Nothing (Host "www.example.org") Nothing))
+ "/foo"
+ mempty
+ (Just "")
, testParseFailure "http://www.example.org/foo#bar#baz" MalformedFragment
, testParseFailure "https://www.example.org?listParam[]=foo,bar" MalformedQuery
, testParsesLax "https://www.example.org?listParam[]=foo,bar" $
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.1.2/uri-bytestring.cabal new/uri-bytestring-0.2.2.1/uri-bytestring.cabal
--- old/uri-bytestring-0.2.1.2/uri-bytestring.cabal 2016-06-25 01:14:33.000000000 +0200
+++ new/uri-bytestring-0.2.2.1/uri-bytestring.cabal 2016-11-23 20:55:10.000000000 +0100
@@ -1,5 +1,5 @@
name: uri-bytestring
-version: 0.2.1.2
+version: 0.2.2.1
synopsis: Haskell URI parsing as ByteStrings
description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data.
license: BSD3
@@ -36,7 +36,7 @@
build-depends:
- attoparsec >= 0.10 && < 0.14
+ attoparsec >= 0.12 && < 0.14
, base >= 4.6 && < 4.10
, bytestring >= 0.9.1 && < 0.11
, blaze-builder >= 0.3.0.0 && < 0.5
@@ -67,7 +67,6 @@
, tasty
, tasty-hunit
, tasty-quickcheck
- , derive
, attoparsec
, base
, blaze-builder
@@ -76,6 +75,7 @@
, quickcheck-instances
, semigroups
, containers
+ , generics-sop >= 0.2
default-language: Haskell2010
if flag(lib-Werror)
[View Less]
1
0