openSUSE Commits
Threads by month
- ----- 2024 -----
- 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
January 2016
- 1 participants
- 1523 discussions
Hello community,
here is the log from the commit of package ghc-http2 for openSUSE:Factory checked in at 2016-01-28 17:23:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http2 (Old)
and /work/SRC/openSUSE:Factory/.ghc-http2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http2/ghc-http2.changes 2016-01-07 00:25:22.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-http2.new/ghc-http2.changes 2016-01-28 17:24:44.000000000 +0100
@@ -1,0 +2,18 @@
+Fri Jan 22 10:05:24 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 1.4.4
+* Fixing a bug of reverse index.
+
+-------------------------------------------------------------------
+Wed Jan 20 09:47:10 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 1.4.3
+* Using proper baseDeficit for deletion.
+* Test files are now self-contained.
+* The reverse indices for static and dynamic are combined for performance.
+* Providing dequeueSTM, isEmpty and isEmptySTM. Users can compose their own control
+ queue with dequeueSTM and isEmptySTM.
+* Removing enqueueControl: it appeared that PriorityTree is not suitable for
+ control frames.
+
+-------------------------------------------------------------------
Old:
----
http2-1.3.1.tar.gz
New:
----
http2-1.4.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http2.spec ++++++
--- /var/tmp/diff_new_pack.u08V0N/_old 2016-01-28 17:24:45.000000000 +0100
+++ /var/tmp/diff_new_pack.u08V0N/_new 2016-01-28 17:24:45.000000000 +0100
@@ -20,7 +20,7 @@
%bcond_with tests
Name: ghc-http2
-Version: 1.3.1
+Version: 1.4.4
Release: 0
Summary: HTTP/2.0 library including frames and HPACK
Group: System/Libraries
++++++ http2-1.3.1.tar.gz -> http2-1.4.4.tar.gz ++++++
++++ 1522626 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package ghc-http-client for openSUSE:Factory checked in at 2016-01-28 17:23:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-client (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-client.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-client"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-client/ghc-http-client.changes 2015-12-29 12:59:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-http-client.new/ghc-http-client.changes 2016-01-28 17:24:43.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Jan 22 08:59:09 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.4.27
+* Enable managerModifyRequest to modify checkStatus
+
+-------------------------------------------------------------------
Old:
----
http-client-0.4.26.2.tar.gz
New:
----
http-client-0.4.27.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-client.spec ++++++
--- /var/tmp/diff_new_pack.HZxxgF/_old 2016-01-28 17:24:44.000000000 +0100
+++ /var/tmp/diff_new_pack.HZxxgF/_new 2016-01-28 17:24:44.000000000 +0100
@@ -21,7 +21,7 @@
%bcond_with tests
Name: ghc-http-client
-Version: 0.4.26.2
+Version: 0.4.27
Release: 0
Summary: HTTP client engine, intended as a base layer
License: MIT
++++++ http-client-0.4.26.2.tar.gz -> http-client-0.4.27.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.26.2/ChangeLog.md new/http-client-0.4.27/ChangeLog.md
--- old/http-client-0.4.26.2/ChangeLog.md 2015-12-22 18:46:34.000000000 +0100
+++ new/http-client-0.4.27/ChangeLog.md 2016-01-21 08:59:31.000000000 +0100
@@ -1,3 +1,7 @@
+## 0.4.27
+
+* Enable managerModifyRequest to modify checkStatus [#179](https://github.com/snoyberg/http-client/pull/179)
+
## 0.4.26.2
* Fix compilation for GHC 7.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.26.2/Network/HTTP/Client/Core.hs new/http-client-0.4.27/Network/HTTP/Client/Core.hs
--- old/http-client-0.4.26.2/Network/HTTP/Client/Core.hs 2015-12-22 18:46:34.000000000 +0100
+++ new/http-client-0.4.27/Network/HTTP/Client/Core.hs 2016-01-21 08:59:31.000000000 +0100
@@ -6,10 +6,12 @@
, httpLbs
, httpNoBody
, httpRaw
+ , httpRaw'
, responseOpen
, responseClose
, applyCheckStatus
, httpRedirect
+ , httpRedirect'
) where
#if !MIN_VERSION_base(4,6,0)
@@ -22,6 +24,7 @@
import Network.HTTP.Client.Request
import Network.HTTP.Client.Response
import Network.HTTP.Client.Cookies
+import Data.Maybe (fromMaybe, isJust)
import Data.Time
import Control.Exception
import qualified Data.ByteString as S
@@ -69,12 +72,22 @@
httpNoBody :: Request -> Manager -> IO (Response ())
httpNoBody req man = withResponse req man $ return . void
+
-- | Get a 'Response' without any redirect following.
httpRaw
:: Request
-> Manager
-> IO (Response BodyReader)
-httpRaw req0 m = do
+httpRaw = fmap (fmap snd) . httpRaw'
+
+-- | Get a 'Response' without any redirect following.
+--
+-- This extended version of 'httpRaw' also returns the Request potentially modified by @managerModifyRequest@.
+httpRaw'
+ :: Request
+ -> Manager
+ -> IO (Request, Response BodyReader)
+httpRaw' req0 m = do
req' <- mModifyRequest m $ mSetProxy m req0
(req, cookie_jar') <- case cookieJar req' of
Just cj -> do
@@ -100,7 +113,8 @@
-- Connection was reused, and might have been closed. Try again
(Left e, Reused) | mRetryableException m e -> do
connRelease DontReuse
- responseOpen req m
+ res <- responseOpen req m
+ return (req, res)
-- Not reused, or a non-retry, so this is a real exception
(Left e, _) -> throwIO e
-- Everything went ok, so the connection is good. If any exceptions get
@@ -109,8 +123,8 @@
Just _ -> do
now' <- getCurrentTime
let (cookie_jar, _) = updateCookieJar res req now' cookie_jar'
- return $ res {responseCookieJar = cookie_jar}
- Nothing -> return res
+ return (req, res {responseCookieJar = cookie_jar})
+ Nothing -> return (req, res)
where
responseTimeout' req
@@ -150,21 +164,21 @@
-- Since 0.1.0
responseOpen :: Request -> Manager -> IO (Response BodyReader)
responseOpen req0 manager = handle addTlsHostPort $ mWrapIOException manager $ do
- res <-
+ (req, res) <-
if redirectCount req0 == 0
- then httpRaw req0 manager
+ then httpRaw' req0 manager
else go (redirectCount req0) req0
- maybe (return res) throwIO =<< applyCheckStatus req0 (checkStatus req0) res
+ maybe (return res) throwIO =<< applyCheckStatus req (checkStatus req) res
where
addTlsHostPort (TlsException e) = throwIO $ TlsExceptionHostPort e (host req0) (port req0)
addTlsHostPort e = throwIO e
- go count req' = httpRedirect
+ go count req' = httpRedirect'
count
(\req -> do
- res <- httpRaw req manager
- let mreq = getRedirectedRequest req (responseHeaders res) (responseCookieJar res) (statusCode (responseStatus res))
- return (res, mreq))
+ (req'', res) <- httpRaw' req manager
+ let mreq = getRedirectedRequest req'' (responseHeaders res) (responseCookieJar res) (statusCode (responseStatus res))
+ return (res, fromMaybe req'' mreq, isJust mreq))
req'
-- | Apply 'Request'\'s 'checkStatus' and return resulting exception if any.
@@ -202,34 +216,49 @@
toStrict' = S.concat . L.toChunks
#endif
--- | Redirect loop
+-- | Redirect loop.
httpRedirect
:: Int -- ^ 'redirectCount'
-> (Request -> IO (Response BodyReader, Maybe Request)) -- ^ function which performs a request and returns a response, and possibly another request if there's a redirect.
-> Request
-> IO (Response BodyReader)
-httpRedirect count0 http' req0 = go count0 req0 []
+httpRedirect count0 http0 req0 = fmap snd $ httpRedirect' count0 http' req0
+ where
+ -- adapt callback API
+ http' req' = do
+ (res, mbReq) <- http0 req'
+ return (res, fromMaybe req0 mbReq, isJust mbReq)
+
+-- | Redirect loop.
+--
+-- This extended version of 'httpRaw' also returns the Request potentially modified by @managerModifyRequest@.
+httpRedirect'
+ :: Int -- ^ 'redirectCount'
+ -> (Request -> IO (Response BodyReader, Request, Bool)) -- ^ function which performs a request and returns a response, the potentially modified request, and a Bool indicating if there was a redirect.
+ -> Request
+ -> IO (Request, Response BodyReader)
+httpRedirect' count0 http' req0 = go count0 req0 []
where
go count _ ress | count < 0 = throwIO $ TooManyRedirects ress
go count req' ress = do
- (res, mreq) <- http' req'
- case mreq of
- Just req -> do
- -- Allow the original connection to return to the
- -- connection pool immediately by flushing the body.
- -- If the response body is too large, don't flush, but
- -- instead just close the connection.
- let maxFlush = 1024
- lbs <- brReadSome (responseBody res) maxFlush
- -- The connection may already be closed, e.g.
- -- when using withResponseHistory. See
- -- https://github.com/snoyberg/http-client/issues/169
- `catch` \(_ :: ConnectionClosed) -> return L.empty
- responseClose res
-
- -- And now perform the actual redirect
- go (count - 1) req (res { responseBody = lbs }:ress)
- Nothing -> return res
+ (res, req, isRedirect) <- http' req'
+ if isRedirect then do
+ -- Allow the original connection to return to the
+ -- connection pool immediately by flushing the body.
+ -- If the response body is too large, don't flush, but
+ -- instead just close the connection.
+ let maxFlush = 1024
+ lbs <- brReadSome (responseBody res) maxFlush
+ -- The connection may already be closed, e.g.
+ -- when using withResponseHistory. See
+ -- https://github.com/snoyberg/http-client/issues/169
+ `catch` \(_ :: ConnectionClosed) -> return L.empty
+ responseClose res
+
+ -- And now perform the actual redirect
+ go (count - 1) req (res { responseBody = lbs }:ress)
+ else
+ return (req, res)
-- | Close any open resources associated with the given @Response@. In general,
-- this will either close an active @Connection@ or return it to the @Manager@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.26.2/Network/HTTP/Client.hs new/http-client-0.4.27/Network/HTTP/Client.hs
--- old/http-client-0.4.26.2/Network/HTTP/Client.hs 2015-12-22 18:46:34.000000000 +0100
+++ new/http-client-0.4.27/Network/HTTP/Client.hs 2016-01-21 08:59:31.000000000 +0100
@@ -215,19 +215,19 @@
reqRef <- newIORef req0
historyRef <- newIORef id
let go req = do
- res <- httpRaw req man
+ (req', res) <- httpRaw' req man
case getRedirectedRequest
- req
+ req'
(responseHeaders res)
(responseCookieJar res)
(statusCode $ responseStatus res) of
- Nothing -> return (res, Nothing)
- Just req' -> do
- writeIORef reqRef req'
+ Nothing -> return (res, req', False)
+ Just req'' -> do
+ writeIORef reqRef req''
body <- brReadSome (responseBody res) 1024
modifyIORef historyRef (. ((req, res { responseBody = body }):))
- return (res, Just req')
- res <- httpRedirect (redirectCount req0) go req0
+ return (res, req'', True)
+ (_, res) <- httpRedirect' (redirectCount req0) go req0
reqFinal <- readIORef reqRef
history <- readIORef historyRef
return HistoriedResponse
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.26.2/http-client.cabal new/http-client-0.4.27/http-client.cabal
--- old/http-client-0.4.26.2/http-client.cabal 2015-12-22 18:46:34.000000000 +0100
+++ new/http-client-0.4.27/http-client.cabal 2016-01-21 08:59:31.000000000 +0100
@@ -1,5 +1,5 @@
name: http-client
-version: 0.4.26.2
+version: 0.4.27
synopsis: An HTTP client engine, intended as a base layer for more user-friendly packages.
description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/http-client>.
homepage: https://github.com/snoyberg/http-client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.26.2/test/Network/HTTP/ClientSpec.hs new/http-client-0.4.27/test/Network/HTTP/ClientSpec.hs
--- old/http-client-0.4.26.2/test/Network/HTTP/ClientSpec.hs 2015-12-22 18:46:34.000000000 +0100
+++ new/http-client-0.4.27/test/Network/HTTP/ClientSpec.hs 2016-01-21 08:59:31.000000000 +0100
@@ -1,6 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Network.HTTP.ClientSpec where
+import Control.Exception (toException)
import Network (withSocketsDo)
import Network.HTTP.Client
import Network.HTTP.Types (status200)
@@ -24,3 +25,9 @@
withManager settings $ \man -> do
res <- httpLbs "http://httpbin.org:1234" man
responseStatus res `shouldBe` status200
+
+ it "managerModifyRequestCheckStatus" $ do
+ let modify req = return req { checkStatus = \s hs cj -> Just $ toException $ StatusCodeException s hs cj }
+ settings = defaultManagerSettings { managerModifyRequest = modify }
+ withManager settings $ \man ->
+ httpLbs "http://httpbin.org" man `shouldThrow` anyException
1
0
Hello community,
here is the log from the commit of package ghc-HTTP for openSUSE:Factory checked in at 2016-01-28 17:23:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-HTTP (Old)
and /work/SRC/openSUSE:Factory/.ghc-HTTP.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-HTTP"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-HTTP/ghc-HTTP.changes 2016-01-08 15:23:02.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-HTTP.new/ghc-HTTP.changes 2016-01-28 17:24:42.000000000 +0100
@@ -1,0 +2,19 @@
+Sun Jan 24 10:04:26 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 4000.3.2
+* If the URI contains "user:pass@" part, use it for Basic Authorization
+* Add a test harness.
+* Don't leak a socket when getHostAddr throws an exception.
+* Send cookies in request format, not response format.
+* Moved BrowserAction to be a StateT IO, with instances for
+ Applicative, MonadIO, MonadState.
+* Add method to control size of connection pool.
+* Consider both host and port when reusing connections.
+* Handle response code 304 "not modified" properly.
+* Fix digest authentication by fixing md5 output string rep.
+* Make the default user agent string follow the package version.
+* Document lack of HTTPS support and fail when clients try
+ to use it instead of silently falling back to HTTP.
+* Add helper to set the request type and body.
+
+-------------------------------------------------------------------
Old:
----
HTTP-4000.2.23.tar.gz
New:
----
HTTP-4000.3.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-HTTP.spec ++++++
--- /var/tmp/diff_new_pack.GyTEkh/_old 2016-01-28 17:24:43.000000000 +0100
+++ /var/tmp/diff_new_pack.GyTEkh/_new 2016-01-28 17:24:43.000000000 +0100
@@ -19,7 +19,7 @@
%global pkg_name HTTP
Name: ghc-HTTP
-Version: 4000.2.23
+Version: 4000.3.2
Release: 0
Summary: A library for client-side HTTP
License: BSD-3-Clause
@@ -37,7 +37,7 @@
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-network-devel
BuildRequires: ghc-network-uri-devel
-BuildRequires: ghc-old-time-devel
+BuildRequires: ghc-time-devel
BuildRequires: ghc-parsec-devel
# End cabal-rpm deps
++++++ HTTP-4000.2.23.tar.gz -> HTTP-4000.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.23/HTTP.cabal new/HTTP-4000.3.2/HTTP.cabal
--- old/HTTP-4000.2.23/HTTP.cabal 2015-12-31 23:33:18.000000000 +0100
+++ new/HTTP-4000.3.2/HTTP.cabal 2016-01-16 09:57:23.000000000 +0100
@@ -1,5 +1,5 @@
Name: HTTP
-Version: 4000.2.23
+Version: 4000.3.2
Cabal-Version: >= 1.8
Build-type: Simple
License: BSD3
@@ -99,7 +99,8 @@
-- note the test harness constraints should be kept in sync with these
-- where dependencies are shared
Build-depends: base >= 4.3.0.0 && < 4.9, parsec >= 2.0 && < 3.2
- Build-depends: array >= 0.3.0.2 && < 0.6, old-time >= 1.0.0.0 && < 1.2, bytestring >= 0.9.1.5 && < 0.11
+ Build-depends: array >= 0.3.0.2 && < 0.6, bytestring >= 0.9.1.5 && < 0.11
+ Build-depends: time >= 1.1.2.3 && < 1.7
Extensions: FlexibleInstances
@@ -114,8 +115,6 @@
else
Build-depends: network >= 2.2.1.8 && < 2.6
- build-tools: ghc >= 7.0 && < 7.12
-
if flag(warn-as-error)
ghc-options: -Werror
@@ -125,8 +124,6 @@
Test-Suite test
type: exitcode-stdio-1.0
- build-tools: ghc >= 7.0 && < 7.12
-
hs-source-dirs: test
main-is: httpTests.hs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.23/Network/Browser.hs new/HTTP-4000.3.2/Network/Browser.hs
--- old/HTTP-4000.2.23/Network/Browser.hs 2015-12-31 23:33:18.000000000 +0100
+++ new/HTTP-4000.3.2/Network/Browser.hs 2016-01-16 09:57:23.000000000 +0100
@@ -149,7 +149,7 @@
( hSetBuffering, hPutStr, stdout, stdin, hGetChar
, BufferMode(NoBuffering, LineBuffering)
)
-import System.Time ( ClockTime, getClockTime )
+import Data.Time.Clock ( UTCTime, getCurrentTime )
------------------------------------------------------------------
@@ -638,7 +638,7 @@
-- at which they occurred.
data BrowserEvent
= BrowserEvent
- { browserTimestamp :: ClockTime
+ { browserTimestamp :: UTCTime
, browserRequestID :: RequestID
, browserRequestURI :: {-URI-}String
, browserEventType :: BrowserEventType
@@ -668,7 +668,7 @@
buildBrowserEvent :: BrowserEventType -> {-URI-}String -> RequestID -> IO BrowserEvent
buildBrowserEvent bt uri reqID = do
- ct <- getClockTime
+ ct <- getCurrentTime
return BrowserEvent
{ browserTimestamp = ct
, browserRequestID = reqID
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.23/Network/TCP.hs new/HTTP-4000.3.2/Network/TCP.hs
--- old/HTTP-4000.2.23/Network/TCP.hs 2015-12-31 23:33:18.000000000 +0100
+++ new/HTTP-4000.3.2/Network/TCP.hs 2016-01-16 09:57:23.000000000 +0100
@@ -306,14 +306,7 @@
-- and that the connection peer matches the given
-- host name (which is recorded locally).
isConnectedTo :: Connection -> EndPoint -> IO Bool
-isConnectedTo (Connection conn) endPoint = do
- v <- readMVar (getRef conn)
- case v of
- ConnClosed -> print "aa" >> return False
- _
- | connEndPoint v == endPoint ->
- catchIO (getPeerName (connSock v) >> return True) (const $ return False)
- | otherwise -> return False
+isConnectedTo (Connection conn) endPoint = isTCPConnectedTo conn endPoint
isTCPConnectedTo :: HandleStream ty -> EndPoint -> IO Bool
isTCPConnectedTo conn endPoint = do
1
0
Hello community,
here is the log from the commit of package clinfo for openSUSE:Factory checked in at 2016-01-28 17:23:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/clinfo (Old)
and /work/SRC/openSUSE:Factory/.clinfo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "clinfo"
Changes:
--------
--- /work/SRC/openSUSE:Factory/clinfo/clinfo.changes 2016-01-08 15:23:46.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.clinfo.new/clinfo.changes 2016-01-28 17:24:41.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Jan 26 08:44:01 UTC 2016 - mpluskal(a)suse.com
+
+- Update to 2.1.16.01.12
+ * no upstream changelog provided
+
+-------------------------------------------------------------------
Old:
----
clinfo-2.1.16.01.06.tar.gz
New:
----
clinfo-2.1.16.01.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ clinfo.spec ++++++
--- /var/tmp/diff_new_pack.63rQk2/_old 2016-01-28 17:24:42.000000000 +0100
+++ /var/tmp/diff_new_pack.63rQk2/_new 2016-01-28 17:24:42.000000000 +0100
@@ -18,7 +18,7 @@
Name: clinfo
-Version: 2.1.16.01.06
+Version: 2.1.16.01.12
Release: 0
Summary: It reports status information for all installed OpenCL ICDs
License: SUSE-Public-Domain
@@ -45,15 +45,13 @@
make %{?_smp_mflags}
%install
-mkdir -p %{buildroot}/%{_bindir}
-mkdir -p %{buildroot}/%{_mandir}/man1/
-install -pm 0755 clinfo %{buildroot}/%{_bindir}
-install -pm 0644 man/clinfo.1 %{buildroot}/%{_mandir}/man1
+install -D -p -m 0755 clinfo %{buildroot}%{_bindir}/clinfo
+install -D -p -m 0644 man/clinfo.1 %{buildroot}%{_mandir}/man1/clinfo.1
%files
%defattr (-,root,root)
%doc LICENSE README
%{_bindir}/clinfo
-%{_mandir}/man1/clinfo.1.*
+%{_mandir}/man1/clinfo.1%{ext_man}
%changelog
++++++ clinfo-2.1.16.01.06.tar.gz -> clinfo-2.1.16.01.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clinfo-2.1.16.01.06/man/clinfo.1 new/clinfo-2.1.16.01.12/man/clinfo.1
--- old/clinfo-2.1.16.01.06/man/clinfo.1 2016-01-06 12:07:55.000000000 +0100
+++ new/clinfo-2.1.16.01.12/man/clinfo.1 2016-01-12 11:51:23.000000000 +0100
@@ -1,4 +1,4 @@
-.TH CLINFO 1 "2016-01-06" "clinfo 2.1.16.01.06"
+.TH CLINFO 1 "2016-01-12" "clinfo 2.1.16.01.12"
.SH NAME
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clinfo-2.1.16.01.06/src/clinfo.c new/clinfo-2.1.16.01.12/src/clinfo.c
--- old/clinfo-2.1.16.01.06/src/clinfo.c 2016-01-06 12:07:55.000000000 +0100
+++ new/clinfo-2.1.16.01.12/src/clinfo.c 2016-01-12 11:51:23.000000000 +0100
@@ -880,8 +880,9 @@
time_t time = val/UINT64_C(1000000000);
szval += snprintf(strbuf, bufsz, "%" PRIu64 "ns (", val);
szval += bufcpy(szval, ctime(&time));
+ /* overwrite ctime's newline with the closing parenthesis */
if (szval < bufsz)
- strbuf[szval] = ')';
+ strbuf[szval - 1] = ')';
}
show_strbuf(pname, 0);
return had_error;
@@ -2483,6 +2484,8 @@
const char *pname; // "ICD loader *"
};
+static const char * const oclicdl_pfx = "OCLICD";
+
#define LINFO(symbol, name) { symbol, #symbol, "ICD loader " name }
struct icdl_info_traits linfo_traits[] = {
LINFO(CL_ICDL_NAME, "Name"),
@@ -2541,9 +2544,18 @@
#endif
if (clGetICDLoaderInfoOCLICD != NULL) {
- puts("\nICD loader properties");
+ /* TODO think of a sensible header in CLINFO_RAW */
+ if (output_mode != CLINFO_RAW)
+ puts("\nICD loader properties");
current_function = __func__;
+ if (output_mode == CLINFO_RAW) {
+ line_pfx_len = strlen(oclicdl_pfx) + 5;
+ REALLOC(line_pfx, line_pfx_len, "line prefix OCL ICD");
+ sprintf(strbuf, "[%s/*]", oclicdl_pfx);
+ sprintf(line_pfx, "%*s", -line_pfx_len, strbuf);
+ }
+
for (current_line = 0; current_line < ARRAY_SIZE(linfo_traits); ++current_line) {
const struct icdl_info_traits *traits = linfo_traits + current_line;
current_param = traits->sname;
@@ -2586,7 +2598,7 @@
void version(void)
{
- puts("clinfo version 2.1.16.01.06");
+ puts("clinfo version 2.1.16.01.12");
}
void usage(void)
@@ -2674,7 +2686,8 @@
listPlatformsAndDevices(show_offline);
} else {
showDevices(show_offline);
- checkNullBehavior();
+ if (output_mode != CLINFO_RAW)
+ checkNullBehavior();
oclIcdProps();
}
1
0
Hello community,
here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2016-01-28 17:23:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes 2016-01-22 01:09:55.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2016-01-28 17:24:40.000000000 +0100
@@ -1,0 +2,18 @@
+Mon Jan 25 16:55:00 UTC 2016 - coolo(a)suse.com
+
+- updated to 6.42
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 6.42 2016-01-24
+ - Fixed use of deprecated Perl feature in Mojo::JSON.
+ - Fixed validation filter bugs in Mojolicious::Validator::Validation.
+
+ 6.41 2016-01-20
+ - Added support for validation filters.
+ - Added filters attribute to Mojolicious::Validator.
+ - Added add_filter method to Mojolicious::Validator.
+ - Added filter arguments to optional and required methods in
+ Mojolicious::Validator::Validation.
+ - Fixed MOJO_WEBSOCKET_DEBUG environment variable. (jberger)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-6.40.tar.gz
New:
----
Mojolicious-6.42.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.COY4ue/_old 2016-01-28 17:24:41.000000000 +0100
+++ /var/tmp/diff_new_pack.COY4ue/_new 2016-01-28 17:24:41.000000000 +0100
@@ -17,7 +17,7 @@
Name: perl-Mojolicious
-Version: 6.40
+Version: 6.42
Release: 0
%define cpan_name Mojolicious
Summary: Real-time web framework
++++++ Mojolicious-6.40.tar.gz -> Mojolicious-6.42.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/Changes new/Mojolicious-6.42/Changes
--- old/Mojolicious-6.40/Changes 2016-01-13 19:13:50.000000000 +0100
+++ new/Mojolicious-6.42/Changes 2016-01-24 23:00:27.000000000 +0100
@@ -1,4 +1,16 @@
+6.42 2016-01-24
+ - Fixed use of deprecated Perl feature in Mojo::JSON.
+ - Fixed validation filter bugs in Mojolicious::Validator::Validation.
+
+6.41 2016-01-20
+ - Added support for validation filters.
+ - Added filters attribute to Mojolicious::Validator.
+ - Added add_filter method to Mojolicious::Validator.
+ - Added filter arguments to optional and required methods in
+ Mojolicious::Validator::Validation.
+ - Fixed MOJO_WEBSOCKET_DEBUG environment variable. (jberger)
+
6.40 2016-01-13
- Removed client_challenge, client_handshake, server_handshake and server_open
methods from Mojo::Transaction::WebSocket. (batman, sri)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/META.json new/Mojolicious-6.42/META.json
--- old/Mojolicious-6.40/META.json 2016-01-13 21:07:28.000000000 +0100
+++ new/Mojolicious-6.42/META.json 2016-01-24 23:01:37.000000000 +0100
@@ -58,5 +58,5 @@
},
"x_IRC" : "irc://irc.perl.org/#mojo"
},
- "version" : "6.40"
+ "version" : "6.42"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/META.yml new/Mojolicious-6.42/META.yml
--- old/Mojolicious-6.40/META.yml 2016-01-13 21:07:28.000000000 +0100
+++ new/Mojolicious-6.42/META.yml 2016-01-24 23:01:37.000000000 +0100
@@ -31,4 +31,4 @@
homepage: http://mojolicious.org
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/kraih/mojo.git
-version: '6.40'
+version: '6.42'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/README.md new/Mojolicious-6.42/README.md
--- old/Mojolicious-6.40/README.md 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/README.md 2016-01-24 04:33:27.000000000 +0100
@@ -11,23 +11,25 @@
## Features
- * An amazing real-time web framework, allowing you to easily grow single
+ * An amazing **real-time web framework**, allowing you to easily grow single
file prototypes into well-structured web applications.
* Powerful out of the box with RESTful routes, plugins, commands, Perl-ish
templates, content negotiation, session management, form validation,
testing framework, static file server, CGI/[PSGI](http://plackperl.org)
detection, first class Unicode support and much more for you to
discover.
+ * A powerful **web development toolkit**, that you can use for all kinds of
+ applications, independently of the web framework.
+ * Full stack HTTP and WebSocket client/server implementation with IPv6, TLS,
+ SNI, IDNA, HTTP/SOCKS5 proxy, Comet (long polling), keep-alive, connection
+ pooling, timeout, cookie, multipart, and gzip compression support.
+ * Built-in non-blocking I/O web server, supporting multiple event loops as
+ well as optional preforking and hot deployment, perfect for building
+ highly scalable web services.
+ * JSON and HTML/XML parser with CSS selector support.
* Very clean, portable and object-oriented pure-Perl API with no hidden
magic and no requirements besides Perl 5.22.0 (versions as old as 5.10.1
can be used too, but may require additional CPAN modules to be installed)
- * Full stack HTTP and WebSocket client/server implementation with IPv6, TLS,
- SNI, IDNA, HTTP/SOCKS5 proxy, Comet (long polling), keep-alive, connection
- pooling, timeout, cookie, multipart, and gzip compression support.
- * Built-in non-blocking I/O web server, supporting multiple event loops as
- well as optional preforking and hot deployment, perfect for building
- highly scalable web services.
- * JSON and HTML/XML parser with CSS selector support.
* Fresh code based upon years of experience developing
[Catalyst](http://www.catalystframework.org), free and open source.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Base.pm new/Mojolicious-6.42/lib/Mojo/Base.pm
--- old/Mojolicious-6.40/lib/Mojo/Base.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Base.pm 2016-01-19 19:23:42.000000000 +0100
@@ -115,7 +115,7 @@
use Mojo::Base -base;
has name => 'Nyan';
- has [qw(age weight)] => 4;
+ has ['age', 'weight'] => 4;
package Tiger;
use Mojo::Base 'Cat';
@@ -181,11 +181,11 @@
=head2 has
has 'name';
- has [qw(name1 name2 name3)];
+ has ['name1', 'name2', 'name3'];
has name => 'foo';
has name => sub {...};
- has [qw(name1 name2 name3)] => 'foo';
- has [qw(name1 name2 name3)] => sub {...};
+ has ['name1', 'name2', 'name3'] => 'foo';
+ has ['name1', 'name2', 'name3'] => sub {...};
Create attributes for hash-based objects, just like the L</"attr"> method.
@@ -197,11 +197,11 @@
$object->attr('name');
SubClass->attr('name');
- SubClass->attr([qw(name1 name2 name3)]);
+ SubClass->attr(['name1', 'name2', 'name3']);
SubClass->attr(name => 'foo');
SubClass->attr(name => sub {...});
- SubClass->attr([qw(name1 name2 name3)] => 'foo');
- SubClass->attr([qw(name1 name2 name3)] => sub {...});
+ SubClass->attr(['name1', 'name2', 'name3'] => 'foo');
+ SubClass->attr(['name1', 'name2', 'name3'] => sub {...});
Create attribute accessor for hash-based objects, an array reference can be
used to create more than one at a time. Pass an optional second argument to set
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Headers.pm new/Mojolicious-6.42/lib/Mojo/Headers.pm
--- old/Mojolicious-6.40/lib/Mojo/Headers.pm 2016-01-13 18:52:30.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Headers.pm 2016-01-23 01:38:17.000000000 +0100
@@ -482,7 +482,7 @@
my $names = $headers->names;
-Return a list of all currently defined headers.
+Return an array reference with all currently defined headers.
# Names of all headers
say for @{$headers->names};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/IOLoop/Delay.pm new/Mojolicious-6.42/lib/Mojo/IOLoop/Delay.pm
--- old/Mojolicious-6.40/lib/Mojo/IOLoop/Delay.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/IOLoop/Delay.pm 2016-01-19 19:37:41.000000000 +0100
@@ -224,8 +224,8 @@
my $hash = $delay->data;
my $foo = $delay->data('foo');
- $delay = $delay->data({foo => 'bar'});
- $delay = $delay->data(foo => 'bar');
+ $delay = $delay->data({foo => 'bar', baz => 23});
+ $delay = $delay->data(foo => 'bar', baz => 23);
Data shared between all L</"steps">.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/JSON.pm new/Mojolicious-6.42/lib/Mojo/JSON.pm
--- old/Mojolicious-6.40/lib/Mojo/JSON.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/JSON.pm 2016-01-24 19:03:27.000000000 +0100
@@ -1,6 +1,7 @@
package Mojo::JSON;
use Mojo::Base -strict;
+use B;
use Carp 'croak';
use Exporter 'import';
use JSON::PP ();
@@ -248,10 +249,9 @@
# Null
return 'null' unless defined $value;
- # Number (bitwise operators change behavior based on the internal value type)
- my $check = (my $dummy = "0") & $value;
+ # Number
return $value
- if (!($check ^ $check) && length $check)
+ if B::svref_2object(\$value)->FLAGS & (B::SVp_IOK | B::SVp_NOK)
&& 0 + $value eq $value
&& $value * 0 == 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Parameters.pm new/Mojolicious-6.42/lib/Mojo/Parameters.pm
--- old/Mojolicious-6.40/lib/Mojo/Parameters.pm 2016-01-13 19:03:30.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Parameters.pm 2016-01-23 01:38:38.000000000 +0100
@@ -283,7 +283,7 @@
my $names = $params->names;
-Return a list of all parameter names.
+Return an array reference with all parameter names.
# Names of all parameters
say for @{$params->names};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Server/Daemon.pm new/Mojolicious-6.42/lib/Mojo/Server/Daemon.pm
--- old/Mojolicious-6.40/lib/Mojo/Server/Daemon.pm 2016-01-13 07:05:52.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Server/Daemon.pm 2016-01-19 19:28:55.000000000 +0100
@@ -364,7 +364,7 @@
$daemon->listen(['http://*:8080?reuse=1']);
# Listen on two ports with HTTP and HTTPS at the same time
- $daemon->listen([qw(http://*:3000 https://*:4000)]);
+ $daemon->listen(['http://*:3000', 'https://*:4000']);
# Use a custom certificate and key
$daemon->listen(['https://*:3000?cert=/x/server.crt&key=/y/server.key']);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Transaction/HTTP.pm new/Mojolicious-6.42/lib/Mojo/Transaction/HTTP.pm
--- old/Mojolicious-6.40/lib/Mojo/Transaction/HTTP.pm 2016-01-13 18:56:08.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Transaction/HTTP.pm 2016-01-23 01:39:01.000000000 +0100
@@ -305,8 +305,8 @@
my $redirects = $tx->redirects;
-Return a list of all previous transactions that preceded this follow-up
-transaction.
+Return an array reference with all previous transactions that preceded this
+follow-up transaction.
# Paths of all previous requests
say $_->req->url->path for @{$tx->redirects};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/Transaction/WebSocket.pm new/Mojolicious-6.42/lib/Mojo/Transaction/WebSocket.pm
--- old/Mojolicious-6.40/lib/Mojo/Transaction/WebSocket.pm 2016-01-13 18:57:55.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/Transaction/WebSocket.pm 2016-01-19 20:32:28.000000000 +0100
@@ -136,8 +136,8 @@
my $self = shift;
my %protos = map { trim($_) => 1 } split ',',
- $self->req->headers->sec_websocket_protocol;
- return undef unless my $proto = first { $protos{$_} } @_;
+ $self->req->headers->sec_websocket_protocol // '';
+ return undef unless defined(my $proto = first { $protos{$_} } @_);
$self->res->headers->sec_websocket_protocol($proto);
return $proto;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/UserAgent/Proxy.pm new/Mojolicious-6.42/lib/Mojo/UserAgent/Proxy.pm
--- old/Mojolicious-6.40/lib/Mojo/UserAgent/Proxy.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/UserAgent/Proxy.pm 2016-01-19 19:28:23.000000000 +0100
@@ -75,7 +75,7 @@
=head2 not
my $not = $proxy->not;
- $proxy = $proxy->not([qw(localhost intranet.mojolicious.org)]);
+ $proxy = $proxy->not(['localhost', 'intranet.mojolicious.org']);
Domains that don't require a proxy server to be used.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/UserAgent/Transactor.pm new/Mojolicious-6.42/lib/Mojo/UserAgent/Transactor.pm
--- old/Mojolicious-6.40/lib/Mojo/UserAgent/Transactor.pm 2016-01-12 21:25:33.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/UserAgent/Transactor.pm 2016-01-19 19:28:02.000000000 +0100
@@ -114,8 +114,8 @@
# Generator
if (@_ > 1) {
- return $tx unless my $generator = $self->generators->{shift()};
- $self->$generator($tx, @_);
+ my $cb = $self->generators->{shift()};
+ $self->$cb($tx, @_);
}
# Body
@@ -328,6 +328,11 @@
Register a content generator.
+ $t->add_generator(foo => sub {
+ my ($t, $tx, @args) = @_;
+ ...
+ });
+
=head2 endpoint
my ($proto, $host, $port) = $t->endpoint(Mojo::Transaction::HTTP->new);
@@ -411,7 +416,8 @@
An array reference can be used for multiple form values sharing the same name.
# POST request with form values sharing the same name
- my $tx = $t->tx(POST => 'http://example.com' => form => {a => [qw(b c d)]});
+ my $tx = $t->tx(
+ POST => 'http://example.com' => form => {a => ['b', 'c', 'd']});
A hash reference with a C<content> or C<file> value can be used to switch to
the C<multipart/form-data> content type for file uploads.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo/WebSocket.pm new/Mojolicious-6.42/lib/Mojo/WebSocket.pm
--- old/Mojolicious-6.40/lib/Mojo/WebSocket.pm 2016-01-13 18:57:11.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo/WebSocket.pm 2016-01-19 16:57:09.000000000 +0100
@@ -3,7 +3,7 @@
use Config;
use Exporter 'import';
-use Mojo::Util qw(b64_encode sha1_bytes xor_encode);
+use Mojo::Util qw(b64_encode dumper sha1_bytes xor_encode);
use constant DEBUG => $ENV{MOJO_WEBSOCKET_DEBUG} || 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojo.pm new/Mojolicious-6.42/lib/Mojo.pm
--- old/Mojolicious-6.40/lib/Mojo.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojo.pm 2016-01-24 06:10:28.000000000 +0100
@@ -31,7 +31,7 @@
=head1 NAME
-Mojo - Duct tape for the HTML5 web!
+Mojo - Web development toolkit
=head1 SYNOPSIS
@@ -58,9 +58,11 @@
=head1 DESCRIPTION
-A flexible runtime environment for Perl real-time web frameworks, with all the
-basic tools and helpers needed to write simple web applications and higher
-level web frameworks, such as L<Mojolicious>.
+A powerful web development toolkit, with all the basic tools and helpers needed
+to write simple web applications and higher level web frameworks, such as
+L<Mojolicious>. Some of the most commonly used tools are L<Mojo::UserAgent>,
+L<Mojo::DOM>, L<Mojo::JSON>, L<Mojo::Server::Daemon>, L<Mojo::Server::Prefork>,
+L<Mojo::IOLoop> and L<Mojo::Template>.
See L<Mojolicious::Guides> for more!
@@ -115,8 +117,8 @@
my $hash = $app->config;
my $foo = $app->config('foo');
- $app = $app->config({foo => 'bar'});
- $app = $app->config(foo => 'bar');
+ $app = $app->config({foo => 'bar', baz => 23});
+ $app = $app->config(foo => 'bar', baz => 23);
Application configuration.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Controller.pm new/Mojolicious-6.42/lib/Mojolicious/Controller.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Controller.pm 2016-01-12 21:50:53.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Controller.pm 2016-01-20 06:04:52.000000000 +0100
@@ -575,7 +575,7 @@
my $value = $c->param('foo');
$c = $c->param(foo => 'ba;r');
- $c = $c->param(foo => qw(ba;r baz));
+ $c = $c->param(foo => 'ba;r', 'baz');
$c = $c->param(foo => ['ba;r', 'baz']);
Access route placeholder values that are not reserved stash values, file
@@ -866,8 +866,8 @@
my $hash = $c->stash;
my $foo = $c->stash('foo');
- $c = $c->stash({foo => 'bar'});
- $c = $c->stash(foo => 'bar');
+ $c = $c->stash({foo => 'bar', baz => 23});
+ $c = $c->stash(foo => 'bar', baz => 23);
Non-persistent data storage and exchange for the current request, application
wide default values can be set with L<Mojolicious/"defaults">. Some stash
@@ -929,7 +929,7 @@
# Validate GET/POST parameter
my $validation = $c->validation;
- $validation->required('title')->size(3, 50);
+ $validation->required('title', 'trim')->size(3, 50);
my $title = $validation->param('title');
# Validate file upload
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Guides/Contributing.pod new/Mojolicious-6.42/lib/Mojolicious/Guides/Contributing.pod
--- old/Mojolicious-6.40/lib/Mojolicious/Guides/Contributing.pod 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Guides/Contributing.pod 2016-01-24 04:16:08.000000000 +0100
@@ -88,9 +88,9 @@
=head2 Mission statement
-L<Mojo> is a runtime environment for Perl real-time web frameworks. It provides
-all the basic tools and helpers needed to write simple web applications and
-higher level web frameworks, such as L<Mojolicious>.
+L<Mojo> is a web development toolkit, with all the basic tools and helpers
+needed to write simple web applications and higher level web frameworks, such as
+L<Mojolicious>.
All components should be reusable in other projects, and in a UNIXish way only
loosely coupled.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Guides/Rendering.pod new/Mojolicious-6.42/lib/Mojolicious/Guides/Rendering.pod
--- old/Mojolicious-6.40/lib/Mojolicious/Guides/Rendering.pod 2016-01-13 19:13:08.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Guides/Rendering.pod 2016-01-19 19:18:41.000000000 +0100
@@ -301,7 +301,7 @@
through the L<Mojolicious::Controller/"stash">.
$c->stash(description => 'web framework');
- $c->stash(frameworks => [qw(Catalyst Mojolicious)]);
+ $c->stash(frameworks => ['Catalyst', 'Mojolicious']);
$c->stash(spinoffs => {minion => 'job queue'});
%= $description
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Guides/Routing.pod new/Mojolicious-6.42/lib/Mojolicious/Guides/Routing.pod
--- old/Mojolicious-6.40/lib/Mojolicious/Guides/Routing.pod 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Guides/Routing.pod 2016-01-19 19:19:46.000000000 +0100
@@ -156,7 +156,7 @@
=head2 Minimal route
The attribute L<Mojolicious/"routes"> contains a router you can use to generate
-route structures, they match in the same order in which they were defined.
+route structures.
# Application
package MyApp;
@@ -175,7 +175,9 @@
1;
The minimal route above will load and instantiate the class
-C<MyApp::Controller::Foo> and call its C<welcome> method.
+C<MyApp::Controller::Foo> and call its C<welcome> method. Routes are usually
+configured in the C<startup> method of the application class, but the router can
+be accessed from everywhere (even at runtime).
# Controller
package MyApp::Controller::Foo;
@@ -191,8 +193,11 @@
1;
-Routes are usually configured in the C<startup> method of the application
-class, but the router can be accessed from everywhere (even at runtime).
+All routes match in the same order in which they were defined, and matching
+stops as soon as a suitable route has been found. So you can improve the routing
+performance by declaring your most frequently accessed routes first. A routing
+cache will also be used automatically to handle sudden traffic spikes more
+gracefully.
=head2 Routing destination
@@ -224,7 +229,7 @@
$r->post('/hello')->to(controller => 'foo', action => 'hello');
# GET|POST /bye -> {controller => 'foo', action => 'bye'}
- $r->any([qw(GET POST)] => '/bye')->to(controller => 'foo', action => 'bye');
+ $r->any(['GET', 'POST'] => '/bye')->to(controller => 'foo', action => 'bye');
# * /whatever -> {controller => 'foo', action => 'whatever'}
$r->any('/whatever')->to(controller => 'foo', action => 'whatever');
@@ -302,6 +307,10 @@
$cats->get('/nyan')->to(action => 'nyan');
$cats->get('/lol');
+With a few common prefixes you can also greatly improve the routing performance
+of applications with many routes, because children are only tried if the prefix
+matched first.
+
=head2 Special stash values
When the dispatcher sees C<controller> and C<action> values in the stash it
@@ -500,7 +509,7 @@
# /fry -> undef
# /bender -> {controller => 'foo', action => 'bar', name => 'bender'}
# /leela -> {controller => 'foo', action => 'bar', name => 'leela'}
- $r->get('/:name' => [name => [qw(bender leela)]])->to('foo#bar');
+ $r->get('/:name' => [name => ['bender', 'leela']])->to('foo#bar');
You can also adjust the regular expressions behind placeholders directly, just
make sure not to use C<^> and C<$> or capturing groups C<(...)>, because
@@ -595,7 +604,7 @@
# /foo.txt -> undef
# /foo.rss -> {controller => 'foo', action => 'bar', format => 'rss'}
# /foo.xml -> {controller => 'foo', action => 'bar', format => 'xml'}
- $r->get('/foo' => [format => [qw(rss xml)]])->to('foo#bar');
+ $r->get('/foo' => [format => ['rss', 'xml']])->to('foo#bar');
A C<format> value can also be passed to L<Mojolicious::Controller/"url_for">.
@@ -621,7 +630,7 @@
# /baz.xml -> undef
my $inactive = $r->under([format => 0]);
$inactive->get('/foo')->to('foo#bar');
- $inactive->get('/baz' => [format => [qw(txt html)]])->to('baz#yada');
+ $inactive->get('/baz' => [format => ['txt', 'html']])->to('baz#yada');
=head2 WebSockets
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Guides/Tutorial.pod new/Mojolicious-6.42/lib/Mojolicious/Guides/Tutorial.pod
--- old/Mojolicious-6.40/lib/Mojolicious/Guides/Tutorial.pod 2016-01-13 19:05:44.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Guides/Tutorial.pod 2016-01-19 19:20:21.000000000 +0100
@@ -7,7 +7,7 @@
=head1 TUTORIAL
-A quick example driven introduction to the wonders of L<Mojolicious::Lite>.
+A quick example-driven introduction to the wonders of L<Mojolicious::Lite>.
Almost everything you'll learn here also applies to full L<Mojolicious>
applications.
@@ -383,7 +383,7 @@
};
# GET|POST|PATCH /bye
- any [qw(GET POST PATCH)] => '/bye' => sub {
+ any ['GET', 'POST', 'PATCH'] => '/bye' => sub {
my $c = shift;
$c->render(text => 'Bye World!');
};
@@ -429,7 +429,7 @@
# /test
# /123
- any '/:foo' => [foo => [qw(test 123)]] => sub {
+ any '/:foo' => [foo => ['test', '123']] => sub {
my $c = shift;
my $foo = $c->param('foo');
$c->render(text => "Our :foo placeholder matched $foo");
@@ -581,7 +581,7 @@
# /hello.json
# /hello.txt
- get '/hello' => [format => [qw(json txt)]] => sub {
+ get '/hello' => [format => ['json', 'txt']] => sub {
my $c = shift;
return $c->render(json => {hello => 'world'})
if $c->stash('format') eq 'json';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Guides.pod new/Mojolicious-6.42/lib/Mojolicious/Guides.pod
--- old/Mojolicious-6.40/lib/Mojolicious/Guides.pod 2016-01-10 21:28:01.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Guides.pod 2016-01-24 04:19:02.000000000 +0100
@@ -84,9 +84,9 @@
=head1 HIGHLIGHTS
-L<Mojolicious> and L<Mojolicious::Lite> are the sum of many parts, small
-building blocks that can be used independently, these are the most prominent
-ones.
+L<Mojolicious> and L<Mojolicious::Lite> are the sum of many parts, built on top
+of the L<Mojo> web development toolkit. Small building blocks that can be used
+independently for all kinds of applications, these are the most prominent ones.
=over 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Lite.pm new/Mojolicious-6.42/lib/Mojolicious/Lite.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Lite.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Lite.pm 2016-01-19 19:26:47.000000000 +0100
@@ -96,8 +96,8 @@
my $route = any '/:foo' => sub {...};
my $route = any '/:foo' => {foo => 'bar'} => sub {...};
my $route = any '/:foo' => [foo => qr/\w+/] => sub {...};
- my $route = any [qw(GET POST)] => '/:foo' => sub {...};
- my $route = any [qw(GET POST)] => '/:foo' => [foo => qr/\w+/] => sub {...};
+ my $route = any ['GET', 'POST'] => '/:foo' => sub {...};
+ my $route = any ['GET', 'POST'] => '/:foo' => [foo => qr/\w+/] => sub {...};
Generate route with L<Mojolicious::Routes::Route/"any">, matching any of the
listed HTTP request methods or all. See also L<Mojolicious::Guides::Tutorial>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Plugin/DefaultHelpers.pm new/Mojolicious-6.42/lib/Mojolicious/Plugin/DefaultHelpers.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Plugin/DefaultHelpers.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Plugin/DefaultHelpers.pm 2016-01-19 19:26:20.000000000 +0100
@@ -219,7 +219,7 @@
=head2 c
- %= c(qw(a b c))->shuffle->join
+ %= c('a', 'b', 'c')->shuffle->join
Turn list into a L<Mojo::Collection> object.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Plugin/TagHelpers.pm new/Mojolicious-6.42/lib/Mojolicious/Plugin/TagHelpers.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Plugin/TagHelpers.pm 2016-01-13 18:54:26.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Plugin/TagHelpers.pm 2016-01-19 19:25:49.000000000 +0100
@@ -553,11 +553,11 @@
=head2 select_field
- %= select_field country => [qw(de en)]
+ %= select_field country => ['de', 'en']
%= select_field country => [[Germany => 'de'], 'en'], id => 'eu'
%= select_field country => [[Germany => 'de', selected => 'selected'], 'en']
%= select_field country => [c(EU => [[Germany => 'de'], 'en'], id => 'eu')]
- %= select_field country => [c(EU => [qw(de en)]), c(Asia => [qw(cn jp)])]
+ %= select_field country => [c(EU => ['de', 'en']), c(Asia => ['cn', 'jp'])]
Generate C<select> and C<option> tags from array references and C<optgroup>
tags from L<Mojo::Collection> objects. Previous input values will automatically
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Renderer.pm new/Mojolicious-6.42/lib/Mojolicious/Renderer.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Renderer.pm 2016-01-13 19:13:26.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Renderer.pm 2016-01-15 18:01:51.000000000 +0100
@@ -372,12 +372,23 @@
Register a handler.
+ $renderer->add_handler(foo => sub {
+ my ($renderer, $c, $output, $options) = @_;
+ ...
+ $$output = 'Hello World!';
+ });
+
=head2 add_helper
$renderer = $renderer->add_helper(url_for => sub {...});
Register a helper.
+ $renderer->add_helper(foo => sub {
+ my ($c, @args) = @_;
+ ...
+ });
+
=head2 get_data_template
my $template = $renderer->get_data_template({
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Routes/Route.pm new/Mojolicious-6.42/lib/Mojolicious/Routes/Route.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Routes/Route.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Routes/Route.pm 2016-01-19 19:21:37.000000000 +0100
@@ -302,8 +302,8 @@
my $route = $r->any('/:foo' => sub {...});
my $route = $r->any('/:foo' => {foo => 'bar'} => sub {...});
my $route = $r->any('/:foo' => [foo => qr/\w+/] => sub {...});
- my $route = $r->any([qw(GET POST)] => '/:foo' => sub {...});
- my $route = $r->any([qw(GET POST)] => '/:foo' => [foo => qr/\w+/]);
+ my $route = $r->any(['GET', 'POST'] => '/:foo' => sub {...});
+ my $route = $r->any(['GET', 'POST'] => '/:foo' => [foo => qr/\w+/]);
Generate L<Mojolicious::Routes::Route> object matching any of the listed HTTP
request methods or all. See also L<Mojolicious::Guides::Tutorial> for many more
@@ -564,14 +564,14 @@
my $methods = $r->via;
$r = $r->via('GET');
- $r = $r->via(qw(GET POST));
- $r = $r->via([qw(GET POST)]);
+ $r = $r->via('GET', 'POST');
+ $r = $r->via(['GET', 'POST']);
Restrict HTTP methods this route is allowed to handle, defaults to no
restrictions.
# Route with two methods and destination
- $r->route('/foo')->via(qw(GET POST))->to('foo#bar');
+ $r->route('/foo')->via('GET', 'POST')->to('foo#bar');
=head2 websocket
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Routes.pm new/Mojolicious-6.42/lib/Mojolicious/Routes.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Routes.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Routes.pm 2016-01-19 19:22:21.000000000 +0100
@@ -257,7 +257,7 @@
=head2 hidden
my $hidden = $r->hidden;
- $r = $r->hidden([qw(attr has new)]);
+ $r = $r->hidden(['attr', 'has', 'new']);
Controller attributes and methods that are hidden from router, defaults to
C<attr>, C<has>, C<new> and C<tap>.
@@ -290,12 +290,23 @@
Register a condition.
+ $r->add_condition(foo => sub {
+ my ($route, $c, $captures, $arg) = @_;
+ ...
+ return 1;
+ });
+
=head2 add_shortcut
$r = $r->add_shortcut(foo => sub {...});
Register a shortcut.
+ $r->add_shortcut(foo => sub {
+ my ($route, @args) = @_;
+ ...
+ });
+
=head2 continue
$r->continue(Mojolicious::Controller->new);
@@ -311,7 +322,7 @@
=head2 hide
- $r = $r->hide(qw(foo bar));
+ $r = $r->hide('foo', 'bar');
Hide controller attributes and methods from router.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Types.pm new/Mojolicious-6.42/lib/Mojolicious/Types.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Types.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Types.pm 2016-01-19 19:25:06.000000000 +0100
@@ -140,7 +140,7 @@
my $type = $types->type('png');
$types = $types->type(png => 'image/png');
- $types = $types->type(json => [qw(application/json text/x-json)]);
+ $types = $types->type(json => ['application/json', 'text/x-json']);
Get or set MIME types for file extension, alternatives are only used for
detection.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Validator/Validation.pm new/Mojolicious-6.42/lib/Mojolicious/Validator/Validation.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Validator/Validation.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Validator/Validation.pm 2016-01-24 00:43:47.000000000 +0100
@@ -64,12 +64,16 @@
sub is_valid { exists $_[0]->output->{$_[1] // $_[0]->topic} }
sub optional {
- my ($self, $name) = @_;
+ my ($self, $name, @filters) = @_;
- my $input = $self->input->{$name};
- my @input = ref $input eq 'ARRAY' ? @$input : $input;
- $self->output->{$name} = $input
- unless grep { !defined($_) || $_ eq '' } @input;
+ return $self->topic($name) unless defined(my $input = $self->input->{$name});
+
+ my @input = ref $input eq 'ARRAY' ? @$input : ($input);
+ for my $cb (map { $self->validator->filters->{$_} } @filters) {
+ @input = map { $self->$cb($name, $_) } @input;
+ }
+ $self->output->{$name} = @input > 1 ? \@input : $input[0]
+ unless grep { $_ eq '' } @input;
return $self->topic($name);
}
@@ -79,8 +83,8 @@
sub passed { [sort keys %{shift->output}] }
sub required {
- my ($self, $name) = @_;
- return $self if $self->optional($name)->is_valid;
+ my ($self, $name) = (shift, shift);
+ return $self if $self->optional($name, @_)->is_valid;
return $self->error($name => ['required']);
}
@@ -101,7 +105,7 @@
my $validation
= Mojolicious::Validator::Validation->new(validator => $validator);
$validation->input({foo => 'bar'});
- $validation->required('foo')->in(qw(bar baz));
+ $validation->required('foo')->in('bar', 'baz');
say $validation->param('foo');
=head1 DESCRIPTION
@@ -191,7 +195,7 @@
my $names = $validation->failed;
-Return a list of all names for values that failed validation.
+Return an array reference with all names for values that failed validation.
# Names of all values that failed
say for @{$validation->failed};
@@ -220,8 +224,12 @@
=head2 optional
$validation = $validation->optional('foo');
+ $validation = $validation->optional('foo', 'filter1', 'filter2');
+
+Change validation L</"topic"> and apply filters.
-Change validation L</"topic">.
+ # Trim value and check size
+ $validation->optional('user', 'trim')->size(1, 15);
=head2 param
@@ -234,7 +242,7 @@
my $names = $validation->passed;
-Return a list of all names for values that passed validation.
+Return an array reference with all names for values that passed validation.
# Names of all values that passed
say for @{$validation->passed};
@@ -242,9 +250,13 @@
=head2 required
$validation = $validation->required('foo');
+ $validation = $validation->required('foo', 'filter1', 'filter2');
+
+Change validation L</"topic">, apply filters, and make sure a value is present
+and not an empty string.
-Change validation L</"topic"> and make sure a value is present and not an empty
-string.
+ # Trim value and check size
+ $validation->required('user', 'trim')->size(1, 15);
=head1 AUTOLOAD
@@ -255,10 +267,10 @@
# Call validation checks
$validation->required('foo')->size(2, 5)->like(qr/^[A-Z]/);
$validation->optional('bar')->equal_to('foo');
- $validation->optional('baz')->in(qw(test 123));
+ $validation->optional('baz')->in('test', '123');
# Longer version
- $validation->required('foo')->check('size', 2,5)->check('like', qr/^[A-Z]/);
+ $validation->required('foo')->check('size', 2, 5)->check('like', qr/^[A-Z]/);
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious/Validator.pm new/Mojolicious-6.42/lib/Mojolicious/Validator.pm
--- old/Mojolicious-6.40/lib/Mojolicious/Validator.pm 2016-01-09 05:25:41.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious/Validator.pm 2016-01-20 06:04:56.000000000 +0100
@@ -1,6 +1,7 @@
package Mojolicious::Validator;
use Mojo::Base -base;
+use Mojo::Util 'trim';
use Mojolicious::Validator::Validation;
has checks => sub {
@@ -12,8 +13,10 @@
upload => sub { !ref $_[2] || !$_[2]->isa('Mojo::Upload') }
};
};
+has filters => sub { {trim => \&_trim} };
-sub add_check { $_[0]->checks->{$_[1]} = $_[2] and return $_[0] }
+sub add_check { $_[0]->checks->{$_[1]} = $_[2] and return $_[0] }
+sub add_filter { $_[0]->filters->{$_[1]} = $_[2] and return $_[0] }
sub validation {
Mojolicious::Validator::Validation->new(validator => shift);
@@ -37,6 +40,8 @@
return $len < $min || $len > $max;
}
+sub _trim { trim $_[2] }
+
1;
=encoding utf8
@@ -71,7 +76,7 @@
=head2 in
- $validation = $validation->in(qw(foo bar baz));
+ $validation = $validation->in('foo', 'bar', 'baz');
String value needs to match one of the values in the list.
@@ -94,6 +99,17 @@
Value needs to be a L<Mojo::Upload> object, representing a file upload.
+=head1 FILTERS
+
+These filters are available by default.
+
+=head2 trim
+
+ $validation = $validation->optional('foo', 'trim');
+
+Trim whitespace characters from both ends of string value with
+L<Mojo::Util/"trim">.
+
=head1 ATTRIBUTES
L<Mojolicious::Validator> implements the following attributes.
@@ -117,6 +133,24 @@
Register a validation check.
+ $validator->add_check(foo => sub {
+ my ($validation, $name, $value, @args) = @_;
+ ...
+ return undef;
+ });
+
+=head2 add_filter
+
+ $validator = $validator->add_filter(trim => sub {...});
+
+Register a new filter.
+
+ $validator->add_filter(foo => sub {
+ my ($validation, $name, $value) = @_;
+ ...
+ return $value;
+ });
+
=head2 validation
my $validation = $validator->validation;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/lib/Mojolicious.pm new/Mojolicious-6.42/lib/Mojolicious.pm
--- old/Mojolicious-6.40/lib/Mojolicious.pm 2016-01-11 19:14:50.000000000 +0100
+++ new/Mojolicious-6.42/lib/Mojolicious.pm 2016-01-20 21:02:19.000000000 +0100
@@ -43,7 +43,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Clinking Beer Mugs';
-our $VERSION = '6.40';
+our $VERSION = '6.42';
sub AUTOLOAD {
my $self = shift;
@@ -523,6 +523,12 @@
return $value ne 'foo';
});
+ # Add validation filter
+ $app->validator->add_filter(quotemeta => sub {
+ my ($validation, $name, $value) = @_;
+ return quotemeta $value;
+ });
+
=head1 METHODS
L<Mojolicious> inherits all methods from L<Mojo> and implements the following
@@ -549,8 +555,8 @@
my $hash = $app->defaults;
my $foo = $app->defaults('foo');
- $app = $app->defaults({foo => 'bar'});
- $app = $app->defaults(foo => 'bar');
+ $app = $app->defaults({foo => 'bar', baz => 23});
+ $app = $app->defaults(foo => 'bar', baz => 23);
Default values for L<Mojolicious::Controller/"stash">, assigned for every new
request.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/t/mojolicious/validation_lite_app.t new/Mojolicious-6.42/t/mojolicious/validation_lite_app.t
--- old/Mojolicious-6.40/t/mojolicious/validation_lite_app.t 2016-01-12 23:31:46.000000000 +0100
+++ new/Mojolicious-6.42/t/mojolicious/validation_lite_app.t 2016-01-24 00:44:26.000000000 +0100
@@ -9,7 +9,7 @@
use Test::Mojo;
# Custom check
-app->validator->add_check(two => sub { length $_[2] == 2 ? undef : 'ohoh' });
+app->validator->add_check(two => sub { length $_[2] == 2 ? undef : "e:$_[1]" });
any '/' => sub {
my $c = shift;
@@ -161,6 +161,27 @@
is_deeply $validation->error('bar'), [qw(size 1 1 6)], 'right error';
is_deeply $validation->failed, ['bar'], 'right names';
+# Trim
+$validation = $t->app->validation->input({foo => ' bar', baz => [' 0 ', 1]});
+ok $validation->required('foo', 'trim')->in('bar')->is_valid, 'valid';
+is_deeply $validation->output, {foo => 'bar'}, 'right result';
+ok !$validation->optional('missing', 'trim')->is_valid, 'not valid';
+ok $validation->optional('baz', 'trim')->like(qr/^\d$/)->is_valid, 'valid';
+is_deeply $validation->output, {foo => 'bar', baz => [0, 1]}, 'right result';
+$validation = $t->app->validation->input({nothing => ' '});
+ok !$validation->required('nothing', 'trim')->is_valid, 'not valid';
+is_deeply $validation->output, {}, 'right result';
+ok $validation->required('nothing')->is_valid, 'valid';
+is_deeply $validation->output, {nothing => ' '}, 'right result';
+
+# Custom filter
+$t->app->validator->add_filter(quote => sub {qq{$_[1]="$_[2]"}});
+$validation = $t->app->validation->input({foo => [' bar', 'baz']});
+ok $validation->required('foo', 'trim', 'quote')->like(qr/"/)->is_valid,
+ 'valid';
+is_deeply $validation->output, {foo => ['foo="bar"', 'foo="baz"']},
+ 'right result';
+
# Multiple empty values
$validation = $t->app->validation;
ok !$validation->has_data, 'no data';
@@ -306,7 +327,7 @@
}
);
$t->get_ok('/?foo=too_long&bar=too_long_too&baz=way_too_long&yada=whatever')
- ->status_is(200)->text_is('div:root' => 'two ohoh')
+ ->status_is(200)->text_is('div:root' => 'two e:foo')
->text_is('label.custom.my-field-with-error[for="foo"]' => '<Foo>')
->element_exists('input.custom.my-field-with-error[type="text"]')
->element_exists('textarea.my-field-with-error')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.40/t/mojolicious/websocket_lite_app.t new/Mojolicious-6.42/t/mojolicious/websocket_lite_app.t
--- old/Mojolicious-6.40/t/mojolicious/websocket_lite_app.t 2016-01-11 06:57:53.000000000 +0100
+++ new/Mojolicious-6.42/t/mojolicious/websocket_lite_app.t 2016-01-19 20:32:25.000000000 +0100
@@ -29,7 +29,7 @@
websocket '/protocols' => sub {
my $c = shift;
- $c->send($c->tx->with_protocols('foo', 'bar', 'baz') // 'none');
+ $c->send($c->tx->with_protocols('foo', 'bar', 'baz', '0') // 'none');
$c->send($c->tx->protocol // 'none');
};
@@ -225,12 +225,20 @@
is $t->tx->protocol, 'foo', 'right protocol';
is $t->tx->res->headers->sec_websocket_protocol, 'foo',
'right "Sec-WebSocket-Protocol" value';
+$t->websocket_ok('/protocols' => ['0'])->message_ok->message_is('0')
+ ->message_ok->message_is('0')->finish_ok;
+is $t->tx->protocol, '0', 'right protocol';
+is $t->tx->res->headers->sec_websocket_protocol, '0',
+ 'right "Sec-WebSocket-Protocol" value';
$t->websocket_ok('/protocols' => [''])->message_ok->message_is('none')
->message_ok->message_is('none')->finish_ok;
is $t->tx->protocol, undef, 'no protocol';
$t->websocket_ok('/protocols' => ['', '', ''])->message_ok->message_is('none')
->message_ok->message_is('none')->finish_ok;
is $t->tx->protocol, undef, 'no protocol';
+$t->websocket_ok('/protocols')->message_ok->message_is('none')
+ ->message_ok->message_is('none')->finish_ok;
+is $t->tx->protocol, undef, 'no protocol';
# JSON roundtrips (with a lot of different tests)
$t->websocket_ok('/json')->send_ok({json => {test => 23, snowman => '☃'}})
1
0
Hello community,
here is the log from the commit of package ghc-fclabels for openSUSE:Factory checked in at 2016-01-28 17:23:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-fclabels (Old)
and /work/SRC/openSUSE:Factory/.ghc-fclabels.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-fclabels"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-fclabels/ghc-fclabels.changes 2015-09-17 09:19:17.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-fclabels.new/ghc-fclabels.changes 2016-01-28 17:24:39.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Jan 20 09:43:35 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 2.0.2.4
+* Allow transformers 0.5.*.
+
+-------------------------------------------------------------------
Old:
----
fclabels-2.0.2.3.tar.gz
New:
----
fclabels-2.0.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-fclabels.spec ++++++
--- /var/tmp/diff_new_pack.CnXA01/_old 2016-01-28 17:24:39.000000000 +0100
+++ /var/tmp/diff_new_pack.CnXA01/_new 2016-01-28 17:24:39.000000000 +0100
@@ -21,7 +21,7 @@
%bcond_without tests
Name: ghc-fclabels
-Version: 2.0.2.3
+Version: 2.0.2.4
Release: 0
Summary: First class accessor labels implemented as lenses
License: BSD-3-Clause
++++++ fclabels-2.0.2.3.tar.gz -> fclabels-2.0.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fclabels-2.0.2.3/CHANGELOG new/fclabels-2.0.2.4/CHANGELOG
--- old/fclabels-2.0.2.3/CHANGELOG 2015-09-04 19:49:24.000000000 +0200
+++ new/fclabels-2.0.2.4/CHANGELOG 2016-01-18 14:18:19.000000000 +0100
@@ -1,8 +1,12 @@
CHANGELOG
+2.0.2.3 to 2.0.2.4
+
+ - Allow transformers 0.5.*.
+
2.0.2.2 to 2.0.2.3
- - Allow HUNit 1.3.*
+ - Allow HUnit 1.3.*
2.0.2.1 to 2.0.2.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fclabels-2.0.2.3/fclabels.cabal new/fclabels-2.0.2.4/fclabels.cabal
--- old/fclabels-2.0.2.3/fclabels.cabal 2015-09-04 19:49:24.000000000 +0200
+++ new/fclabels-2.0.2.4/fclabels.cabal 2016-01-18 14:18:19.000000000 +0100
@@ -1,5 +1,5 @@
Name: fclabels
-Version: 2.0.2.3
+Version: 2.0.2.4
Author: Sebastiaan Visser, Erik Hesselink, Chris Eidhof, Sjoerd Visscher
with lots of help and feedback from others.
Synopsis: First class accessor labels implemented as lenses.
@@ -81,7 +81,7 @@
base < 5
, template-haskell >= 2.2 && < 2.11
, mtl >= 1.0 && < 2.3
- , transformers >= 0.2 && < 0.5
+ , transformers >= 0.2 && < 0.6
Source-Repository head
Type: git
1
0
Hello community,
here is the log from the commit of package ghc-errors for openSUSE:Factory checked in at 2016-01-28 17:23:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-errors (Old)
and /work/SRC/openSUSE:Factory/.ghc-errors.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-errors"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-errors/ghc-errors.changes 2015-12-29 12:59:24.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-errors.new/ghc-errors.changes 2016-01-28 17:24:38.000000000 +0100
@@ -1,0 +2,11 @@
+Wed Jan 20 09:14:30 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 2.1.1
+* Increase upper bound on transformers-compat
+
+-------------------------------------------------------------------
+Mon Jan 11 07:51:40 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 2.1.0
+
+-------------------------------------------------------------------
Old:
----
errors-2.0.1.tar.gz
New:
----
errors-2.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-errors.spec ++++++
--- /var/tmp/diff_new_pack.yi2PNP/_old 2016-01-28 17:24:38.000000000 +0100
+++ /var/tmp/diff_new_pack.yi2PNP/_new 2016-01-28 17:24:38.000000000 +0100
@@ -18,7 +18,7 @@
%global pkg_name errors
Name: ghc-errors
-Version: 2.0.1
+Version: 2.1.1
Release: 0
Summary: Simplified error-handling
Group: System/Libraries
@@ -34,6 +34,7 @@
BuildRequires: ghc-safe-devel
BuildRequires: ghc-transformers-compat-devel
BuildRequires: ghc-transformers-devel
+BuildRequires: ghc-unexceptionalio-devel
# End cabal-rpm deps
%description
++++++ errors-2.0.1.tar.gz -> errors-2.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/errors-2.0.1/Control/Error/Util.hs new/errors-2.1.1/Control/Error/Util.hs
--- old/errors-2.0.1/Control/Error/Util.hs 2015-09-15 20:38:27.000000000 +0200
+++ new/errors-2.1.1/Control/Error/Util.hs 2016-01-16 23:09:57.000000000 +0100
@@ -51,7 +51,7 @@
) where
import Control.Applicative (Applicative, pure, (<$>))
-import qualified Control.Exception as Ex
+import Control.Exception (Handler(..), IOException, SomeException)
import Control.Monad (liftM)
import Control.Monad.IO.Class (MonadIO(liftIO))
import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT)
@@ -61,6 +61,10 @@
import Data.Maybe (fromMaybe)
import System.Exit (ExitCode)
import System.IO (hPutStr, hPutStrLn, stderr)
+import UnexceptionalIO (UIO, Unexceptional)
+
+import qualified Control.Exception as Exception
+import qualified UnexceptionalIO as UIO
-- | Fold an 'ExceptT' by providing one continuation for each constructor
exceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c
@@ -231,31 +235,12 @@
errLn :: String -> IO ()
errLn = hPutStrLn stderr
--- | Catch 'Ex.IOException's and convert them to the 'ExceptT' monad
-tryIO :: (MonadIO m) => IO a -> ExceptT Ex.IOException m a
-tryIO = ExceptT . liftIO . Ex.try
+-- | Catch 'IOException's and convert them to the 'ExceptT' monad
+tryIO :: MonadIO m => IO a -> ExceptT IOException m a
+tryIO = ExceptT . liftIO . Exception.try
{-| Catch all exceptions, except for asynchronous exceptions found in @base@
and convert them to the 'ExceptT' monad
-}
-syncIO :: MonadIO m => IO a -> ExceptT Ex.SomeException m a
-syncIO a = ExceptT . liftIO $ Ex.catches (Right <$> a)
- [ Ex.Handler $ \e -> Ex.throw (e :: Ex.ArithException)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.ArrayException)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.AssertionFailed)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.AsyncException)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.BlockedIndefinitelyOnMVar)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.BlockedIndefinitelyOnSTM)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.Deadlock)
- , Ex.Handler $ \e -> Ex.throw (e :: Dynamic)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.ErrorCall)
- , Ex.Handler $ \e -> Ex.throw (e :: ExitCode)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.NestedAtomically)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.NoMethodError)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.NonTermination)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.PatternMatchFail)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.RecConError)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.RecSelError)
- , Ex.Handler $ \e -> Ex.throw (e :: Ex.RecUpdError)
- , Ex.Handler $ return . Left
- ]
+syncIO :: Unexceptional m => IO a -> ExceptT SomeException m a
+syncIO = ExceptT . UIO.liftUIO . UIO.fromIO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/errors-2.0.1/errors.cabal new/errors-2.1.1/errors.cabal
--- old/errors-2.0.1/errors.cabal 2015-09-15 20:38:27.000000000 +0200
+++ new/errors-2.1.1/errors.cabal 2016-01-16 23:09:57.000000000 +0100
@@ -1,5 +1,5 @@
Name: errors
-Version: 2.0.1
+Version: 2.1.1
Cabal-Version: >=1.8.0.2
Build-Type: Simple
License: BSD3
@@ -25,7 +25,8 @@
base >= 4 && < 5 ,
safe >= 0.3.3 && < 0.4,
transformers >= 0.2 && < 0.5,
- transformers-compat >= 0.4 && < 0.5
+ transformers-compat >= 0.4 && < 0.6,
+ unexceptionalio >= 0.3 && < 0.4
Exposed-Modules:
Control.Error,
Control.Error.Safe,
1
0
Hello community,
here is the log from the commit of package ghc-distributive for openSUSE:Factory checked in at 2016-01-28 17:23:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-distributive (Old)
and /work/SRC/openSUSE:Factory/.ghc-distributive.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-distributive"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-distributive/ghc-distributive.changes 2015-05-22 16:36:01.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-distributive.new/ghc-distributive.changes 2016-01-28 17:24:37.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Jan 26 08:40:30 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.5.0.2
+* Added flags for removing some dependencies.
+* upport doctests when building to non-standard locations (such as when using stack.)
+* Support base-orphans
+
+-------------------------------------------------------------------
Old:
----
distributive-0.4.4.tar.gz
New:
----
distributive-0.5.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-distributive.spec ++++++
--- /var/tmp/diff_new_pack.iKKsux/_old 2016-01-28 17:24:38.000000000 +0100
+++ /var/tmp/diff_new_pack.iKKsux/_new 2016-01-28 17:24:38.000000000 +0100
@@ -21,7 +21,7 @@
%bcond_with tests
Name: ghc-distributive
-Version: 0.4.4
+Version: 0.5.0.2
Release: 0
Summary: Distributive functors -- Dual to Traversable
License: BSD-2-Clause
@@ -34,6 +34,7 @@
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
# Begin cabal-rpm deps:
+BuildRequires: ghc-base-orphans-devel
BuildRequires: ghc-tagged-devel
BuildRequires: ghc-transformers-compat-devel
BuildRequires: ghc-transformers-devel
++++++ distributive-0.4.4.tar.gz -> distributive-0.5.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/.ghci new/distributive-0.5.0.2/.ghci
--- old/distributive-0.4.4/.ghci 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/.ghci 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/.travis.yml new/distributive-0.5.0.2/.travis.yml
--- old/distributive-0.4.4/.travis.yml 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/.travis.yml 2016-01-17 01:07:48.000000000 +0100
@@ -1,17 +1,118 @@
-language: haskell
-before_install:
- # Uncomment whenever hackage is down.
- # - mkdir -p ~/.cabal && cp config ~/.cabal/config && cabal update
+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
+language: c
+sudo: false
+
+cache:
+ directories:
+ - $HOME/.cabsnap
+ - $HOME/.cabal/packages
+ - $HOME/.stack
+
+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.4.2 BUILD=cabal
+ compiler: ": #GHC 7.4.2"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.4.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+ - env: CABALVER=1.18 GHCVER=7.6.3 BUILD=cabal
+ compiler: ": #GHC 7.6.3"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.6.3,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+ - env: CABALVER=1.18 GHCVER=7.8.4 BUILD=cabal
+ compiler: ": #GHC 7.8.4"
+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+# - env: BUILD=stack STACK_YAML=stack-7.8.yaml STACK_OPTIONS=--skip-ghc-check
+# addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+# - env: BUILD=stack STACK_YAML=stack-7.8.yaml
+# os: osx
- # Try installing some of the build-deps with apt-get for speed.
- - ./travis-cabal-apt-install --only-dependencies --force-reinstall $mode
+ - env: CABALVER=1.22 GHCVER=7.10.1 BUILD=cabal
+ compiler: ": #GHC 7.10.1"
+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+ - env: CABALVER=1.22 GHCVER=7.10.2 BUILD=cabal
+ compiler: ": #GHC 7.10.2"
+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+ - env: BUILD=stack STACK_OPTIONS=--skip-ghc-check
+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}
+
+ - env: BUILD=stack
+ os: osx
+
+
+before_install:
+ - unset CC
+ - case "$BUILD" in
+ stack)
+ export STACK_VERSION=0.1.3.0;
+ export PATH=~/bin:$PATH;
+ mkdir -p ~/bin;
+ travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSIO… | gunzip > ~/bin/stack;
+ chmod a+x ~/bin/stack;
+ scripts/travis_long stack --no-terminal setup;;
+ cabal)
+ export HAPPYVER=1.19.5
+ export ALEXVER=3.1.4
+ export PATH=~/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/happy/$HAPPYVER/bin:/opt/alex/$ALEXVER/bin:$PATH;;
+ esac
install:
- - cabal configure -flib-Werror $mode
- - cabal build
+ - case "$BUILD" in
+ stack)
+ scripts/travis_long stack --no-terminal $STACK_OPTIONS build --only-snapshot -j2;;
+ cabal)
+ echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
+ cabal --version;
+ 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;
+ cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt;
+ sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt;
+ 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 --only-dependencies --enable-tests --enable-benchmarks;
+ if [ "$GHCVER" = "7.10.1" ]; then cabal install Cabal-1.22.4.0; fi;
+ fi;
+ 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;;
+ esac
+
+# snapshot package-db on cache miss
+# 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:
- - $script
+ - case "$BUILD" in
+ stack)
+ scripts/travis_long stack --no-terminal $STACK_OPTIONS build -j2;;
+ cabal)
+ cabal configure --enable-tests -v2;
+ cabal build;
+ cabal test;
+ cabal bench || true;
+ cabal sdist || true;
+ SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && (cd dist && cabal install --force-reinstalls "$SRC_TGZ");;
+ esac
notifications:
irc:
@@ -19,7 +120,5 @@
- "irc.freenode.org#haskell-lens"
skip_join: true
template:
- - "\x0313distributive\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"
-
-env:
- - mode="--enable-tests" script="cabal test"
+ - "\x0313distributive\x0f/\x0306%{branch}\x0f \x0314%{commit}\x0f %{message} \x0302\x1f%{build_url}\x0f"
+# EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/CHANGELOG.markdown new/distributive-0.5.0.2/CHANGELOG.markdown
--- old/distributive-0.4.4/CHANGELOG.markdown 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/CHANGELOG.markdown 2016-01-17 01:07:48.000000000 +0100
@@ -1,3 +1,17 @@
+0.5.0.2
+-------
+* A more elegant fix for builds on GHC 7.2
+
+0.5.0.1
+-------
+* Fix builds on GHC 7.2
+
+0.5
+---
+* Added flags for removing some dependencies.
+* Support `doctests` when building to non-standard locations (such as when using `stack`.)
+* Support `base-orphans`
+
0.4.4
-----
* `transformers 0.4` compatibility
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/LICENSE new/distributive-0.5.0.2/LICENSE
--- old/distributive-0.4.4/LICENSE 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/LICENSE 2016-01-17 01:07:48.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright 2011-2014 Edward Kmett
+Copyright 2011-2016 Edward Kmett
All rights reserved.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/README.markdown new/distributive-0.5.0.2/README.markdown
--- old/distributive-0.4.4/README.markdown 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/README.markdown 2016-01-17 01:07:48.000000000 +0100
@@ -1,7 +1,7 @@
distributive
============
-[![Build Status](https://secure.travis-ci.org/ekmett/distributive.png?branch=master)…
+[![Hackage](https://img.shields.io/hackage/v/distributive.svg)](https://hackage.haskell.org/package/distributive) [![Build Status](https://secure.travis-ci.org/ekmett/distributive.png?branch=master)…
This package provides the notion that is categorically dual to `Traversable`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/Setup.lhs new/distributive-0.5.0.2/Setup.lhs
--- old/distributive-0.4.4/Setup.lhs 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/Setup.lhs 2016-01-17 01:07:48.000000000 +0100
@@ -30,6 +30,10 @@
withTestLBI pkg lbi $ \suite suitecfg -> do
rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
[ "module Build_" ++ testName suite ++ " where"
+ , ""
+ , "autogen_dir :: String"
+ , "autogen_dir = " ++ show dir
+ , ""
, "deps :: [String]"
, "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/distributive.cabal new/distributive-0.5.0.2/distributive.cabal
--- old/distributive-0.4.4/distributive.cabal 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/distributive.cabal 2016-01-17 01:07:48.000000000 +0100
@@ -1,6 +1,6 @@
name: distributive
category: Data Structures
-version: 0.4.4
+version: 0.5.0.2
license: BSD3
cabal-version: >= 1.8
license-file: LICENSE
@@ -9,12 +9,11 @@
stability: provisional
homepage: http://github.com/ekmett/distributive/
bug-reports: http://github.com/ekmett/distributive/issues
-copyright: Copyright (C) 2011-2014 Edward A. Kmett
+copyright: Copyright (C) 2011-2016 Edward A. Kmett
synopsis: Distributive functors -- Dual to Traversable
description: Distributive functors -- Dual to Traversable
build-type: Custom
extra-source-files:
- .ghci
.travis.yml
.vim.custom
config
@@ -26,15 +25,19 @@
type: git
location: git://github.com/ekmett/distributive.git
-flag lib-Werror
+flag tagged
manual: True
- default: False
+ default: True
+ description:
+ You can disable the use of the `tagged` package using `-f-tagged`.
+ .
+ Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
library
build-depends:
base >= 4 && < 5,
- tagged >= 0.7 && < 1,
- transformers >= 0.2 && < 0.5,
+ base-orphans >= 0.5 && < 1,
+ transformers >= 0.2 && < 0.6,
transformers-compat >= 0.3 && < 1
hs-source-dirs: src
@@ -43,12 +46,14 @@
if impl(ghc>=7.2)
exposed-modules: Data.Distributive.Generic
+
+ if flag(tagged)
+ build-depends: tagged >= 0.7 && < 1
+
+ if impl(ghc>=7.2 && < 7.6)
build-depends: ghc-prim
- if flag(lib-Werror)
- ghc-options: -Werror
- else
- ghc-options: -Wall
+ ghc-options: -Wall
-- Verify the results of the examples
test-suite doctests
@@ -60,6 +65,4 @@
doctest >= 0.9.1,
filepath >= 1.2
ghc-options: -Wall -threaded
- if impl(ghc<7.6.1)
- ghc-options: -Werror
hs-source-dirs: tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/src/Data/Distributive/Generic.hs new/distributive-0.5.0.2/src/Data/Distributive/Generic.hs
--- old/distributive-0.4.4/src/Data/Distributive/Generic.hs 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/src/Data/Distributive/Generic.hs 2016-01-17 01:07:48.000000000 +0100
@@ -4,7 +4,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Data.Distributive
--- Copyright : (C) 2011-2014 Edward Kmett
+-- Copyright : (C) 2011-2016 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett(a)gmail.com>
@@ -45,7 +45,7 @@
sndP (_ :*: r) = r
{-# INLINE gdistribute #-}
-instance (Functor a, Functor b, GDistributive a, GDistributive b) => GDistributive (a :.: b) where
+instance (Functor a, GDistributive a, GDistributive b) => GDistributive (a :.: b) where
gdistribute = Comp1 . fmap gdistribute . gdistribute . fmap unComp1
{-# INLINE gdistribute #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/src/Data/Distributive.hs new/distributive-0.5.0.2/src/Data/Distributive.hs
--- old/distributive-0.4.4/src/Data/Distributive.hs 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/src/Data/Distributive.hs 2016-01-17 01:07:48.000000000 +0100
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Data.Distributive
--- Copyright : (C) 2011-2014 Edward Kmett
+-- Copyright : (C) 2011-2016 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett(a)gmail.com>
@@ -29,8 +29,18 @@
import Data.Functor.Identity
import Data.Functor.Product
import Data.Functor.Reverse
+import qualified Data.Monoid as Monoid
+import Data.Orphans ()
+
+#if MIN_VERSION_base(4,4,0)
+import Data.Complex
+#endif
+#if (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707) || defined(MIN_VERSION_tagged)
import Data.Proxy
+#endif
+#ifdef MIN_VERSION_tagged
import Data.Tagged
+#endif
#ifdef HLINT
{-# ANN module "hlint: ignore Use section" #-}
@@ -125,3 +135,24 @@
instance Distributive f => Distributive (Reverse f) where
distribute = Reverse . collect getReverse
+
+instance Distributive Monoid.Dual where
+ collect f = Monoid.Dual . fmap (Monoid.getDual . f)
+ distribute = Monoid.Dual . fmap Monoid.getDual
+
+instance Distributive Monoid.Product where
+ collect f = Monoid.Product . fmap (Monoid.getProduct . f)
+ distribute = Monoid.Product . fmap Monoid.getProduct
+
+instance Distributive Monoid.Sum where
+ collect f = Monoid.Sum . fmap (Monoid.getSum . f)
+ distribute = Monoid.Sum . fmap Monoid.getSum
+
+#if MIN_VERSION_base(4,4,0)
+instance Distributive Complex where
+ distribute wc = fmap realP wc :+ fmap imagP wc where
+ -- Redefine realPart and imagPart to avoid incurring redundant RealFloat
+ -- constraints on older versions of base
+ realP (r :+ _) = r
+ imagP (_ :+ i) = i
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/distributive-0.4.4/tests/doctests.hs new/distributive-0.5.0.2/tests/doctests.hs
--- old/distributive-0.4.4/tests/doctests.hs 2014-05-05 22:51:17.000000000 +0200
+++ new/distributive-0.5.0.2/tests/doctests.hs 2016-01-17 01:07:48.000000000 +0100
@@ -1,7 +1,10 @@
+{-# LANGUAGE CPP #-}
module Main where
-import Build_doctests (deps)
+import Build_doctests (autogen_dir, deps)
+#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
+#endif
import Control.Monad
import Data.List
import System.Directory
@@ -11,9 +14,9 @@
main :: IO ()
main = getSources >>= \sources -> doctest $
"-isrc"
- : "-idist/build/autogen"
+ : ("-i" ++ autogen_dir)
: "-optP-include"
- : "-optPdist/build/autogen/cabal_macros.h"
+ : ("-optP" ++ autogen_dir ++ "/cabal_macros.h")
: "-hide-all-packages"
: map ("-package="++) deps ++ sources
1
0
Hello community,
here is the log from the commit of package ghc-contravariant for openSUSE:Factory checked in at 2016-01-28 17:23:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-contravariant (Old)
and /work/SRC/openSUSE:Factory/.ghc-contravariant.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-contravariant"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-contravariant/ghc-contravariant.changes 2015-09-17 09:19:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-contravariant.new/ghc-contravariant.changes 2016-01-28 17:24:36.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Jan 22 08:35:07 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 1.4
+* Improved the performance of Deciding at the cost of downgrading it to Trustworthy.
+* Support for transformers 0.5
+
+-------------------------------------------------------------------
Old:
----
contravariant-1.3.3.tar.gz
New:
----
contravariant-1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-contravariant.spec ++++++
--- /var/tmp/diff_new_pack.0aGwI2/_old 2016-01-28 17:24:37.000000000 +0100
+++ /var/tmp/diff_new_pack.0aGwI2/_new 2016-01-28 17:24:37.000000000 +0100
@@ -19,7 +19,7 @@
%global pkg_name contravariant
Name: ghc-contravariant
-Version: 1.3.3
+Version: 1.4
Release: 0
Summary: Contravariant functors
License: BSD-3-Clause
@@ -34,6 +34,7 @@
# Begin cabal-rpm deps:
BuildRequires: ghc-StateVar-devel
BuildRequires: ghc-semigroups-devel
+BuildRequires: ghc-tagged-devel
BuildRequires: ghc-transformers-compat-devel
BuildRequires: ghc-transformers-devel
BuildRequires: ghc-void-devel
++++++ contravariant-1.3.3.tar.gz -> contravariant-1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/contravariant-1.3.3/CHANGELOG.markdown new/contravariant-1.4/CHANGELOG.markdown
--- old/contravariant-1.3.3/CHANGELOG.markdown 2015-09-04 12:33:20.000000000 +0200
+++ new/contravariant-1.4/CHANGELOG.markdown 2016-01-16 22:55:58.000000000 +0100
@@ -1,3 +1,9 @@
+1.4
+---
+* Improved the performance of `Deciding` at the cost of downgrading it to `Trustworthy`.
+* Support for GHC 8
+* Support for `transformers` 0.5
+
1.3.3
-----
* Add `instance Monoid m => Divisible (Const m)`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/contravariant-1.3.3/contravariant.cabal new/contravariant-1.4/contravariant.cabal
--- old/contravariant-1.3.3/contravariant.cabal 2015-09-04 12:33:20.000000000 +0200
+++ new/contravariant-1.4/contravariant.cabal 2016-01-16 22:55:58.000000000 +0100
@@ -1,6 +1,6 @@
name: contravariant
category: Control, Data
-version: 1.3.3
+version: 1.4
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE
@@ -38,6 +38,11 @@
default: True
manual: True
+flag safe
+ description: Get Safe guarantees rather than merely Trustworthy, but with worse constant factors.
+ default: False
+ manual: True
+
flag StateVar
description:
You can disable the use of the `StateVar` package using `-f-StateVar`.
@@ -50,7 +55,7 @@
hs-source-dirs: src
build-depends:
base < 5,
- transformers >= 0.2 && < 0.5,
+ transformers >= 0.2 && < 0.6,
transformers-compat >= 0.3 && < 1,
void >= 0.6 && < 1
@@ -66,6 +71,9 @@
if impl(ghc >= 7.2 && < 7.6)
build-depends: ghc-prim
+ if flag(safe)
+ cpp-options: -DSAFE
+
exposed-modules:
Data.Functor.Contravariant
Data.Functor.Contravariant.Compose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/contravariant-1.3.3/src/Data/Functor/Contravariant/Divisible.hs new/contravariant-1.4/src/Data/Functor/Contravariant/Divisible.hs
--- old/contravariant-1.3.3/src/Data/Functor/Contravariant/Divisible.hs 2015-09-04 12:33:20.000000000 +0200
+++ new/contravariant-1.4/src/Data/Functor/Contravariant/Divisible.hs 2016-01-16 22:55:58.000000000 +0100
@@ -1,4 +1,7 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE TypeOperators #-}
+{-# OPTIONS_GHC -fno-warn-deprecations #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Data.Functor.Contravariant.Divisible
@@ -20,18 +23,48 @@
) where
import Control.Applicative
+import Control.Applicative.Backwards
+import Control.Arrow
+import Control.Monad.Trans.Error
+import Control.Monad.Trans.Except
+import Control.Monad.Trans.Identity
+import Control.Monad.Trans.List
+import Control.Monad.Trans.Maybe
+import qualified Control.Monad.Trans.RWS.Lazy as Lazy
+import qualified Control.Monad.Trans.RWS.Strict as Strict
+import Control.Monad.Trans.Reader
+import qualified Control.Monad.Trans.State.Lazy as Lazy
+import qualified Control.Monad.Trans.State.Strict as Strict
+import qualified Control.Monad.Trans.Writer.Lazy as Lazy
+import qualified Control.Monad.Trans.Writer.Strict as Strict
+
+import Data.Either
+import Data.Functor.Compose
+import Data.Functor.Constant
import Data.Functor.Contravariant
+import Data.Functor.Product
+import Data.Functor.Reverse
+import Data.Void
-#if __GLASGOW_HASKELL__ < 710
-import Data.Monoid
+#if MIN_VERSION_base(4,8,0)
+import Data.Monoid (Alt(..))
+#else
+import Data.Monoid (Monoid(..))
#endif
-import Data.Void
+#if MIN_VERSION_base(4,7,0) || defined(MIN_VERSION_tagged)
+import Data.Proxy
+#endif
#if MIN_VERSION_StateVar
import Data.StateVar
#endif
+#if __GLASGOW_HASKELL__ >= 702
+#define GHC_GENERICS
+import GHC.Generics
+#endif
+
--------------------------------------------------------------------------------
-- * Contravariant Applicative
--------------------------------------------------------------------------------
@@ -53,7 +86,7 @@
-- @
-- delta a = (a,a)
-- @
---
+--
-- @'divide' 'delta'@ should be associative with 'conquer' as a unit
--
-- @
@@ -94,7 +127,7 @@
-- | Redundant, but provided for symmetry.
--
-- @
--- 'conquered' = 'conquer
+-- 'conquered' = 'conquer'
-- @
conquered :: Divisible f => f ()
conquered = conquer
@@ -108,7 +141,7 @@
-- @
liftD :: Divisible f => (a -> b) -> f b -> f a
liftD f = divide ((,) () . f) conquer
-
+
instance Monoid r => Divisible (Op r) where
divide f (Op g) (Op h) = Op $ \a -> case f a of
(b, c) -> g b `mappend` h c
@@ -135,6 +168,118 @@
divide _ (Const a) (Const b) = Const (mappend a b)
conquer = Const mempty
+#if MIN_VERSION_base(4,8,0)
+instance Divisible f => Divisible (Alt f) where
+ divide f (Alt l) (Alt r) = Alt $ divide f l r
+ conquer = Alt conquer
+#endif
+
+#ifdef GHC_GENERICS
+instance Divisible U1 where
+ divide _ U1 U1 = U1
+ conquer = U1
+
+instance Divisible f => Divisible (Rec1 f) where
+ divide f (Rec1 l) (Rec1 r) = Rec1 $ divide f l r
+ conquer = Rec1 conquer
+
+instance Divisible f => Divisible (M1 i c f) where
+ divide f (M1 l) (M1 r) = M1 $ divide f l r
+ conquer = M1 conquer
+
+instance (Divisible f, Divisible g) => Divisible (f :*: g) where
+ divide f (l1 :*: r1) (l2 :*: r2) = divide f l1 l2 :*: divide f r1 r2
+ conquer = conquer :*: conquer
+
+instance (Applicative f, Divisible g) => Divisible (f :.: g) where
+ divide f (Comp1 l) (Comp1 r) = Comp1 (divide f <$> l <*> r)
+ conquer = Comp1 $ pure conquer
+#endif
+
+instance Divisible f => Divisible (Backwards f) where
+ divide f (Backwards l) (Backwards r) = Backwards $ divide f l r
+ conquer = Backwards conquer
+
+instance Divisible m => Divisible (ErrorT e m) where
+ divide f (ErrorT l) (ErrorT r) = ErrorT $ divide (funzip . fmap f) l r
+ conquer = ErrorT conquer
+
+instance Divisible m => Divisible (ExceptT e m) where
+ divide f (ExceptT l) (ExceptT r) = ExceptT $ divide (funzip . fmap f) l r
+ conquer = ExceptT conquer
+
+instance Divisible f => Divisible (IdentityT f) where
+ divide f (IdentityT l) (IdentityT r) = IdentityT $ divide f l r
+ conquer = IdentityT conquer
+
+instance Divisible m => Divisible (ListT m) where
+ divide f (ListT l) (ListT r) = ListT $ divide (funzip . map f) l r
+ conquer = ListT conquer
+
+instance Divisible m => Divisible (MaybeT m) where
+ divide f (MaybeT l) (MaybeT r) = MaybeT $ divide (funzip . fmap f) l r
+ conquer = MaybeT conquer
+
+instance Divisible m => Divisible (ReaderT r m) where
+ divide abc (ReaderT rmb) (ReaderT rmc) = ReaderT $ \r -> divide abc (rmb r) (rmc r)
+ conquer = ReaderT $ \_ -> conquer
+
+instance Divisible m => Divisible (Lazy.RWST r w s m) where
+ divide abc (Lazy.RWST rsmb) (Lazy.RWST rsmc) = Lazy.RWST $ \r s ->
+ divide (\ ~(a, s', w) -> case abc a of
+ ~(b, c) -> ((b, s', w), (c, s', w)))
+ (rsmb r s) (rsmc r s)
+ conquer = Lazy.RWST $ \_ _ -> conquer
+
+instance Divisible m => Divisible (Strict.RWST r w s m) where
+ divide abc (Strict.RWST rsmb) (Strict.RWST rsmc) = Strict.RWST $ \r s ->
+ divide (\(a, s', w) -> case abc a of
+ (b, c) -> ((b, s', w), (c, s', w)))
+ (rsmb r s) (rsmc r s)
+ conquer = Strict.RWST $ \_ _ -> conquer
+
+instance Divisible m => Divisible (Lazy.StateT s m) where
+ divide f (Lazy.StateT l) (Lazy.StateT r) = Lazy.StateT $ \s ->
+ divide (lazyFanout f) (l s) (r s)
+ conquer = Lazy.StateT $ \_ -> conquer
+
+instance Divisible m => Divisible (Strict.StateT s m) where
+ divide f (Strict.StateT l) (Strict.StateT r) = Strict.StateT $ \s ->
+ divide (strictFanout f) (l s) (r s)
+ conquer = Strict.StateT $ \_ -> conquer
+
+instance Divisible m => Divisible (Lazy.WriterT w m) where
+ divide f (Lazy.WriterT l) (Lazy.WriterT r) = Lazy.WriterT $
+ divide (lazyFanout f) l r
+ conquer = Lazy.WriterT conquer
+
+instance Divisible m => Divisible (Strict.WriterT w m) where
+ divide f (Strict.WriterT l) (Strict.WriterT r) = Strict.WriterT $
+ divide (strictFanout f) l r
+ conquer = Strict.WriterT conquer
+
+instance (Applicative f, Divisible g) => Divisible (Compose f g) where
+ divide f (Compose l) (Compose r) = Compose (divide f <$> l <*> r)
+ conquer = Compose $ pure conquer
+
+instance Monoid m => Divisible (Constant m) where
+ divide _ (Constant l) (Constant r) = Constant $ mappend l r
+ conquer = Constant mempty
+
+instance (Divisible f, Divisible g) => Divisible (Product f g) where
+ divide f (Pair l1 r1) (Pair l2 r2) = Pair (divide f l1 l2) (divide f r1 r2)
+ conquer = Pair conquer conquer
+
+instance Divisible f => Divisible (Reverse f) where
+ divide f (Reverse l) (Reverse r) = Reverse $ divide f l r
+ conquer = Reverse conquer
+
+#if MIN_VERSION_base(4,7,0) || defined(MIN_VERSION_tagged)
+instance Divisible Proxy where
+ divide _ Proxy Proxy = Proxy
+ conquer = Proxy
+#endif
+
#if MIN_VERSION_StateVar
instance Divisible SettableStateVar where
divide k (SettableStateVar l) (SettableStateVar r) = SettableStateVar $ \ a -> case k a of
@@ -142,13 +287,24 @@
conquer = SettableStateVar $ \_ -> return ()
#endif
+lazyFanout :: (a -> (b, c)) -> (a, s) -> ((b, s), (c, s))
+lazyFanout f ~(a, s) = case f a of
+ ~(b, c) -> ((b, s), (c, s))
+
+strictFanout :: (a -> (b, c)) -> (a, s) -> ((b, s), (c, s))
+strictFanout f (a, s) = case f a of
+ (b, c) -> ((b, s), (c, s))
+
+funzip :: Functor f => f (a, b) -> (f a, f b)
+funzip = fmap fst &&& fmap snd
+
--------------------------------------------------------------------------------
-- * Contravariant Alternative
--------------------------------------------------------------------------------
-- |
--
--- A 'Divisible' contravariant functor is a monoid object in the category of presheaves
+-- A 'Divisible' contravariant functor is a monoid object in the category of presheaves
-- from Hask to Hask, equipped with Day convolution mapping the cartesian product of the
-- source to the Cartesian product of the target.
--
@@ -210,6 +366,123 @@
lose f = Op $ absurd . f
choose f (Op g) (Op h) = Op $ either g h . f
+#if MIN_VERSION_base(4,8,0)
+instance Decidable f => Decidable (Alt f) where
+ lose = Alt . lose
+ choose f (Alt l) (Alt r) = Alt $ choose f l r
+#endif
+
+#ifdef GHC_GENERICS
+instance Decidable U1 where
+ lose _ = U1
+ choose _ U1 U1 = U1
+
+instance Decidable f => Decidable (Rec1 f) where
+ lose = Rec1 . lose
+ choose f (Rec1 l) (Rec1 r) = Rec1 $ choose f l r
+
+instance Decidable f => Decidable (M1 i c f) where
+ lose = M1 . lose
+ choose f (M1 l) (M1 r) = M1 $ choose f l r
+
+instance (Decidable f, Decidable g) => Decidable (f :*: g) where
+ lose f = lose f :*: lose f
+ choose f (l1 :*: r1) (l2 :*: r2) = choose f l1 l2 :*: choose f r1 r2
+
+instance (Applicative f, Decidable g) => Decidable (f :.: g) where
+ lose = Comp1 . pure . lose
+ choose f (Comp1 l) (Comp1 r) = Comp1 (choose f <$> l <*> r)
+#endif
+
+instance Decidable f => Decidable (Backwards f) where
+ lose = Backwards . lose
+ choose f (Backwards l) (Backwards r) = Backwards $ choose f l r
+
+instance Decidable f => Decidable (IdentityT f) where
+ lose = IdentityT . lose
+ choose f (IdentityT l) (IdentityT r) = IdentityT $ choose f l r
+
+instance Decidable m => Decidable (ReaderT r m) where
+ lose f = ReaderT $ \_ -> lose f
+ choose abc (ReaderT rmb) (ReaderT rmc) = ReaderT $ \r -> choose abc (rmb r) (rmc r)
+
+instance Decidable m => Decidable (Lazy.RWST r w s m) where
+ lose f = Lazy.RWST $ \_ _ -> contramap (\ ~(a, _, _) -> a) (lose f)
+ choose abc (Lazy.RWST rsmb) (Lazy.RWST rsmc) = Lazy.RWST $ \r s ->
+ choose (\ ~(a, s', w) -> either (Left . betuple3 s' w)
+ (Right . betuple3 s' w)
+ (abc a))
+ (rsmb r s) (rsmc r s)
+
+instance Decidable m => Decidable (Strict.RWST r w s m) where
+ lose f = Strict.RWST $ \_ _ -> contramap (\(a, _, _) -> a) (lose f)
+ choose abc (Strict.RWST rsmb) (Strict.RWST rsmc) = Strict.RWST $ \r s ->
+ choose (\(a, s', w) -> either (Left . betuple3 s' w)
+ (Right . betuple3 s' w)
+ (abc a))
+ (rsmb r s) (rsmc r s)
+
+instance Divisible m => Decidable (ListT m) where
+ lose _ = ListT conquer
+ choose f (ListT l) (ListT r) = ListT $ divide ((lefts &&& rights) . map f) l r
+
+instance Divisible m => Decidable (MaybeT m) where
+ lose _ = MaybeT conquer
+ choose f (MaybeT l) (MaybeT r) = MaybeT $
+ divide ( maybe (Nothing, Nothing)
+ (either (\b -> (Just b, Nothing))
+ (\c -> (Nothing, Just c)))
+ . fmap f) l r
+
+instance Decidable m => Decidable (Lazy.StateT s m) where
+ lose f = Lazy.StateT $ \_ -> contramap lazyFst (lose f)
+ choose f (Lazy.StateT l) (Lazy.StateT r) = Lazy.StateT $ \s ->
+ choose (\ ~(a, s') -> either (Left . betuple s') (Right . betuple s') (f a))
+ (l s) (r s)
+
+instance Decidable m => Decidable (Strict.StateT s m) where
+ lose f = Strict.StateT $ \_ -> contramap fst (lose f)
+ choose f (Strict.StateT l) (Strict.StateT r) = Strict.StateT $ \s ->
+ choose (\(a, s') -> either (Left . betuple s') (Right . betuple s') (f a))
+ (l s) (r s)
+
+instance Decidable m => Decidable (Lazy.WriterT w m) where
+ lose f = Lazy.WriterT $ contramap lazyFst (lose f)
+ choose f (Lazy.WriterT l) (Lazy.WriterT r) = Lazy.WriterT $
+ choose (\ ~(a, s') -> either (Left . betuple s') (Right . betuple s') (f a)) l r
+
+instance Decidable m => Decidable (Strict.WriterT w m) where
+ lose f = Strict.WriterT $ contramap fst (lose f)
+ choose f (Strict.WriterT l) (Strict.WriterT r) = Strict.WriterT $
+ choose (\(a, s') -> either (Left . betuple s') (Right . betuple s') (f a)) l r
+
+instance (Applicative f, Decidable g) => Decidable (Compose f g) where
+ lose = Compose . pure . lose
+ choose f (Compose l) (Compose r) = Compose (choose f <$> l <*> r)
+
+instance (Decidable f, Decidable g) => Decidable (Product f g) where
+ lose f = Pair (lose f) (lose f)
+ choose f (Pair l1 r1) (Pair l2 r2) = Pair (choose f l1 l2) (choose f r1 r2)
+
+instance Decidable f => Decidable (Reverse f) where
+ lose = Reverse . lose
+ choose f (Reverse l) (Reverse r) = Reverse $ choose f l r
+
+betuple :: s -> a -> (a, s)
+betuple s a = (a, s)
+
+betuple3 :: s -> w -> a -> (a, s, w)
+betuple3 s w a = (a, s, w)
+
+lazyFst :: (a, b) -> a
+lazyFst ~(a, _) = a
+
+#if MIN_VERSION_base(4,7,0) || defined(MIN_VERSION_tagged)
+instance Decidable Proxy where
+ lose _ = Proxy
+ choose _ Proxy Proxy = Proxy
+#endif
+
#if MIN_VERSION_StateVar
instance Decidable SettableVar where
lose k = SettableStateVar (absurd . k)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/contravariant-1.3.3/src/Data/Functor/Contravariant/Generic.hs new/contravariant-1.4/src/Data/Functor/Contravariant/Generic.hs
--- old/contravariant-1.3.3/src/Data/Functor/Contravariant/Generic.hs 2015-09-04 12:33:20.000000000 +0200
+++ new/contravariant-1.4/src/Data/Functor/Contravariant/Generic.hs 2016-01-16 22:55:58.000000000 +0100
@@ -1,5 +1,9 @@
{-# LANGUAGE CPP #-}
+#ifdef SAFE
{-# LANGUAGE BangPatterns #-}
+#elif __GLASGOW_HASKELL__ >= 704
+{-# LANGUAGE Trustworthy #-}
+#endif
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
@@ -32,6 +36,9 @@
import Data.Functor.Contravariant
import Data.Functor.Contravariant.Divisible
import GHC.Generics
+#ifndef SAFE
+import Unsafe.Coerce
+#endif
-- | This provides machinery for deconstructing an arbitrary 'Generic' instance using a 'Decidable' 'Contravariant' functor.
--
@@ -84,13 +91,13 @@
gdeciding _ _ = conquer
instance GDeciding q V1 where
- gdeciding _ _ = lose (\ !_ -> error "impossible")
+ gdeciding _ _ = glose
instance (GDeciding q f, GDeciding q g) => GDeciding q (f :*: g) where
- gdeciding p q = divide (\(a :*: b) -> (a, b)) (gdeciding p q) (gdeciding p q)
+ gdeciding p q = gdivide (gdeciding p q) (gdeciding p q)
instance (GDeciding q f, GDeciding q g) => GDeciding q (f :+: g) where
- gdeciding p q = choose (\ xs -> case xs of L1 a -> Left a; R1 a -> Right a) (gdeciding p q) (gdeciding p q)
+ gdeciding p q = gchoose (gdeciding p q) (gdeciding p q)
#ifndef HLINT
instance q p => GDeciding q (K1 i p) where
@@ -109,18 +116,44 @@
gdeciding1 _ _ _ = conquer
instance GDeciding1 q V1 where
- gdeciding1 _ _ _ = lose (\ !_ -> error "impossible")
+ gdeciding1 _ _ _ = glose
instance (GDeciding1 q f, GDeciding1 q g) => GDeciding1 q (f :*: g) where
- gdeciding1 p q r = divide (\(a :*: b) -> (a, b)) (gdeciding1 p q r) (gdeciding1 p q r)
+ gdeciding1 p q r = gdivide (gdeciding1 p q r) (gdeciding1 p q r)
instance (GDeciding1 q f, GDeciding1 q g) => GDeciding1 q (f :+: g) where
- gdeciding1 p q r = choose (\ xs -> case xs of L1 a -> Left a; R1 a -> Right a) (gdeciding1 p q r) (gdeciding1 p q r)
+ gdeciding1 p q r = gchoose (gdeciding1 p q r) (gdeciding1 p q r)
+
+
+
+glose :: Decidable f => f (V1 a)
+#ifdef SAFE
+glose = lose (\ !_ -> error "impossible")
+#else
+glose = lose unsafeCoerce
+#endif
+{-# INLINE glose #-}
+
+gdivide :: Divisible f => f (g a) -> f (h a) -> f ((g:*:h) a)
+#ifdef SAFE
+gdivide = divide (\(f:*:g) -> (f,g))
+#else
+gdivide = divide unsafeCoerce
+#endif
+{-# INLINE gdivide #-}
+
+gchoose :: Decidable f => f (g a) -> f (h a) -> f ((g:+:h) a)
+#ifdef SAFE
+gchoose = choose (\xs -> case xs of L1 a -> Left a; R1 b -> Right b)
+#else
+gchoose = choose unsafeCoerce
+#endif
+{-# INLINE gchoose #-}
#ifndef HLINT
instance q p => GDeciding1 q (K1 i p) where
-#endif
gdeciding1 _ q _ = contramap unK1 q
+#endif
instance GDeciding1 q f => GDeciding1 q (M1 i c f) where
gdeciding1 p q r = contramap unM1 (gdeciding1 p q r)
1
0
Hello community,
here is the log from the commit of package ghc-constraints for openSUSE:Factory checked in at 2016-01-28 17:23:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-constraints (Old)
and /work/SRC/openSUSE:Factory/.ghc-constraints.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-constraints"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-constraints/ghc-constraints.changes 2016-01-08 15:23:17.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-constraints.new/ghc-constraints.changes 2016-01-28 17:24:35.000000000 +0100
@@ -1,0 +2,10 @@
+Wed Jan 20 09:03:54 UTC 2016 - mimi.vx(a)gmail.com
+
+- update to 0.8
+* Remove the need for closed type families from the new Forall.
+* Found a nicer encoding of the initial object in the category of constraints
+ using a nullary constraint.
+* binary 0.8 compatibility
+* transformers 0.5 compatibility
+
+-------------------------------------------------------------------
Old:
----
constraints-0.6.tar.gz
New:
----
constraints-0.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-constraints.spec ++++++
--- /var/tmp/diff_new_pack.DVAEXM/_old 2016-01-28 17:24:36.000000000 +0100
+++ /var/tmp/diff_new_pack.DVAEXM/_new 2016-01-28 17:24:36.000000000 +0100
@@ -19,7 +19,7 @@
%global pkg_name constraints
Name: ghc-constraints
-Version: 0.6
+Version: 0.8
Release: 0
Summary: Constraint manipulation
License: BSD-2-Clause
++++++ constraints-0.6.tar.gz -> constraints-0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/constraints-0.6/constraints.cabal new/constraints-0.8/constraints.cabal
--- old/constraints-0.6/constraints.cabal 2015-11-10 14:16:35.000000000 +0100
+++ new/constraints-0.8/constraints.cabal 2016-01-17 03:10:38.000000000 +0100
@@ -1,6 +1,6 @@
name: constraints
category: Constraints
-version: 0.6
+version: 0.8
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
@@ -17,7 +17,7 @@
This package provides a vocabulary for working with them.
build-type: Simple
-tested-with: GHC == 7.8.3, GHC == 7.7.20131027, GHC == 7.7.20131025
+tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1, GHC == 7.10.2
extra-source-files: README.markdown
source-repository head
@@ -41,26 +41,24 @@
GADTs
build-depends:
- base >= 4.6 && < 5,
- binary >= 0.7.3 && < 0.8,
+ base >= 4.7 && < 5,
+ binary >= 0.7.3 && < 0.9,
deepseq >= 1.3 && < 1.5,
ghc-prim,
hashable >= 1.2 && < 1.3,
mtl >= 2 && < 2.3,
- transformers >= 0.2 && < 0.5,
+ transformers >= 0.2 && < 0.6,
transformers-compat >= 0.4 && < 1
if impl(ghc < 7.8)
build-depends:
newtype >= 0.2 && < 0.3,
tagged >= 0.2 && < 1
- else
- exposed-modules:
- Data.Constraint.Forall
exposed-modules:
Data.Constraint
Data.Constraint.Deferrable
+ Data.Constraint.Forall
Data.Constraint.Lifting
Data.Constraint.Unsafe
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/constraints-0.6/src/Data/Constraint/Forall.hs new/constraints-0.8/src/Data/Constraint/Forall.hs
--- old/constraints-0.6/src/Data/Constraint/Forall.hs 2015-11-10 14:16:35.000000000 +0100
+++ new/constraints-0.8/src/Data/Constraint/Forall.hs 2016-01-17 03:10:38.000000000 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
@@ -7,11 +8,14 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE PolyKinds #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE UndecidableSuperClasses #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Constraint.Forall
-- Copyright : (C) 2011-2015 Edward Kmett,
--- (C) 2015 Ørjan Johansen,
+-- (C) 2015 Ørjan Johansen
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett(a)gmail.com>
@@ -95,22 +99,22 @@
-- which would be disastrous.
-- | A representation of the quantified constraint @forall a. p a@.
-type family Forall (p :: k -> Constraint) :: Constraint where
- Forall p = Forall_ p
+type family Forall (p :: k -> Constraint) :: Constraint
+type instance Forall p = Forall_ p
class p (Skolem p) => Forall_ (p :: k -> Constraint)
instance p (Skolem p) => Forall_ (p :: k -> Constraint)
-- | A representation of the quantified constraint @forall a. p (f a)@.
-type family ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) :: Constraint where
- ForallF p f = ForallF_ p f
+type family ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) :: Constraint
+type instance ForallF p f = ForallF_ p f
class p (f (SkolemF p f)) => ForallF_ (p :: k2 -> Constraint) (f :: k1 -> k2)
instance p (f (SkolemF p f)) => ForallF_ (p :: k2 -> Constraint) (f :: k1 -> k2)
type Forall1 p = Forall p
-- | A representation of the quantified constraint @forall f a. p (t f a)@.
-type family ForallT (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3) :: Constraint where
- ForallT p t = ForallT_ p t
+type family ForallT (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3) :: Constraint
+type instance ForallT p t = ForallT_ p t
class p (t (SkolemT1 p t) (SkolemT2 p t)) => ForallT_ (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3)
instance p (t (SkolemT1 p t) (SkolemT2 p t)) => ForallT_ (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/constraints-0.6/src/Data/Constraint/Lifting.hs new/constraints-0.8/src/Data/Constraint/Lifting.hs
--- old/constraints-0.6/src/Data/Constraint/Lifting.hs 2015-11-10 14:16:35.000000000 +0100
+++ new/constraints-0.8/src/Data/Constraint/Lifting.hs 2016-01-17 03:10:38.000000000 +0100
@@ -112,6 +112,17 @@
instance Traversable f => Lifting Traversable (Compose f) where lifting = Sub Dict
instance Applicative f => Lifting Applicative (Compose f) where lifting = Sub Dict
instance Alternative f => Lifting Alternative (Compose f) where lifting = Sub Dict -- overconstrained
+
+#if MIN_VERSION_transformers(0,5,0)
+instance Show1 f => Lifting Show1 (Compose f) where lifting = Sub Dict
+instance Eq1 f => Lifting Eq1 (Compose f) where lifting = Sub Dict
+instance Ord1 f => Lifting Ord1 (Compose f) where lifting = Sub Dict
+instance Read1 f => Lifting Read1 (Compose f) where lifting = Sub Dict
+instance (Eq1 f, Eq1 g) => Lifting Eq (Compose f g) where lifting = Sub Dict
+instance (Ord1 f, Ord1 g) => Lifting Ord (Compose f g) where lifting = Sub Dict
+instance (Read1 f, Read1 g) => Lifting Read (Compose f g) where lifting = Sub Dict
+instance (Show1 f, Show1 g) => Lifting Show (Compose f g) where lifting = Sub Dict
+#else
instance (Functor f, Show1 f) => Lifting Show1 (Compose f) where lifting = Sub Dict
instance (Functor f, Eq1 f) => Lifting Eq1 (Compose f) where lifting = Sub Dict
instance (Functor f, Ord1 f) => Lifting Ord1 (Compose f) where lifting = Sub Dict
@@ -120,6 +131,7 @@
instance (Functor f, Ord1 f, Ord1 g) => Lifting Ord (Compose f g) where lifting = Sub Dict
instance (Functor f, Read1 f, Read1 g) => Lifting Read (Compose f g) where lifting = Sub Dict
instance (Functor f, Show1 f, Show1 g) => Lifting Show (Compose f g) where lifting = Sub Dict
+#endif
instance Functor f => Lifting Functor (Functor.Product f) where lifting = Sub Dict
instance Foldable f => Lifting Foldable (Functor.Product f) where lifting = Sub Dict
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/constraints-0.6/src/Data/Constraint/Unsafe.hs new/constraints-0.8/src/Data/Constraint/Unsafe.hs
--- old/constraints-0.6/src/Data/Constraint/Unsafe.hs 2015-11-10 14:16:35.000000000 +0100
+++ new/constraints-0.8/src/Data/Constraint/Unsafe.hs 2016-01-17 03:10:38.000000000 +0100
@@ -6,6 +6,9 @@
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Unsafe #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Constraint.Unsafe
@@ -56,10 +59,19 @@
unsafeUnderive :: Coercible n o => (o -> n) -> t n :- t o
unsafeUnderive _ = unsafeCoerceConstraint
+
-- | Construct an Applicative instance from a Monad
unsafeApplicative :: forall m a. Monad m => (Applicative m => m a) -> m a
+#if __GLASGOW_HASKELL__ < 710
unsafeApplicative m = m \\ trans (unsafeCoerceConstraint :: Applicative (WrappedMonad m) :- Applicative m) ins
+#else
+unsafeApplicative m = m
+#endif
-- | Construct an Alternative instance from a MonadPlus
unsafeAlternative :: forall m a. MonadPlus m => (Alternative m => m a) -> m a
+#if __GLASGOW_HASKELL__ < 710
unsafeAlternative m = m \\ trans (unsafeCoerceConstraint :: Alternative (WrappedMonad m) :- Alternative m) ins
+#else
+unsafeAlternative m = m
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/constraints-0.6/src/Data/Constraint.hs new/constraints-0.8/src/Data/Constraint.hs
--- old/constraints-0.6/src/Data/Constraint.hs 2015-11-10 14:16:35.000000000 +0100
+++ new/constraints-0.8/src/Data/Constraint.hs 2016-01-17 03:10:38.000000000 +0100
@@ -18,6 +18,12 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RoleAnnotations #-}
#endif
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE UndecidableSuperClasses #-}
+#endif
+#if __GLASGOW_HASKELL__ >= 708 && __GLASGOW_HASKELL__ < 710
+{-# LANGUAGE NullaryTypeClasses #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Constraint
@@ -58,6 +64,7 @@
, weaken1, weaken2, contract
, (&&&), (***)
, trans, refl
+ , Bottom
, top, bottom
-- * Dict is fully faithful
, mapDict
@@ -79,7 +86,12 @@
#if __GLASGOW_HASKELL__ >= 707
import Data.Data
#endif
+#if __GLASGOW_HASKELL__ <= 710
import GHC.Prim (Constraint)
+#else
+import GHC.Types (Constraint)
+#endif
+import qualified GHC.Prim as Prim
-- | Values of type @'Dict' p@ capture a dictionary for a constraint of type @p@.
--
@@ -292,21 +304,14 @@
top :: a :- ()
top = Sub Dict
-type family Ex (a :: *) (c :: Constraint) :: Constraint
-type instance Ex () c = ()
-type instance Ex Bool c = c
-
-falso :: (() ~ a) :- Ex a c
-falso = Sub Dict
+-- | 'Any' inhabits every kind, including 'Constraint' but is uninhabited, making it impossible to define an instance.
+class Prim.Any => Bottom where
+ no :: Dict a
-- |
--- A bad type coercion lets you derive any constraint you want.
---
--- These are the initial arrows of the category and @(() ~ Bool)@ is the initial object
---
-- This demonstrates the law of classical logic <http://en.wikipedia.org/wiki/Principle_of_explosion "ex falso quodlibet">
-bottom :: (() ~ Bool) :- c
-bottom = falso
+bottom :: Bottom :- a
+bottom = Sub no
--------------------------------------------------------------------------------
-- Dict is fully faithful
@@ -375,7 +380,7 @@
instance Class () (b :=> a) where cls = Sub Dict
instance Class b a => () :=> Class b a where ins = Sub Dict
-instance (b :=> a) => () :=> b :=> a where ins = Sub Dict
+instance (b :=> a) => () :=> (b :=> a) where ins = Sub Dict
instance Class () () where cls = Sub Dict
instance () :=> () where ins = Sub Dict
1
0