openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2014
- 1 participants
- 1346 discussions
Hello community,
here is the log from the commit of package ghc-temporary for openSUSE:Factory checked in at 2014-11-26 20:55:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-temporary (Old)
and /work/SRC/openSUSE:Factory/.ghc-temporary.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-temporary"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-temporary/ghc-temporary.changes 2014-04-02 17:18:55.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-temporary.new/ghc-temporary.changes 2014-11-26 20:55:32.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Nov 13 14:50:59 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 1.1.2.5
+* compatibility with Haskell Platform 2014.2.0.0
+* no upstream changelog
+
+-------------------------------------------------------------------
Old:
----
temporary-1.1.2.4.tar.gz
New:
----
temporary-1.1.2.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-temporary.spec ++++++
--- /var/tmp/diff_new_pack.FhBDgg/_old 2014-11-26 20:55:33.000000000 +0100
+++ /var/tmp/diff_new_pack.FhBDgg/_new 2014-11-26 20:55:33.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-temporary
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name temporary
Name: ghc-temporary
-Version: 1.1.2.4
+Version: 1.1.2.5
Release: 0
Summary: Haskell portable temporary file and directory support
License: BSD-3-Clause
++++++ temporary-1.1.2.4.tar.gz -> temporary-1.1.2.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/temporary-1.1.2.4/temporary.cabal new/temporary-1.1.2.5/temporary.cabal
--- old/temporary-1.1.2.4/temporary.cabal 2012-10-04 14:42:49.000000000 +0200
+++ new/temporary-1.1.2.5/temporary.cabal 2013-12-25 11:54:43.000000000 +0100
@@ -1,10 +1,10 @@
name: temporary
-version: 1.1.2.4
+version: 1.1.2.5
cabal-version: >= 1.6
synopsis: Portable temporary file and directory support for Windows and Unix, based on code from Cabal
description: The functions for creating temporary files and directories in the base library are quite limited. The unixutils
package contains some good ones, but they aren't portable to Windows.
-
+
This library just repackages the Cabal implementations of its own temporary file and folder functions so that
you can use them without linking against Cabal or depending on it being installed.
category: System, Utils
@@ -23,6 +23,6 @@
other-modules: Distribution.Compat.Exception
Distribution.Compat.TempFile
build-depends: base >= 3 && < 6, filepath >= 1.1 && < 1.4, directory >= 1.0 && < 1.3
-
+
if !os(windows)
- build-depends: unix >= 2.3 && < 2.7
+ build-depends: unix >= 2.3 && < 2.8
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-semigroups for openSUSE:Factory checked in at 2014-11-26 20:55:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-semigroups (Old)
and /work/SRC/openSUSE:Factory/.ghc-semigroups.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-semigroups"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-semigroups/ghc-semigroups.changes 2014-04-02 17:19:23.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-semigroups.new/ghc-semigroups.changes 2014-11-26 20:55:31.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Nov 13 14:44:19 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.15.4
+* compatibility with Haskell Platform 2014.2.0.0
+* no upstream changelog
+
+-------------------------------------------------------------------
Old:
----
semigroups-0.11.tar.gz
New:
----
semigroups-0.15.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-semigroups.spec ++++++
--- /var/tmp/diff_new_pack.E79NAx/_old 2014-11-26 20:55:32.000000000 +0100
+++ /var/tmp/diff_new_pack.E79NAx/_new 2014-11-26 20:55:32.000000000 +0100
@@ -19,7 +19,7 @@
%global pkg_name semigroups
Name: ghc-semigroups
-Version: 0.11
+Version: 0.15.4
Release: 0
Summary: Anything that associates
License: BSD-2-Clause
@@ -34,6 +34,7 @@
# Begin cabal-rpm deps:
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
+BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-hashable-devel
BuildRequires: ghc-nats-devel
BuildRequires: ghc-text-devel
++++++ semigroups-0.11.tar.gz -> semigroups-0.15.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroups-0.11/LICENSE new/semigroups-0.15.4/LICENSE
--- old/semigroups-0.11/LICENSE 2013-09-17 16:51:22.000000000 +0200
+++ new/semigroups-0.15.4/LICENSE 2014-10-31 23:28:41.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright 2011-2013 Edward Kmett
+Copyright 2011-2014 Edward Kmett
All rights reserved.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroups-0.11/README.markdown new/semigroups-0.15.4/README.markdown
--- old/semigroups-0.11/README.markdown 2013-09-17 16:51:22.000000000 +0200
+++ new/semigroups-0.15.4/README.markdown 2014-10-31 23:28:41.000000000 +0100
@@ -3,8 +3,9 @@
[![Build Status](https://secure.travis-ci.org/ekmett/semigroups.png?branch=master)](…
+Haskellers are usually familiar with monoids. A monoid has an appending operation `<>` or `mappend` and an identity element `mempty`. A Semigroup has an append `<>`, but does not require an `mempty` element. A Monoid can be made a Semigroup with just `instance Semigroup MyMonoid`
-In mathematics, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.
+More formally, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.
Semigroups appear all over the place, except in the Haskell Prelude, so they are packaged here.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroups-0.11/semigroups.cabal new/semigroups-0.15.4/semigroups.cabal
--- old/semigroups-0.11/semigroups.cabal 2013-09-17 16:51:22.000000000 +0200
+++ new/semigroups-0.15.4/semigroups.cabal 2014-10-31 23:28:41.000000000 +0100
@@ -1,6 +1,6 @@
name: semigroups
category: Algebra, Data, Data Structures, Math
-version: 0.11
+version: 0.15.4
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
@@ -9,7 +9,7 @@
stability: provisional
homepage: http://github.com/ekmett/semigroups/
bug-reports: http://github.com/ekmett/semigroups/issues
-copyright: Copyright (C) 2011-2013 Edward A. Kmett
+copyright: Copyright (C) 2011-2014 Edward A. Kmett
synopsis: Anything that associates
description:
In mathematics, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.
@@ -20,34 +20,88 @@
type: git
location: git://github.com/ekmett/semigroups.git
-flag base2
- default: False
- manual: False
+flag hashable
+ description:
+ You can disable the use of the `hashable` package using `-f-hashable`.
+ .
+ Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ .
+ If disabled we will not supply instances of `Hashable`
+ .
+ Note: `-f-hashable` implies `-f-unordered-containers`, as we are necessarily not able to supply those instances as well.
+ default: True
+ manual: True
+
+flag bytestring
+ description:
+ You can disable the use of the `bytestring` package using `-f-bytestring`.
+ .
+ Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ default: True
+ manual: True
+
+flag containers
+ description:
+ You can disable the use of the `containers` package using `-f-containers`.
+ .
+ Disabing this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ default: True
+ manual: True
+
+flag deepseq
+ description:
+ You can disable the use of the `deepseq` package using `-f-deepseq`.
+ .
+ Disabing this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ default: True
+ manual: True
+
+flag text
+ description:
+ You can disable the use of the `text` package using `-f-text`.
+ .
+ Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ default: True
+ manual: True
+
+flag unordered-containers
+ description:
+ You can disable the use of the `unordered-containers` package using `-f-unordered-containers`.
+ .
+ Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.
+ default: True
+ manual: True
library
default-language: Haskell98
- other-extensions: CPP
-
- if !impl(hugs)
- other-extensions: DeriveDataTypeable
- cpp-options: -DLANGUAGE_DeriveDataTypeable
-
- if flag(base2)
- build-depends: base == 2.*
- cpp-options: -DBASE2
- else
- build-depends:
- base >= 3 && < 5,
- bytestring >= 0.9 && < 0.11,
- containers >= 0.3 && < 0.6,
- hashable >= 1.1 && < 1.3,
- nats >= 0.1 && < 1,
- text >= 0.10 && < 0.12,
- unordered-containers >= 0.2 && < 0.3
-
hs-source-dirs: src
- ghc-options: -Wall
+ ghc-options: -Wall
exposed-modules:
Data.Semigroup
Data.List.NonEmpty
+
+ build-depends:
+ base >= 2 && < 5,
+ nats >= 0.1 && < 1
+
+ if impl(ghc >= 7.4 && < 7.5)
+ build-depends: ghc-prim
+
+ if flag(bytestring)
+ build-depends: bytestring >= 0.9 && < 1
+
+ if flag(containers)
+ build-depends: containers >= 0.3 && < 0.6
+
+ if flag(deepseq)
+ build-depends: deepseq >= 1.1 && < 1.4
+
+ if flag(text)
+ build-depends: text >= 0.10 && < 2
+
+ if flag(hashable)
+ build-depends: hashable >= 1.1 && < 1.3
+
+ if flag(hashable) && flag(unordered-containers)
+ build-depends: unordered-containers >= 0.2 && < 0.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroups-0.11/src/Data/List/NonEmpty.hs new/semigroups-0.15.4/src/Data/List/NonEmpty.hs
--- old/semigroups-0.11/src/Data/List/NonEmpty.hs 2013-09-17 16:51:22.000000000 +0200
+++ new/semigroups-0.15.4/src/Data/List/NonEmpty.hs 2014-10-31 23:28:41.000000000 +0100
@@ -1,11 +1,30 @@
{-# LANGUAGE CPP #-}
-#ifdef LANGUAGE_DeriveDataTypeable
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
+#if defined(MIN_VERSION_hashable) || __GLASGOW_HASKELL__ >= 708
+{-# LANGUAGE Trustworthy #-}
+#else
+{-# LANGUAGE Safe #-}
+#endif
+#endif
+
+#ifdef __GLASGOW_HASKELL__
+#define LANGUAGE_DeriveDataTypeable
{-# LANGUAGE DeriveDataTypeable #-}
#endif
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704
+#define LANGUAGE_DeriveGeneric
+{-# LANGUAGE DeriveGeneric #-}
+#endif
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
+{-# LANGUAGE TypeFamilies #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.List.NonEmpty
--- Copyright : (C) 2011-2013 Edward Kmett,
+-- Copyright : (C) 2011-2014 Edward Kmett,
-- (C) 2010 Tony Morris, Oliver Taylor, Eelis van der Weegen
-- License : BSD-style (see the file LICENSE)
--
@@ -27,7 +46,9 @@
, scanr -- :: Foldable f => (a -> b -> b) -> b -> f a -> NonEmpty b
, scanl1 -- :: (a -> a -> a) -> NonEmpty a -> NonEmpty a
, scanr1 -- :: (a -> a -> a) -> NonEmpty a -> NonEmpty a
- -- , transpose -- :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a)
+ , transpose -- :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a)
+ , sortBy -- :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a
+ , sortOn -- :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a
-- * Basic functions
, length -- :: NonEmpty a -> Int
, head -- :: NonEmpty a -> a
@@ -47,6 +68,7 @@
, cycle -- :: NonEmpty a -> NonEmpty a
, unfold -- :: (a -> (b, Maybe a) -> a -> NonEmpty b
, insert -- :: (Foldable f, Ord a) => a -> f a -> NonEmpty a
+ , some1 -- :: Alternative f => f a -> f (NonEmpty a)
-- * Extracting sublists
, take -- :: Int -> NonEmpty a -> [a]
, drop -- :: Int -> NonEmpty a -> [a]
@@ -97,22 +119,43 @@
, length
)
-
import Control.Applicative
--- import Control.Comonad
+
+#ifdef MIN_VERSION_deepseq
+import Control.DeepSeq (NFData(..))
+#endif
+
import Control.Monad
--- import Data.Functor.Alt
+
+#ifdef LANGUAGE_DeriveDataTypeable
+import Data.Data
+#endif
+
+#if MIN_VERSION_base(4,8,0)
+import Data.Foldable hiding (toList, length)
+#else
import Data.Foldable hiding (toList)
+#endif
import qualified Data.Foldable as Foldable
+
+#ifdef MIN_VERSION_hashable
+import Data.Hashable
+#endif
+
import qualified Data.List as List
import Data.Monoid (mappend)
+import Data.Ord (comparing)
import Data.Traversable
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
+import qualified GHC.Exts as Exts
+#endif
-- import Data.Semigroup hiding (Last)
-- import Data.Semigroup.Foldable
-- import Data.Semigroup.Traversable
-#ifdef LANGUAGE_DeriveDataTypeable
-import Data.Data
+#ifdef LANGUAGE_DeriveGeneric
+import GHC.Generics
#endif
infixr 5 :|, <|
@@ -122,8 +165,32 @@
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (NonEmpty a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (a :| as) = p `hashWithSalt` a `hashWithSalt` as
+#else
+ hash (a :| as) = hash a `combine` hash as
+#endif
+#endif
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
+instance Exts.IsList (NonEmpty a) where
+ type Item (NonEmpty a) = a
+ fromList = fromList
+ toList = toList
+#endif
+
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (NonEmpty a) where
+ rnf (x :| xs) = rnf x `seq` rnf xs
+#endif
+
length :: NonEmpty a -> Int
length (_ :| xs) = 1 + Prelude.length xs
{-# INLINE length #-}
@@ -168,22 +235,6 @@
b <$ ~(_ :| as) = b :| (b <$ as)
#endif
-{-
-instance Extend NonEmpty where
- extend f w@ ~(_ :| aas) = f w :| case aas of
- [] -> []
- (a:as) -> toList (extend f (a :| as))
-
-instance Comonad NonEmpty where
- extract ~(a :| _) = a
-
-instance Apply NonEmpty where
- (<.>) = ap
-
-instance Alt NonEmpty where
- (a :| as) <!> ~(b :| bs) = a :| (as ++ b : bs)
--}
-
instance Applicative NonEmpty where
pure a = a :| []
(<*>) = ap
@@ -197,12 +248,6 @@
instance Traversable NonEmpty where
traverse f ~(a :| as) = (:|) <$> f a <*> traverse f as
-{-
-instance Traversable1 NonEmpty where
- traverse1 f (a :| []) = (:|[]) <$> f a
- traverse1 f (a :| (b: bs)) = (\a' (b':| bs') -> a' :| b': bs') <$> f a <.> traverse1 f (b :| bs)
--}
-
instance Foldable NonEmpty where
foldr f z ~(a :| as) = f a (foldr f z as)
foldl f z ~(a :| as) = foldl f (f z a) as
@@ -210,15 +255,6 @@
foldMap f ~(a :| as) = f a `mappend` foldMap f as
fold ~(m :| ms) = m `mappend` fold ms
-{-
-instance Foldable1 NonEmpty where
- foldMap1 f (a :| []) = f a
- foldMap1 f (a :| b : bs) = f a <> foldMap1 f (b :| bs)
-
-instance Semigroup (NonEmpty a) where
- (<>) = (<!>)
--}
-
-- | Extract the first element of the stream.
head :: NonEmpty a -> a
head ~(a :| _) = a
@@ -299,6 +335,11 @@
insert a = fromList . List.insert a . Foldable.toList
{-# INLINE insert #-}
+-- | @'some1' x@ sequences @x@ one or more times.
+some1 :: Alternative f => f a -> f (NonEmpty a)
+some1 x = (:|) <$> x <*> many x
+{-# INLINE some1 #-}
+
-- | 'scanl' is similar to 'foldl', but returns a stream of successive
-- reduced values from the left:
--
@@ -538,3 +579,20 @@
nubBy :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty a
nubBy eq (a :| as) = a :| List.nubBy eq (List.filter (\b -> not (eq a b)) as)
+-- | 'transpose' for 'NonEmpty', behaves the same as 'Data.List.transpose'
+-- The rows/columns need not be the same length, in which case
+-- > transpose . transpose /= id
+transpose :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a)
+transpose = fmap fromList
+ . fromList . List.transpose . Foldable.toList
+ . fmap Foldable.toList
+
+-- | 'sortBy' for 'NonEmpty', behaves the same as 'Data.List.sortBy'
+sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a
+sortBy f = lift (List.sortBy f)
+
+-- | 'sortOn' for 'NonEmpty', behaves the same as:
+--
+-- > sortBy . comparing
+sortOn :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a
+sortOn = sortBy . comparing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/semigroups-0.11/src/Data/Semigroup.hs new/semigroups-0.15.4/src/Data/Semigroup.hs
--- old/semigroups-0.11/src/Data/Semigroup.hs 2013-09-17 16:51:22.000000000 +0200
+++ new/semigroups-0.15.4/src/Data/Semigroup.hs 2014-10-31 23:28:41.000000000 +0100
@@ -1,15 +1,35 @@
{-# LANGUAGE CPP #-}
-#ifdef LANGUAGE_DeriveDataTypeable
+
+#ifdef __GLASGOW_HASKELL__
+#define LANGUAGE_DeriveDataTypeable
{-# LANGUAGE DeriveDataTypeable #-}
#endif
+
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
+#define LANGUAGE_DefaultSignatures
{-# LANGUAGE DefaultSignatures #-}
+#if defined(MIN_VERSION_hashable) || __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE Trustworthy #-}
+#else
+{-# LANGUAGE Safe #-}
+#endif
+#endif
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704
+#define LANGUAGE_DeriveGeneric
+{-# LANGUAGE DeriveGeneric #-}
#endif
+
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
+#define USE_COERCE
+{-# LANGUAGE ScopedTypeVariables #-}
+#endif
+
-----------------------------------------------------------------------------
-- |
-- Module : Data.Semigroup
--- Copyright : (C) 2011-2013 Edward Kmett,
+-- Copyright : (C) 2011-2014 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett(a)gmail.com>
@@ -57,7 +77,7 @@
) where
import Prelude hiding (foldr1)
-import Data.Monoid (Monoid(..),Dual(..),Endo(..),All(..),Any(..),Sum(..),Product(..),Endo(..))
+import Data.Monoid (Monoid(..),Dual(..),Endo(..),All(..),Any(..),Sum(..),Product(..))
import Control.Applicative
import Control.Monad
import Control.Monad.Fix
@@ -65,20 +85,35 @@
import Data.Foldable
import Data.Traversable
import Data.List.NonEmpty
-
import Numeric.Natural.Internal
+
+#ifdef MIN_VERSION_deepseq
+import Control.DeepSeq (NFData(..))
+#endif
+
+#ifdef MIN_VERSION_containers
import Data.Sequence (Seq, (><))
import Data.Set (Set)
import Data.IntSet (IntSet)
import Data.Map (Map)
import Data.IntMap (IntMap)
+#endif
-#ifndef BASE2
+#ifdef MIN_VERSION_bytestring
import Data.ByteString as Strict
import Data.ByteString.Lazy as Lazy
-import Data.Text as Strict
-import Data.Text.Lazy as Lazy
+#endif
+
+#ifdef MIN_VERSION_text
+import qualified Data.Text as Strict
+import qualified Data.Text.Lazy as Lazy
+#endif
+
+#ifdef MIN_VERSION_hashable
import Data.Hashable
+#endif
+
+#ifdef MIN_VERSION_unordered_containers
import Data.HashMap.Lazy as Lazy
import Data.HashSet
#endif
@@ -87,18 +122,30 @@
import Data.Data
#endif
+#ifdef LANGUAGE_DeriveGeneric
+import GHC.Generics
+#endif
+
+#ifdef USE_COERCE
+import Data.Coerce
+#endif
+
infixr 6 <>
class Semigroup a where
-- | An associative operation.
--
- -- > (a <> b) <> c = a <> (b <> c)
+ -- @
+ -- (a '<>' b) '<>' c = a '<>' (b '<>' c)
+ -- @
--
-- If @a@ is also a 'Monoid' we further require
--
- -- > (<>) = mappend
+ -- @
+ -- ('<>') = 'mappend'
+ -- @
(<>) :: a -> a -> a
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
+#ifdef LANGUAGE_DefaultSignatures
default (<>) :: Monoid a => a -> a -> a
(<>) = mappend
#endif
@@ -114,12 +161,14 @@
-- | Repeat a value (n + 1) times.
--
- -- > times1p n a = a <> a <> ... <> a -- using <> n times
+ -- @
+ -- 'times1p' n a = a '<>' a '<>' ... '<>' a -- using '<>' n times
+ -- @
--
-- The default definition uses peasant multiplication, exploiting associativity to only
-- require /O(log n)/ uses of @\<\>@.
--
- -- See also 'times'.
+ -- See also 'timesN'.
times1p :: Whole n => n -> a -> a
times1p y0 x0 = f x0 (1 Prelude.+ y0)
@@ -189,21 +238,48 @@
times1p n (Dual a) = Dual (times1p n a)
instance Semigroup (Endo a) where
+#ifdef USE_COERCE
+ (<>) = coerce ((.) :: (a -> a) -> (a -> a) -> (a -> a))
+#else
Endo f <> Endo g = Endo (f . g)
+#endif
instance Semigroup All where
+#ifdef USE_COERCE
+ (<>) = coerce (&&)
+#else
All a <> All b = All (a && b)
+#endif
times1p _ a = a
instance Semigroup Any where
+#ifdef USE_COERCE
+ (<>) = coerce (||)
+#else
Any a <> Any b = Any (a || b)
+#endif
times1p _ a = a
instance Num a => Semigroup (Sum a) where
+#ifdef USE_COERCE
+ (<>) = coerce ((+) :: a -> a -> a)
+#else
Sum a <> Sum b = Sum (a + b)
+#endif
instance Num a => Semigroup (Product a) where
+#ifdef USE_COERCE
+ (<>) = coerce ((*) :: a -> a -> a)
+#else
Product a <> Product b = Product (a * b)
+#endif
+
+instance Semigroup a => Semigroup (Const a b) where
+#ifdef USE_COERCE
+ (<>) = coerce ((<>) :: a -> a -> a)
+#else
+ Const a <> Const b = Const (a <> b)
+#endif
#if MIN_VERSION_base(3,0,0)
instance Semigroup (Monoid.First a) where
@@ -221,75 +297,304 @@
(a :| as) <> ~(b :| bs) = a :| (as ++ b : bs)
newtype Min a = Min { getMin :: a } deriving
- ( Eq, Ord, Bounded, Show, Read
+ ( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+instance Bounded a => Bounded (Min a) where
+ minBound = Min minBound
+ maxBound = Min maxBound
+
+instance Enum a => Enum (Min a) where
+ succ (Min a) = Min (succ a)
+ pred (Min a) = Min (pred a)
+ toEnum = Min . toEnum
+ fromEnum = fromEnum . getMin
+ enumFrom (Min a) = Min <$> enumFrom a
+ enumFromThen (Min a) (Min b) = Min <$> enumFromThen a b
+ enumFromTo (Min a) (Min b) = Min <$> enumFromTo a b
+ enumFromThenTo (Min a) (Min b) (Min c) = Min <$> enumFromThenTo a b c
+
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (Min a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (Min a) = hashWithSalt p a
+#else
+ hash (Min a) = hash a
+#endif
+#endif
+
instance Ord a => Semigroup (Min a) where
+#ifdef USE_COERCE
+ (<>) = coerce (min :: a -> a -> a)
+#else
Min a <> Min b = Min (a `min` b)
+#endif
times1p _ a = a
instance (Ord a, Bounded a) => Monoid (Min a) where
mempty = maxBound
mappend = (<>)
+instance Functor Min where
+ fmap f (Min x) = Min (f x)
+
+instance Foldable Min where
+ foldMap f (Min a) = f a
+
+instance Traversable Min where
+ traverse f (Min a) = Min <$> f a
+
+instance Applicative Min where
+ pure = Min
+ a <* _ = a
+ _ *> a = a
+ Min f <*> Min x = Min (f x)
+
+instance Monad Min where
+ return = Min
+ _ >> a = a
+ Min a >>= f = f a
+
+instance MonadFix Min where
+ mfix f = fix (f . getMin)
+
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (Min a) where
+ rnf (Min a) = rnf a
+#endif
+
newtype Max a = Max { getMax :: a } deriving
- ( Eq, Ord, Bounded, Show, Read
+ ( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+instance Bounded a => Bounded (Max a) where
+ minBound = Max minBound
+ maxBound = Max maxBound
+
+instance Enum a => Enum (Max a) where
+ succ (Max a) = Max (succ a)
+ pred (Max a) = Max (pred a)
+ toEnum = Max . toEnum
+ fromEnum = fromEnum . getMax
+ enumFrom (Max a) = Max <$> enumFrom a
+ enumFromThen (Max a) (Max b) = Max <$> enumFromThen a b
+ enumFromTo (Max a) (Max b) = Max <$> enumFromTo a b
+ enumFromThenTo (Max a) (Max b) (Max c) = Max <$> enumFromThenTo a b c
+
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (Max a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (Max a) = hashWithSalt p a
+#else
+ hash (Max a) = hash a
+#endif
+#endif
+
instance Ord a => Semigroup (Max a) where
+#ifdef USE_COERCE
+ (<>) = coerce (max :: a -> a -> a)
+#else
Max a <> Max b = Max (a `max` b)
+#endif
times1p _ a = a
instance (Ord a, Bounded a) => Monoid (Max a) where
mempty = minBound
mappend = (<>)
+instance Functor Max where
+ fmap f (Max x) = Max (f x)
+
+instance Foldable Max where
+ foldMap f (Max a) = f a
+
+instance Traversable Max where
+ traverse f (Max a) = Max <$> f a
+
+instance Applicative Max where
+ pure = Max
+ a <* _ = a
+ _ *> a = a
+ Max f <*> Max x = Max (f x)
+
+instance Monad Max where
+ return = Max
+ _ >> a = a
+ Max a >>= f = f a
+
+instance MonadFix Max where
+ mfix f = fix (f . getMax)
+
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (Max a) where
+ rnf (Max a) = rnf a
+#endif
+
-- | Use @'Option' ('First' a)@ to get the behavior of 'Data.Monoid.First' from @Data.Monoid@.
newtype First a = First { getFirst :: a } deriving
- ( Eq, Ord, Bounded, Show, Read
+ ( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data
, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+instance Bounded a => Bounded (First a) where
+ minBound = First minBound
+ maxBound = First maxBound
+
+instance Enum a => Enum (First a) where
+ succ (First a) = First (succ a)
+ pred (First a) = First (pred a)
+ toEnum = First . toEnum
+ fromEnum = fromEnum . getFirst
+ enumFrom (First a) = First <$> enumFrom a
+ enumFromThen (First a) (First b) = First <$> enumFromThen a b
+ enumFromTo (First a) (First b) = First <$> enumFromTo a b
+ enumFromThenTo (First a) (First b) (First c) = First <$> enumFromThenTo a b c
+
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (First a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (First a) = hashWithSalt p a
+#else
+ hash (First a) = hash a
+#endif
+#endif
+
instance Semigroup (First a) where
a <> _ = a
times1p _ a = a
+instance Functor First where
+ fmap f (First x) = First (f x)
+
+instance Foldable First where
+ foldMap f (First a) = f a
+
+instance Traversable First where
+ traverse f (First a) = First <$> f a
+
+instance Applicative First where
+ pure x = First x
+ a <* _ = a
+ _ *> a = a
+ First f <*> First x = First (f x)
+
+instance Monad First where
+ return = First
+ _ >> a = a
+ First a >>= f = f a
+
+instance MonadFix First where
+ mfix f = fix (f . getFirst)
+
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (First a) where
+ rnf (First a) = rnf a
+#endif
+
-- | Use @'Option' ('Last' a)@ to get the behavior of 'Data.Monoid.Last' from @Data.Monoid@
newtype Last a = Last { getLast :: a } deriving
- ( Eq, Ord, Bounded, Show, Read
+ ( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+instance Bounded a => Bounded (Last a) where
+ minBound = Last minBound
+ maxBound = Last maxBound
+
+instance Enum a => Enum (Last a) where
+ succ (Last a) = Last (succ a)
+ pred (Last a) = Last (pred a)
+ toEnum = Last . toEnum
+ fromEnum = fromEnum . getLast
+ enumFrom (Last a) = Last <$> enumFrom a
+ enumFromThen (Last a) (Last b) = Last <$> enumFromThen a b
+ enumFromTo (Last a) (Last b) = Last <$> enumFromTo a b
+ enumFromThenTo (Last a) (Last b) (Last c) = Last <$> enumFromThenTo a b c
+
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (Last a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (Last a) = hashWithSalt p a
+#else
+ hash (Last a) = hash a
+#endif
+#endif
+
instance Semigroup (Last a) where
_ <> b = b
times1p _ a = a
+instance Functor Last where
+ fmap f (Last x) = Last (f x)
+ a <$ _ = Last a
+
+instance Foldable Last where
+ foldMap f (Last a) = f a
+
+instance Traversable Last where
+ traverse f (Last a) = Last <$> f a
+
+instance Applicative Last where
+ pure = Last
+ a <* _ = a
+ _ *> a = a
+ Last f <*> Last x = Last (f x)
+
+instance Monad Last where
+ return = Last
+ _ >> a = a
+ Last a >>= f = f a
+
+instance MonadFix Last where
+ mfix f = fix (f . getLast)
+
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (Last a) where
+ rnf (Last a) = rnf a
+#endif
+
-- (==)/XNOR on Bool forms a 'Semigroup', but has no good name
-#ifndef BASE2
+#ifdef MIN_VERSION_bytestring
instance Semigroup Strict.ByteString where
(<>) = mappend
instance Semigroup Lazy.ByteString where
(<>) = mappend
+#endif
+#ifdef MIN_VERSION_text
instance Semigroup Strict.Text where
(<>) = mappend
instance Semigroup Lazy.Text where
(<>) = mappend
+#endif
+#ifdef MIN_VERSION_unordered_containers
instance (Hashable k, Eq k) => Semigroup (Lazy.HashMap k a) where
(<>) = mappend
@@ -301,22 +606,57 @@
-- | Provide a Semigroup for an arbitrary Monoid.
newtype WrappedMonoid m = WrapMonoid
{ unwrapMonoid :: m } deriving
- ( Eq, Ord, Bounded, Show, Read
+ ( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (WrappedMonoid a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (WrapMonoid a) = hashWithSalt p a
+#else
+ hash (WrapMonoid a) = hash a
+#endif
+#endif
+
instance Monoid m => Semigroup (WrappedMonoid m) where
+#ifdef USE_COERCE
+ (<>) = coerce (mappend :: m -> m -> m)
+#else
WrapMonoid a <> WrapMonoid b = WrapMonoid (a `mappend` b)
+#endif
instance Monoid m => Monoid (WrappedMonoid m) where
mempty = WrapMonoid mempty
- WrapMonoid a `mappend` WrapMonoid b = WrapMonoid (a `mappend` b)
+ mappend = (<>)
+
+instance Bounded a => Bounded (WrappedMonoid a) where
+ minBound = WrapMonoid minBound
+ maxBound = WrapMonoid maxBound
+
+instance Enum a => Enum (WrappedMonoid a) where
+ succ (WrapMonoid a) = WrapMonoid (succ a)
+ pred (WrapMonoid a) = WrapMonoid (pred a)
+ toEnum = WrapMonoid . toEnum
+ fromEnum = fromEnum . unwrapMonoid
+ enumFrom (WrapMonoid a) = WrapMonoid <$> enumFrom a
+ enumFromThen (WrapMonoid a) (WrapMonoid b) = WrapMonoid <$> enumFromThen a b
+ enumFromTo (WrapMonoid a) (WrapMonoid b) = WrapMonoid <$> enumFromTo a b
+ enumFromThenTo (WrapMonoid a) (WrapMonoid b) (WrapMonoid c) = WrapMonoid <$> enumFromThenTo a b c
+
+#ifdef MIN_VERSION_deepseq
+instance NFData m => NFData (WrappedMonoid m) where
+ rnf (WrapMonoid a) = rnf a
+#endif
-- | Repeat a value @n@ times.
--
--- > times n a = a <> a <> ... <> a -- using <> (n-1) times
+-- > timesN n a = a <> a <> ... <> a -- using <> (n-1) times
--
-- Implemented using 'times1p'.
timesN :: (Whole n, Monoid a) => n -> a -> a
@@ -325,16 +665,30 @@
{-# INLINE timesN #-}
--- | Option is effectively 'Maybe' with a better instance of 'Monoid', built off of an underlying 'Semigroup'
--- instead of an underlying 'Monoid'. Ideally, this type would not exist at all and we would just fix the 'Monoid' intance of 'Maybe'
+-- | 'Option' is effectively 'Maybe' with a better instance of 'Monoid', built off of an underlying 'Semigroup'
+-- instead of an underlying 'Monoid'.
+--
+-- Ideally, this type would not exist at all and we would just fix the 'Monoid' instance of 'Maybe'
newtype Option a = Option
{ getOption :: Maybe a } deriving
( Eq, Ord, Show, Read
#ifdef LANGUAGE_DeriveDataTypeable
, Data, Typeable
#endif
+#ifdef LANGUAGE_DeriveGeneric
+ , Generic
+#endif
)
+#ifdef MIN_VERSION_hashable
+instance Hashable a => Hashable (Option a) where
+#if MIN_VERSION_hashable(1,2,0)
+ hashWithSalt p (Option a) = hashWithSalt p a
+#else
+ hash (Option a) = hash a
+#endif
+#endif
+
instance Functor Option where
fmap f (Option a) = Option (fmap f a)
@@ -371,21 +725,31 @@
traverse f (Option (Just a)) = Option . Just <$> f a
traverse _ (Option Nothing) = pure (Option Nothing)
+#ifdef MIN_VERSION_deepseq
+instance NFData a => NFData (Option a) where
+ rnf (Option a) = rnf a
+#endif
+
-- | Fold an 'Option' case-wise, just like 'maybe'.
option :: b -> (a -> b) -> Option a -> b
option n j (Option m) = maybe n j m
instance Semigroup a => Semigroup (Option a) where
+#ifdef USE_COERCE
+ (<>) = coerce ((<>) :: Maybe a -> Maybe a -> Maybe a)
+#else
Option a <> Option b = Option (a <> b)
+#endif
instance Semigroup a => Monoid (Option a) where
mempty = Option Nothing
- Option a `mappend` Option b = Option (a <> b)
+ mappend = (<>)
--- | This lets you use a difference list of a Semigroup as a Monoid.
+-- | This lets you use a difference list of a 'Semigroup' as a 'Monoid'.
diff :: Semigroup m => m -> Endo m
diff = Endo . (<>)
+#ifdef MIN_VERSION_containers
instance Semigroup (Seq a) where
(<>) = (><)
@@ -404,3 +768,4 @@
instance Ord k => Semigroup (Map k v) where
(<>) = mappend
times1p _ a = a
+#endif
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-pcre-light for openSUSE:Factory checked in at 2014-11-26 20:55:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-pcre-light (Old)
and /work/SRC/openSUSE:Factory/.ghc-pcre-light.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-pcre-light"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-pcre-light/ghc-pcre-light.changes 2014-04-02 17:18:51.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-pcre-light.new/ghc-pcre-light.changes 2014-11-26 20:55:30.000000000 +0100
@@ -1,0 +2,6 @@
+Sun Nov 9 18:09:28 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.4.0.3
+* compatibility with ghc 7.8
+
+-------------------------------------------------------------------
Old:
----
pcre-light-0.4.tar.gz
New:
----
pcre-light-0.4.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-pcre-light.spec ++++++
--- /var/tmp/diff_new_pack.Vd8N9w/_old 2014-11-26 20:55:31.000000000 +0100
+++ /var/tmp/diff_new_pack.Vd8N9w/_new 2014-11-26 20:55:31.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-pcre-light
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name pcre-light
Name: ghc-pcre-light
-Version: 0.4
+Version: 0.4.0.3
Release: 0
Summary: Haskell library for Perl 5 compatible regular expressions
License: BSD-3-Clause
@@ -32,6 +32,7 @@
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
# Begin cabal-rpm deps:
+BuildRequires: ghc-bytestring-devel
BuildRequires: pcre-devel
# End cabal-rpm deps
@@ -81,6 +82,5 @@
%files devel -f %{name}-devel.files
%defattr(-,root,root)
-%doc TODO
%changelog
++++++ pcre-light-0.4.tar.gz -> pcre-light-0.4.0.3.tar.gz ++++++
++++ 4659 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-blaze-markup for openSUSE:Factory checked in at 2014-11-26 20:55:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-blaze-markup (Old)
and /work/SRC/openSUSE:Factory/.ghc-blaze-markup.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-blaze-markup"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-blaze-markup/ghc-blaze-markup.changes 2014-04-02 17:18:45.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-blaze-markup.new/ghc-blaze-markup.changes 2014-11-26 20:55:29.000000000 +0100
@@ -1,0 +2,8 @@
+Sun Nov 9 15:45:37 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.6.1.1
+* Bump `text` dependency to allow 1.2 (Haskell Platform 2014.2.0.0)
+* Add the `null` query to Text.Blaze.Internal.
+* Add the operator (!?) for nicely setting conditional attributes
+
+-------------------------------------------------------------------
Old:
----
blaze-markup-0.5.1.5.tar.gz
New:
----
blaze-markup-0.6.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-blaze-markup.spec ++++++
--- /var/tmp/diff_new_pack.DuBxR0/_old 2014-11-26 20:55:30.000000000 +0100
+++ /var/tmp/diff_new_pack.DuBxR0/_new 2014-11-26 20:55:30.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-blaze-markup
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name blaze-markup
Name: ghc-blaze-markup
-Version: 0.5.1.5
+Version: 0.6.1.1
Release: 0
Summary: A blazingly fast markup combinator library for Haskell
License: BSD-3-Clause
++++++ blaze-markup-0.5.1.5.tar.gz -> blaze-markup-0.6.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-markup-0.5.1.5/CHANGELOG new/blaze-markup-0.6.1.1/CHANGELOG
--- old/blaze-markup-0.5.1.5/CHANGELOG 1970-01-01 01:00:00.000000000 +0100
+++ new/blaze-markup-0.6.1.1/CHANGELOG 2014-09-11 11:09:18.000000000 +0200
@@ -0,0 +1,12 @@
+- 0.6.1.1
+ * Bump `text` dependency to allow 1.2
+
+- 0.6.1.0
+ * Add the `null` query to Text.Blaze.Internal.
+
+- 0.6.0.0
+ * Add the operator (!?) for nicely setting conditional attributes
+
+- 0.5.2.0
+ * Provide ToHtml and ToValue instances for Int32, Int64, Word, Word32,
+ and Word64
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-markup-0.5.1.5/blaze-markup.cabal new/blaze-markup-0.6.1.1/blaze-markup.cabal
--- old/blaze-markup-0.5.1.5/blaze-markup.cabal 2013-03-08 17:18:29.000000000 +0100
+++ new/blaze-markup-0.6.1.1/blaze-markup.cabal 2014-09-11 11:09:18.000000000 +0200
@@ -1,5 +1,5 @@
Name: blaze-markup
-Version: 0.5.1.5
+Version: 0.6.1.1
Homepage: http://jaspervdj.be/blaze
Bug-Reports: http://github.com/jaspervdj/blaze-markup/issues
License: BSD3
@@ -18,6 +18,9 @@
Build-type: Simple
Cabal-version: >= 1.8
+Extra-source-files:
+ CHANGELOG
+
Library
Hs-source-dirs: src
Ghc-Options: -Wall
@@ -33,7 +36,7 @@
Build-depends:
base >= 4 && < 5,
blaze-builder >= 0.2 && < 0.4,
- text >= 0.10 && < 0.12,
+ text >= 0.10 && < 1.3,
bytestring >= 0.9 && < 0.11
Test-suite blaze-markup-tests
@@ -48,7 +51,7 @@
Build-depends:
HUnit >= 1.2 && < 1.3,
- QuickCheck >= 2.4 && < 2.7,
+ QuickCheck >= 2.4 && < 2.8,
containers >= 0.3 && < 0.6,
test-framework >= 0.4 && < 0.9,
test-framework-hunit >= 0.3 && < 0.4,
@@ -56,7 +59,7 @@
-- Copied from regular dependencies...
base >= 4 && < 5,
blaze-builder >= 0.2 && < 0.4,
- text >= 0.10 && < 0.12,
+ text >= 0.10 && < 1.3,
bytestring >= 0.9 && < 0.11
Source-repository head
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-markup-0.5.1.5/src/Text/Blaze/Internal.hs new/blaze-markup-0.6.1.1/src/Text/Blaze/Internal.hs
--- old/blaze-markup-0.5.1.5/src/Text/Blaze/Internal.hs 2013-03-08 17:18:29.000000000 +0100
+++ new/blaze-markup-0.6.1.1/src/Text/Blaze/Internal.hs 2014-09-11 11:09:18.000000000 +0200
@@ -53,14 +53,20 @@
-- * Setting attributes
, Attributable
, (!)
+ , (!?)
-- * Modifying Markup elements
, contents
, external
+
+ -- * Querying Markup elements
+ , null
) where
+import Prelude hiding (null)
import Data.Monoid (Monoid, mappend, mempty, mconcat)
import Unsafe.Coerce (unsafeCoerce)
+import qualified Data.List as List
import Data.ByteString.Char8 (ByteString)
import Data.Text (Text)
@@ -412,6 +418,19 @@
h ! f = (! f) . h
{-# INLINE (!) #-}
+-- | Shorthand for setting an attribute depending on a conditional.
+--
+-- Example:
+--
+-- > p !? (isBig, A.class "big") $ "Hello"
+--
+-- Gives the same result as:
+--
+-- > (if isBig then p ! A.class "big" else p) "Hello"
+--
+(!?) :: Attributable h => h -> (Bool, Attribute) -> h
+(!?) h (c, a) = if c then h ! a else h
+
-- | Mark HTML as external data. External data can be:
--
-- * CSS data in a @<style>@ tag;
@@ -449,3 +468,29 @@
contents (AddAttribute _ _ _ c) = contents c
contents (AddCustomAttribute _ _ c) = contents c
contents _ = Empty
+
+-- | Check if a 'Markup' value is completely empty (renders to the empty
+-- string).
+null :: MarkupM a -> Bool
+null markup = case markup of
+ Parent _ _ _ _ -> False
+ CustomParent _ _ -> False
+ Leaf _ _ _ -> False
+ CustomLeaf _ _ -> False
+ Content c -> emptyChoiceString c
+ Append c1 c2 -> null c1 && null c2
+ AddAttribute _ _ _ c -> null c
+ AddCustomAttribute _ _ c -> null c
+ Empty -> True
+ where
+ emptyChoiceString cs = case cs of
+ Static ss -> emptyStaticString ss
+ String s -> List.null s
+ Text t -> T.null t
+ ByteString bs -> B.null bs
+ PreEscaped c -> emptyChoiceString c
+ External c -> emptyChoiceString c
+ AppendChoiceString c1 c2 -> emptyChoiceString c1 && emptyChoiceString c2
+ EmptyChoiceString -> True
+
+ emptyStaticString = B.null . getUtf8ByteString
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-markup-0.5.1.5/src/Text/Blaze.hs new/blaze-markup-0.6.1.1/src/Text/Blaze.hs
--- old/blaze-markup-0.5.1.5/src/Text/Blaze.hs 2013-03-08 17:18:29.000000000 +0100
+++ new/blaze-markup-0.6.1.1/src/Text/Blaze.hs 2014-09-11 11:09:18.000000000 +0200
@@ -60,12 +60,15 @@
-- * Setting attributes
, (!)
+ , (!?)
-- * Modifiying Markup trees
, contents
) where
import Data.Monoid (mconcat)
+import Data.Int (Int32, Int64)
+import Data.Word (Word, Word32, Word64)
import Data.Text (Text)
import qualified Data.Text.Lazy as LT
@@ -115,6 +118,14 @@
toMarkup = string . show
{-# INLINE toMarkup #-}
+instance ToMarkup Int32 where
+ toMarkup = string . show
+ {-# INLINE toMarkup #-}
+
+instance ToMarkup Int64 where
+ toMarkup = string . show
+ {-# INLINE toMarkup #-}
+
instance ToMarkup Char where
toMarkup = string . return
{-# INLINE toMarkup #-}
@@ -135,6 +146,18 @@
toMarkup = string . show
{-# INLINE toMarkup #-}
+instance ToMarkup Word where
+ toMarkup = string . show
+ {-# INLINE toMarkup #-}
+
+instance ToMarkup Word32 where
+ toMarkup = string . show
+ {-# INLINE toMarkup #-}
+
+instance ToMarkup Word64 where
+ toMarkup = string . show
+ {-# INLINE toMarkup #-}
+
-- | Class allowing us to use a single function for attribute values
--
class ToValue a where
@@ -174,6 +197,14 @@
toValue = stringValue . show
{-# INLINE toValue #-}
+instance ToValue Int32 where
+ toValue = stringValue . show
+ {-# INLINE toValue #-}
+
+instance ToValue Int64 where
+ toValue = stringValue . show
+ {-# INLINE toValue #-}
+
instance ToValue Char where
toValue = stringValue . return
{-# INLINE toValue #-}
@@ -193,3 +224,15 @@
instance ToValue Double where
toValue = stringValue . show
{-# INLINE toValue #-}
+
+instance ToValue Word where
+ toValue = stringValue . show
+ {-# INLINE toValue #-}
+
+instance ToValue Word32 where
+ toValue = stringValue . show
+ {-# INLINE toValue #-}
+
+instance ToValue Word64 where
+ toValue = stringValue . show
+ {-# INLINE toValue #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-markup-0.5.1.5/tests/Text/Blaze/Tests.hs new/blaze-markup-0.6.1.1/tests/Text/Blaze/Tests.hs
--- old/blaze-markup-0.5.1.5/tests/Text/Blaze/Tests.hs 2013-03-08 17:18:29.000000000 +0100
+++ new/blaze-markup-0.6.1.1/tests/Text/Blaze/Tests.hs 2014-09-11 11:09:18.000000000 +0200
@@ -1,16 +1,17 @@
{-# LANGUAGE OverloadedStrings, FlexibleInstances, TypeSynonymInstances #-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module Text.Blaze.Tests
( tests
) where
-import Prelude hiding (div, id)
-import Data.Monoid (mempty)
+import Prelude hiding (div, id, null)
+import Data.Monoid (mempty, mappend)
import Control.Monad (replicateM)
import Control.Applicative ((<$>))
import Data.Word (Word8)
import Data.Char (ord)
-import Data.List (isInfixOf)
+import qualified Data.List as List
import Test.Framework (Test)
import Test.HUnit (Assertion, (@=?))
@@ -35,7 +36,10 @@
, testProperty "well nested <>" wellNestedBrackets
, testProperty "unsafeByteString id" unsafeByteStringId
+ , testCase "conditional attributes" conditionalAttributes
, testCase "contents 1" contents1
+ , testCase "empty 1" empty1
+ , testCase "empty 2" empty2
]
-- | The left identity Monoid law.
@@ -100,7 +104,7 @@
-- | Check if the "</" sequence does not appear in @<script>@ or @<style>@ tags.
--
externalEndSequence :: String -> Bool
-externalEndSequence = not . isInfixOf "</" . LBC.unpack
+externalEndSequence = not . List.isInfixOf "</" . LBC.unpack
. renderUsingUtf8 . external . string
-- | Check that the "<>" characters are well-nested.
@@ -114,6 +118,14 @@
'>' -> if isOpen then wellNested False xs else False
_ -> wellNested isOpen xs
+conditionalAttributes :: Assertion
+conditionalAttributes =
+ "<p class=\"foo\">Hello</p><p id=\"2nd\">World</p>" @=? renderUsingUtf8 html
+ where
+ html = do
+ p !? (4 > length [()], class_ "foo") $ "Hello"
+ p !? (List.null [()], class_ "bar") !? (True, id "2nd") $ "World"
+
contents1 :: Assertion
contents1 = "Hello World!" @=? renderUsingUtf8 (contents html)
where
@@ -123,6 +135,21 @@
img ! name "An image"
p "World!"
+empty1 :: Assertion
+empty1 = True @=? null html
+ where
+ html :: Markup
+ html = do
+ ""
+ ""
+ mempty
+
+empty2 :: Assertion
+empty2 = False @=? null html
+ where
+ html :: Markup
+ html = "" `mappend` "" `mappend` p "a"
+
-- Show instance for the HTML type, so we can debug.
--
instance Show Markup where
@@ -148,7 +175,7 @@
--
arbitraryMarkup :: Int -- ^ Maximum depth.
-> Gen Markup -- ^ Resulting arbitrary HTML snippet.
-arbitraryMarkup depth = do
+arbitraryMarkup depth = do
-- Choose the size (width) of this element.
size <- choose (0, 3)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-blaze-builder for openSUSE:Factory checked in at 2014-11-26 20:55:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-blaze-builder (Old)
and /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-blaze-builder"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-blaze-builder/ghc-blaze-builder.changes 2014-04-02 17:19:30.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-blaze-builder.new/ghc-blaze-builder.changes 2014-11-26 20:55:28.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Sep 24 10:16:47 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.3.3.4
+* compatibility with Haskell Platform 2014.2.0.0 (ghc-text)
+
+-------------------------------------------------------------------
Old:
----
blaze-builder-0.3.1.1.tar.gz
New:
----
_service
blaze-builder-0.3.3.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-blaze-builder.spec ++++++
--- /var/tmp/diff_new_pack.qV2XTh/_old 2014-11-26 20:55:29.000000000 +0100
+++ /var/tmp/diff_new_pack.qV2XTh/_new 2014-11-26 20:55:29.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-blaze-builder
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name blaze-builder
Name: ghc-blaze-builder
-Version: 0.3.1.1
+Version: 0.3.3.4
Release: 0
Summary: Haskell library for efficient buffered output
License: BSD-3-Clause
++++++ _service ++++++
<services>
<service name="download_files" mode="localonly"/>
</services>
++++++ blaze-builder-0.3.1.1.tar.gz -> blaze-builder-0.3.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Buffer.hs new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Buffer.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Buffer.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Buffer.hs 2014-09-17 07:58:54.000000000 +0200
@@ -18,7 +18,7 @@
--
module Blaze.ByteString.Builder.Internal.Buffer (
-- * Buffers
- Buffer
+ Buffer (..)
-- ** Status information
, freeSize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Types.hs new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Types.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal/Types.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal/Types.hs 2014-09-17 07:58:54.000000000 +0200
@@ -19,9 +19,7 @@
--
module Blaze.ByteString.Builder.Internal.Types where
-#ifdef APPLICATIVE_IN_BASE
import Control.Applicative
-#endif
import Data.Monoid
import qualified Data.ByteString as S
@@ -86,7 +84,6 @@
fmap f (Put put) = Put $ \k -> put (\x -> k (f x))
{-# INLINE fmap #-}
-#ifdef APPLICATIVE_IN_BASE
instance Applicative Put where
pure x = Put $ \k -> k x
{-# INLINE pure #-}
@@ -96,7 +93,6 @@
{-# INLINE (<*) #-}
a *> b = Put $ \k -> unPut a (\_ -> unPut b k)
{-# INLINE (*>) #-}
-#endif
instance Monad Put where
return x = Put $ \k -> k x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal.hs new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder/Internal.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder/Internal.hs 2014-09-17 07:58:54.000000000 +0200
@@ -39,6 +39,7 @@
-- * Writes
, module Blaze.ByteString.Builder.Internal.Write
+ , writeToByteString
-- * Execution
, toLazyByteString
@@ -62,6 +63,11 @@
#endif
import Control.Monad (unless)
+#if MIN_VERSION_base(4,4,0)
+import System.IO.Unsafe (unsafeDupablePerformIO)
+#else
+import System.IO.Unsafe (unsafePerformIO)
+#endif
import qualified Data.ByteString as S
import qualified Data.ByteString.Internal as S
@@ -357,6 +363,24 @@
toByteStringIO = toByteStringIOWith defaultBufferSize
{-# INLINE toByteStringIO #-}
+unsafeIO :: IO a -> a
+#if MIN_VERSION_base(4,4,0)
+unsafeIO = unsafeDupablePerformIO
+#else
+unsafeIO = unsafePerformIO
+#endif
+
+-- | Run a 'Write' to produce a strict 'S.ByteString'.
+-- This is equivalent to @('toByteString' . 'fromWrite')@, but is more
+-- efficient because it uses just one appropriately-sized buffer.
+writeToByteString :: Write -> S.ByteString
+writeToByteString !w = unsafeIO $ do
+ fptr <- S.mallocByteString (getBound w)
+ len <- withForeignPtr fptr $ \ptr -> do
+ end <- runWrite w ptr
+ return $! end `minusPtr` ptr
+ return $! S.fromForeignPtr fptr 0 len
+{-# INLINE writeToByteString #-}
------------------------------------------------------------------------------
-- Draft of new builder/put execution code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder.hs new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder.hs
--- old/blaze-builder-0.3.1.1/Blaze/ByteString/Builder.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/Blaze/ByteString/Builder.hs 2014-09-17 07:58:54.000000000 +0200
@@ -79,6 +79,7 @@
, fromWrite
, fromWriteSingleton
, fromWriteList
+ , writeToByteString
-- ** Writing 'Storable's
, writeStorable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/CHANGES new/blaze-builder-0.3.3.4/CHANGES
--- old/blaze-builder-0.3.1.1/CHANGES 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/CHANGES 2014-09-17 07:58:54.000000000 +0200
@@ -1,3 +1,11 @@
+* 0.3.3.0
+ - exposed the 'Buffer' constructor to enable keeping around a pool of
+ buffers.
+
+* 0.3.2.0
+ - added 'writeToByteString' to construct a strict bytestring in a single
+ step. We can actually view 'Write's as strict-bytestring builders.
+
* 0.3.1.1
- Changed imports of Foreign.Unsafe to make it GHC 7.8 compatible
- -Wall clean on GHC 7.0 - 7.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/README.markdown new/blaze-builder-0.3.3.4/README.markdown
--- old/blaze-builder-0.3.1.1/README.markdown 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/README.markdown 2014-09-17 07:58:54.000000000 +0200
@@ -4,7 +4,7 @@
This library allows to efficiently serialize Haskell values to lazy bytestrings
with a large average chunk size. The large average chunk size allows to make
good use of cache prefetching in later processing steps (e.g. compression) and
-reduces the sytem call overhead when writing the resulting lazy bytestring to a
+reduces the system call overhead when writing the resulting lazy bytestring to a
file or sending it over the network.
This library was inspired by the module Data.Binary.Builder provided by the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/benchmarks/Throughput/BlazePutMonad.hs new/blaze-builder-0.3.3.4/benchmarks/Throughput/BlazePutMonad.hs
--- old/blaze-builder-0.3.1.1/benchmarks/Throughput/BlazePutMonad.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/benchmarks/Throughput/BlazePutMonad.hs 2014-09-17 07:58:54.000000000 +0200
@@ -59,9 +59,7 @@
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
-#ifdef APPLICATIVE_IN_BASE
import Control.Applicative
-#endif
------------------------------------------------------------------------
@@ -82,14 +80,12 @@
fmap f m = Put $ let PairS a w = unPut m in PairS (f a) w
{-# INLINE fmap #-}
-#ifdef APPLICATIVE_IN_BASE
instance Applicative PutM where
pure = return
m <*> k = Put $
let PairS f w = unPut m
PairS x w' = unPut k
in PairS (f x) (w `mappend` w')
-#endif
-- Standard Writer monad, with aggressive inlining
instance Monad PutM where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/blaze-builder.cabal new/blaze-builder-0.3.3.4/blaze-builder.cabal
--- old/blaze-builder-0.3.1.1/blaze-builder.cabal 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/blaze-builder.cabal 2014-09-17 07:58:54.000000000 +0200
@@ -1,5 +1,5 @@
Name: blaze-builder
-Version: 0.3.1.1
+Version: 0.3.3.4
Synopsis: Efficient buffered output.
Description:
@@ -9,12 +9,12 @@
Haskell values to lazy bytestrings with a large average
chunk size. The large average chunk size allows to make
good use of cache prefetching in later processing steps
- (e.g. compression) and reduces the sytem call overhead
+ (e.g. compression) and reduces the system call overhead
when writing the resulting lazy bytestring to a file or
sending it over the network.
Author: Jasper Van der Jeugt, Simon Meier
-Copyright: 2010 Simon Meier
+Copyright: 2010-2014 Simon Meier
2010 Jasper Van der Jeugt
Maintainer: Simon Meier <iridcode(a)gmail.com>
@@ -75,4 +75,4 @@
build-depends: base == 4.* ,
bytestring >= 0.9 && < 1.0 ,
- text >= 0.10 && < 0.13
+ text >= 0.10 && < 1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blaze-builder-0.3.1.1/tests/Tests.hs new/blaze-builder-0.3.3.4/tests/Tests.hs
--- old/blaze-builder-0.3.1.1/tests/Tests.hs 2013-03-24 13:38:49.000000000 +0100
+++ new/blaze-builder-0.3.3.4/tests/Tests.hs 2014-09-17 07:58:54.000000000 +0200
@@ -32,6 +32,7 @@
, testProperty "string and text" stringAndText
, testProperty "lazy bytestring identity" identityLazyByteString
, testProperty "flushing identity" identityFlushing
+ , testProperty "writeToByteString" writeToByteStringProp
, testCase "escaping case 1" escaping1
, testCase "escaping case 2" escaping2
, testCase "escaping case 3" escaping3
@@ -66,6 +67,9 @@
b2 = fromString s2
in b1 `mappend` b2 == b1 `mappend` flush `mappend` b2
+writeToByteStringProp :: Write -> Bool
+writeToByteStringProp w = toByteString (fromWrite w) == writeToByteString w
+
escaping1 :: Assertion
escaping1 = fromString "<hello>" @?= fromHtmlEscapedString "<hello>"
@@ -78,6 +82,9 @@
instance Show Builder where
show = show . toLazyByteString
+instance Show Write where
+ show = show . fromWrite
+
instance Eq Builder where
b1 == b2 =
-- different and small buffer sizses for testing wrapping behaviour
@@ -92,5 +99,11 @@
instance Arbitrary Builder where
arbitrary = (mconcat . replicate numRepetitions . fromString) <$> arbitrary
+instance Arbitrary Write where
+ arbitrary = mconcat . map singleWrite <$> arbitrary
+ where
+ singleWrite (Left bs) = writeByteString (LB.toStrict bs)
+ singleWrite (Right w) = writeWord8 w
+
instance Arbitrary LB.ByteString where
arbitrary = (LB.concat . replicate numRepetitions . LB.pack) <$> arbitrary
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package haskell-platform for openSUSE:Factory checked in at 2014-11-26 20:55:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/haskell-platform (Old)
and /work/SRC/openSUSE:Factory/.haskell-platform.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "haskell-platform"
Changes:
--------
--- /work/SRC/openSUSE:Factory/haskell-platform/haskell-platform.changes 2014-08-25 11:06:16.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.haskell-platform.new/haskell-platform.changes 2014-11-26 20:55:26.000000000 +0100
@@ -1,0 +2,19 @@
+Mon Oct 27 17:09:53 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- fix requires version number for cabal-install
+
+-------------------------------------------------------------------
+Sat Oct 18 15:30:17 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- fix Requires for happy (wrong version)
+
+-------------------------------------------------------------------
+Fri Sep 12 07:00:07 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 2014.2.0.0
+- add unknown-buildtool.patch
+* fix detection of hscolour version
+* remove cabal-install detection (unknown buildtool error)
+- enable build on ppc64 and ppc64le
+
+-------------------------------------------------------------------
Old:
----
haskell-platform-2013.2.0.0.tar.gz
New:
----
haskell-platform-2014.2.0.0-srcdist.tar.gz
unknown-buildtool.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ haskell-platform.spec ++++++
--- /var/tmp/diff_new_pack.o9Y1Tj/_old 2014-11-26 20:55:27.000000000 +0100
+++ /var/tmp/diff_new_pack.o9Y1Tj/_new 2014-11-26 20:55:27.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package haskell-platform
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -28,17 +28,17 @@
# ghci (ghc library) is not officially part of Haskell Platform
%define platform_progs()\
-%{?1}Requires: ghc-compiler = 7.6.3\
-%{?1}Requires: cabal-install = 1.16.0.2\
-%{?1}Requires: alex = 3.0.5\
-%{?1}Requires: happy = 1.18.10\
+%{?1}Requires: ghc-compiler = 7.8.3\
+%{?1}Requires: cabal-install = 1.18.0.5\
+%{?1}Requires: alex = 3.1.3\
+%{?1}Requires: happy = 1.19.4\
%{?1}Requires: hscolour = 1.20.3\
%{nil}
-%global platform_progs_versions ghc-compiler = 7.6.3 cabal-install = 1.16.0.2 alex = 3.0.5 happy = 1.18.10 hscolour = 1.20.3
+%global platform_progs_versions ghc-compiler = 7.8.3 cabal-install = 1.18.0.5 alex = 3.1.3 happy = 1.19.4 hscolour = 1.20.3
Name: haskell-platform
-Version: 2013.2.0.0
+Version: 2014.2.0.0
Release: 0
Summary: Standard Haskell distribution
License: BSD-3-Clause
@@ -46,31 +46,32 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# BEGIN cabal2spec
Url: http://hackage.haskell.org/platform
-Source0: http://lambda.haskell.org/platform/download/%{version}/%{name}-%{version}.t…
-ExclusiveArch: %{ix86} x86_64 ppc
+Source0: http://www.haskell.org/platform/download/%{version}/%{name}-%{version}-srcd…
+# PATCH-FIX-OPENSUSE unknown-buildtool.patch peter.trommler(a)ohm-hochschule.de -- depending on cabal-install results in Unknown build tool error
+Patch: unknown-buildtool.patch
+
BuildRequires: %{platform_progs_versions}
BuildRequires: ghc-Cabal-devel
-BuildRequires: ghc-GLURaw-devel = 1.3.0.0
-BuildRequires: ghc-GLUT-devel = 2.4.0.0
-BuildRequires: ghc-HTTP-devel = 4000.2.8
+BuildRequires: ghc-GLURaw-devel = 1.4.0.1
+BuildRequires: ghc-GLUT-devel = 2.5.1.1
+BuildRequires: ghc-HTTP-devel = 4000.2.10
BuildRequires: ghc-HUnit-devel = 1.2.5.2
-BuildRequires: ghc-OpenGL-devel = 2.8.0.0
-BuildRequires: ghc-OpenGLRaw-devel = 1.3.0.0
+BuildRequires: ghc-OpenGL-devel = 2.9.2.0
+BuildRequires: ghc-OpenGLRaw-devel = 1.5.0.0
BuildRequires: ghc-QuickCheck-devel = 2.6
-BuildRequires: ghc-async-devel = 2.0.1.4
+BuildRequires: ghc-async-devel = 2.0.1.5
BuildRequires: ghc-attoparsec-devel = 0.10.4.0
-BuildRequires: ghc-case-insensitive-devel = 1.0.0.1
-BuildRequires: ghc-cgi-devel = 3001.1.7.5
-BuildRequires: ghc-fgl-devel = 5.4.2.4
-BuildRequires: ghc-hashable-devel = 1.1.2.5
-BuildRequires: ghc-haskell-src-devel = 1.0.1.5
+BuildRequires: ghc-case-insensitive-devel = 1.1.0.3
+BuildRequires: ghc-fgl-devel = 5.5.0.1
+BuildRequires: ghc-hashable-devel = 1.2.2.0
+BuildRequires: ghc-haskell-src-devel = 1.0.1.6
BuildRequires: ghc-html-devel = 1.0.1.2
-BuildRequires: ghc-libraries = 7.6.3
-BuildRequires: ghc-mtl-devel = 2.1.2
-BuildRequires: ghc-network-devel = 2.4.1.2
-BuildRequires: ghc-parallel-devel = 3.2.0.3
-BuildRequires: ghc-parsec-devel = 3.1.3
-BuildRequires: ghc-primitive = 0.5.0.1
+BuildRequires: ghc-libraries = 7.8.3
+BuildRequires: ghc-mtl-devel = 2.1.3.1
+BuildRequires: ghc-network-devel = 2.4.2.3
+BuildRequires: ghc-parallel-devel = 3.2.0.4
+BuildRequires: ghc-parsec-devel = 3.1.5
+BuildRequires: ghc-primitive = 0.5.2.1
BuildRequires: ghc-random-devel = 1.0.1.1
BuildRequires: ghc-regex-base-devel = 0.93.2
BuildRequires: ghc-regex-compat-devel = 0.95.1
@@ -78,11 +79,10 @@
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-split-devel = 0.2.2
BuildRequires: ghc-stm-devel = 2.4.2
-BuildRequires: ghc-syb-devel = 0.4.0
-BuildRequires: ghc-text-devel = 0.11.3.1
-BuildRequires: ghc-transformers-devel = 0.3.0.0
-BuildRequires: ghc-unordered-containers-devel = 0.2.3.0
-BuildRequires: ghc-vector-devel = 0.10.0.1
+BuildRequires: ghc-syb-devel = 0.4.1
+BuildRequires: ghc-text-devel = 1.1.0.0
+BuildRequires: ghc-unordered-containers-devel = 0.2.4.0
+BuildRequires: ghc-vector-devel = 0.10.9.1
BuildRequires: ghc-xhtml-devel = 3000.2.1
BuildRequires: ghc-zlib-devel = 0.5.4.1
# END cabal2spec
@@ -99,39 +99,37 @@
Requires(post): ghc-compiler
Requires(postun): ghc-compiler
Requires: %{name} = %{version}-%{release}
-# order here follows http://hackage.haskell.org/platform/changelog.html
-Requires: ghc-GLURaw-devel = 1.3.0.0
-Requires: ghc-GLUT-devel = 2.4.0.0
-Requires: ghc-HTTP-devel = 4000.2.8
+Requires: ghc-GLURaw-devel = 1.4.0.1
+Requires: ghc-GLUT-devel = 2.5.1.1
+Requires: ghc-HTTP-devel = 4000.2.10
Requires: ghc-HUnit-devel = 1.2.5.2
-Requires: ghc-OpenGL-devel = 2.8.0.0
-Requires: ghc-OpenGLRaw-devel = 1.3.0.0
+Requires: ghc-OpenGL-devel = 2.9.2.0
+Requires: ghc-OpenGLRaw-devel = 1.5.0.0
Requires: ghc-QuickCheck-devel = 2.6
-Requires: ghc-async-devel = 2.0.1.4
+Requires: ghc-async-devel = 2.0.1.5
Requires: ghc-attoparsec-devel = 0.10.4.0
-Requires: ghc-case-insensitive-devel = 1.0.0.1
-Requires: ghc-cgi-devel = 3001.1.7.5
-Requires: ghc-fgl-devel = 5.4.2.4
-Requires: ghc-hashable-devel = 1.1.2.5
-Requires: ghc-haskell-src-devel = 1.0.1.5
+Requires: ghc-case-insensitive-devel = 1.1.0.3
+Requires: ghc-fgl-devel = 5.5.0.1
+Requires: ghc-hashable-devel = 1.2.2.0
+Requires: ghc-haskell-src-devel = 1.0.1.6
Requires: ghc-html-devel = 1.0.1.2
-Requires: ghc-libraries = 7.6.3
-Requires: ghc-mtl-devel = 2.1.2
-Requires: ghc-network-devel = 2.4.1.2
-Requires: ghc-parallel-devel = 3.2.0.3
-Requires: ghc-parsec-devel = 3.1.3
-Requires: ghc-primitive = 0.5.0.1
+Requires: ghc-libraries = 7.8.3
+Requires: ghc-mtl-devel = 2.1.3.1
+Requires: ghc-network-devel = 2.4.2.3
+Requires: ghc-parallel-devel = 3.2.0.4
+Requires: ghc-parsec-devel = 3.1.5
+Requires: ghc-primitive = 0.5.2.1
Requires: ghc-random-devel = 1.0.1.1
Requires: ghc-regex-base-devel = 0.93.2
Requires: ghc-regex-compat-devel = 0.95.1
Requires: ghc-regex-posix-devel = 0.95.2
+Requires: ghc-rpm-macros
Requires: ghc-split-devel = 0.2.2
Requires: ghc-stm-devel = 2.4.2
-Requires: ghc-syb-devel = 0.4.0
-Requires: ghc-text-devel = 0.11.3.1
-Requires: ghc-transformers-devel = 0.3.0.0
-Requires: ghc-unordered-containers-devel = 0.2.3.0
-Requires: ghc-vector-devel = 0.10.0.1
+Requires: ghc-syb-devel = 0.4.1
+Requires: ghc-text-devel = 1.1.0.0
+Requires: ghc-unordered-containers-devel = 0.2.4.0
+Requires: ghc-vector-devel = 0.10.9.1
Requires: ghc-xhtml-devel = 3000.2.1
Requires: ghc-zlib-devel = 0.5.4.1
@@ -143,20 +141,22 @@
%prep
%setup -q -n %{name}-%{version}
+%patch -p1
%build
-cd %{top_prefix}
+# cd %{top_prefix}
+cp hptool/Setup.hs .
%ghc_lib_build
%install
-TOPDIR=$(pwd)
-cd %{top_prefix}
+# TOPDIR=$(pwd)
+# cd %{top_prefix}
%ghc_lib_install
-mv ghc-%{name}-devel.files $TOPDIR
-if [ -e debugsources.list ]; then
- mv debugsources.list $TOPDIR;
-fi
+# mv ghc-%{name}-devel.files $TOPDIR
+# if [ -e debugsources.list ]; then
+# mv debugsources.list $TOPDIR;
+# fi
%post -n ghc-%{pkg_name}-devel
%ghc_pkg_recache
@@ -166,10 +166,11 @@
%files -n ghc-%{pkg_name}-devel -f ghc-%{pkg_name}-devel.files
%defattr(-,root,root,-)
-%doc %{top_prefix}/LICENSE
+# %doc %{top_prefix}/LICENSE
%files
%defattr(-,root,root,-)
-%doc %{top_prefix}/LICENSE
+%doc LICENSE
+# %doc %{top_prefix}/LICENSE
%changelog
++++++ unknown-buildtool.patch ++++++
Index: haskell-platform-2014.2.0.0/haskell-platform.cabal
===================================================================
--- haskell-platform-2014.2.0.0.orig/haskell-platform.cabal
+++ haskell-platform-2014.2.0.0/haskell-platform.cabal
@@ -103,7 +103,6 @@ library
-- Depending on programs does not work, they are not registered
-- We list them to help distro packaging.
build-tools:
- cabal-install ==1.18.0.5,
alex ==3.1.3,
happy ==1.19.4,
- hscolour ==1.20.3
+ hscolour ==1.20
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package happy for openSUSE:Factory checked in at 2014-11-26 20:55:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/happy (Old)
and /work/SRC/openSUSE:Factory/.happy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "happy"
Changes:
--------
--- /work/SRC/openSUSE:Factory/happy/happy.changes 2014-08-25 11:06:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.happy.new/happy.changes 2014-11-26 20:55:24.000000000 +0100
@@ -1,0 +2,10 @@
+Fri Sep 12 06:55:24 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 1.19.4
+* fix manual page
+* fix build with ghc 7.8 and (future) 7.10
+* Haskell Platform 2014.2.0.0
+- drop happy-1.18.6-generate-man-page.patch
+* fixed upstream
+
+-------------------------------------------------------------------
Old:
----
happy-1.18.10.tar.gz
happy-1.18.6-generate-man-page.patch
New:
----
happy-1.19.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ happy.spec ++++++
--- /var/tmp/diff_new_pack.OUBkiY/_old 2014-11-26 20:55:25.000000000 +0100
+++ /var/tmp/diff_new_pack.OUBkiY/_new 2014-11-26 20:55:25.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package happy
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,11 @@
Name: happy
-Version: 1.18.10
+Version: 1.19.4
Release: 0
# BEGIN cabal2spec
Url: http://hackage.haskell.org/package/%{name}
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{ve…
-# PATCH-FIX-UPSTREAM happy-1.18.6-generate-man-page.patch -- peter.trommler(a)ohm-hochschule.de
-Patch: happy-1.18.6-generate-man-page.patch
BuildRequires: autoconf
BuildRequires: docbook-dtd
BuildRequires: docbook-xsl-stylesheets
@@ -58,7 +56,6 @@
%prep
%setup -q
-%patch -p1
%build
%ghc_bin_build
++++++ happy-1.18.10.tar.gz -> happy-1.19.4.tar.gz ++++++
++++ 8883 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-zlib for openSUSE:Factory checked in at 2014-11-26 20:55:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-zlib (Old)
and /work/SRC/openSUSE:Factory/.ghc-zlib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-zlib"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-zlib/ghc-zlib.changes 2014-08-25 11:06:14.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-zlib.new/ghc-zlib.changes 2014-11-26 20:55:23.000000000 +0100
@@ -1,0 +2,5 @@
+Fri Sep 12 06:54:28 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update copyright notice (year) in spec file
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-zlib.spec ++++++
--- /var/tmp/diff_new_pack.5Kmt7v/_old 2014-11-26 20:55:24.000000000 +0100
+++ /var/tmp/diff_new_pack.5Kmt7v/_new 2014-11-26 20:55:24.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-zlib
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-vector for openSUSE:Factory checked in at 2014-11-26 20:55:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vector (Old)
and /work/SRC/openSUSE:Factory/.ghc-vector.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vector"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-vector/ghc-vector.changes 2014-10-19 19:28:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-vector.new/ghc-vector.changes 2014-11-26 20:55:21.000000000 +0100
@@ -1,0 +2,10 @@
+Sat Oct 18 15:12:40 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.10.9.1
+* no changelog
+* Haskell Platform 2014.2.0.0
+- regenerate spec file
+- drop vector-debian-no_ann_without_ghci.patch
+* we have ghci for all platforms now
+
+-------------------------------------------------------------------
Old:
----
vector-0.10.0.1.tar.gz
vector-debian-no_ann_without_ghci.patch
New:
----
vector-0.10.9.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-vector.spec ++++++
--- /var/tmp/diff_new_pack.85gnwH/_old 2014-11-26 20:55:23.000000000 +0100
+++ /var/tmp/diff_new_pack.85gnwH/_new 2014-11-26 20:55:23.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-vector
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,46 +18,44 @@
%global pkg_name vector
-%global common_summary Haskell %{pkg_name} library
-
-%global common_description A %{pkg_name} library for Haskell.
-
Name: ghc-vector
-Version: 0.10.0.1
+Version: 0.10.9.1
Release: 0
-Summary: %{common_summary}
+Summary: Efficient Arrays
License: BSD-3-Clause
Group: System/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# BEGIN cabal2spec
Url: http://hackage.haskell.org/package/%{pkg_name}
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_na…
-Patch0: vector-debian-no_ann_without_ghci.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-primitive-devel
-BuildRequires: ghc-rpm-macros
-# END cabal2spec
+# End cabal-rpm deps
%description
-%{common_description}
+An efficient implementation of Int-indexed arrays (both mutable and immutable),
+with a powerful loop optimisation framework.
+
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Languages/Other
-Requires: ghc-compiler
-Requires(post): ghc-compiler
-Requires(postun): ghc-compiler
+Group: Development/Libraries/Other
+Provides: %{name}-static = %{version}-%{release}
+Requires: ghc-compiler = %{ghc_version}
+Requires(post): ghc-compiler = %{ghc_version}
+Requires(postun): ghc-compiler = %{ghc_version}
Requires: %{name} = %{version}-%{release}
%description devel
-%{common_description}
-This package contains the development files.
+This package provides the Haskell %{pkg_name} library development files.
+
%prep
%setup -q -n %{pkg_name}-%{version}
-%patch0 -p1
%build
%ghc_lib_build
++++++ vector-0.10.0.1.tar.gz -> vector-0.10.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-0.10.0.1/Data/Vector/Generic.hs new/vector-0.10.9.1/Data/Vector/Generic.hs
--- old/vector-0.10.0.1/Data/Vector/Generic.hs 2012-10-10 23:46:53.000000000 +0200
+++ new/vector-0.10.9.1/Data/Vector/Generic.hs 2013-09-26 05:59:56.000000000 +0200
@@ -194,7 +194,12 @@
showsPrec )
import qualified Text.Read as Read
+
+#if __GLASGOW_HASKELL__ >= 707
+import Data.Typeable ( Typeable, gcast1 )
+#else
import Data.Typeable ( Typeable1, gcast1 )
+#endif
#include "vector.h"
@@ -2020,7 +2025,11 @@
{-# INLINE mkType #-}
mkType = mkNoRepType
+#if __GLASGOW_HASKELL__ >= 707
+dataCast :: (Vector v a, Data a, Typeable v, Typeable t)
+#else
dataCast :: (Vector v a, Data a, Typeable1 v, Typeable1 t)
+#endif
=> (forall d. Data d => c (t d)) -> Maybe (c (v a))
{-# INLINE dataCast #-}
dataCast f = gcast1 f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-0.10.0.1/Data/Vector/Unboxed/Base.hs new/vector-0.10.9.1/Data/Vector/Unboxed/Base.hs
--- old/vector-0.10.0.1/Data/Vector/Unboxed/Base.hs 2012-10-10 23:46:53.000000000 +0200
+++ new/vector-0.10.9.1/Data/Vector/Unboxed/Base.hs 2013-09-26 05:59:56.000000000 +0200
@@ -1,4 +1,7 @@
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-}
+#if __GLASGOW_HASKELL__ >= 707
+{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
+#endif
{-# OPTIONS_HADDOCK hide #-}
-- |
@@ -31,6 +34,9 @@
import Data.Int ( Int8, Int16, Int32, Int64 )
import Data.Complex
+#if __GLASGOW_HASKELL__ >= 707
+import Data.Typeable ( Typeable )
+#else
import Data.Typeable ( Typeable1(..), Typeable2(..), mkTyConApp,
#if MIN_VERSION_base(4,4,0)
mkTyCon3
@@ -38,6 +44,8 @@
mkTyCon
#endif
)
+#endif
+
import Data.Data ( Data(..) )
#include "vector.h"
@@ -58,7 +66,10 @@
-- -----------------
-- Data and Typeable
-- -----------------
-
+#if __GLASGOW_HASKELL__ >= 707
+deriving instance Typeable Vector
+deriving instance Typeable MVector
+#else
#if MIN_VERSION_base(4,4,0)
vectorTyCon = mkTyCon3 "vector"
#else
@@ -70,6 +81,7 @@
instance Typeable2 MVector where
typeOf2 _ = mkTyConApp (vectorTyCon "Data.Vector.Unboxed.Mutable" "MVector") []
+#endif
instance (Data a, Unbox a) => Data (Vector a) where
gfoldl = G.gfoldl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-0.10.0.1/README.md new/vector-0.10.9.1/README.md
--- old/vector-0.10.0.1/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/vector-0.10.9.1/README.md 2013-09-26 05:59:56.000000000 +0200
@@ -0,0 +1,4 @@
+# The vector package
+
+An efficient implementation of Int-indexed arrays (both mutable and
+immutable), with a powerful loop optimisation framework.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-0.10.0.1/tests/vector-tests.cabal new/vector-0.10.9.1/tests/vector-tests.cabal
--- old/vector-0.10.0.1/tests/vector-tests.cabal 2012-10-10 23:46:53.000000000 +0200
+++ new/vector-0.10.9.1/tests/vector-tests.cabal 2013-09-26 05:59:56.000000000 +0200
@@ -11,14 +11,14 @@
Description:
Tests for the vector package
-Cabal-Version: >= 1.2
+Cabal-Version: >= 1.6
Build-Type: Simple
Executable "vector-tests-O0"
Main-Is: Main.hs
- Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10.0.1,
+ Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10.9.1,
random,
QuickCheck >= 2, test-framework, test-framework-quickcheck2
@@ -38,7 +38,7 @@
Executable "vector-tests-O2"
Main-Is: Main.hs
- Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10.0.1,
+ Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10.9.1,
random,
QuickCheck >= 2, test-framework, test-framework-quickcheck2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vector-0.10.0.1/vector.cabal new/vector-0.10.9.1/vector.cabal
--- old/vector-0.10.0.1/vector.cabal 2012-10-10 23:46:53.000000000 +0200
+++ new/vector-0.10.9.1/vector.cabal 2013-09-26 05:59:56.000000000 +0200
@@ -1,12 +1,12 @@
Name: vector
-Version: 0.10.0.1
+Version: 0.10.9.1
License: BSD3
License-File: LICENSE
Author: Roman Leshchinskiy <rl(a)cse.unsw.edu.au>
Maintainer: Roman Leshchinskiy <rl(a)cse.unsw.edu.au>
Copyright: (c) Roman Leshchinskiy 2008-2012
-Homepage: http://code.haskell.org/vector
-Bug-Reports: http://trac.haskell.org/vector
+Homepage: https://github.com/haskell/vector
+Bug-Reports: https://github.com/haskell/vector/issues
Category: Data, Data Structures
Synopsis: Efficient Arrays
Description:
@@ -33,11 +33,6 @@
.
* <http://haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial>
.
- Please use the project trac to submit bug reports and feature
- requests.
- .
- * <http://trac.haskell.org/vector>
- .
Changes in version 0.10.0.1
.
* Require @primitive@ to include workaround for a GHC array copying bug
@@ -51,10 +46,11 @@
* Safe Haskell support removed
.
-Cabal-Version: >= 1.2.3
+Cabal-Version: >= 1.6
Build-Type: Simple
Extra-Source-Files:
+ README.md
tests/vector-tests.cabal
tests/LICENSE
tests/Setup.hs
@@ -151,3 +147,6 @@
if flag(InternalChecks)
cpp-options: -DVECTOR_INTERNAL_CHECKS
+source-repository head
+ type: git
+ location: https://github.com/haskell/vector
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ghc-unordered-containers for openSUSE:Factory checked in at 2014-11-26 20:55:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unordered-containers (Old)
and /work/SRC/openSUSE:Factory/.ghc-unordered-containers.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unordered-containers"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unordered-containers/ghc-unordered-containers.changes 2014-08-25 11:06:10.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-unordered-containers.new/ghc-unordered-containers.changes 2014-11-26 20:55:19.000000000 +0100
@@ -1,0 +2,12 @@
+Fri Sep 12 06:48:21 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- update to 0.2.4.0
+* no changelog
+* Haskell Platform 2014.2.0.0
+
+-------------------------------------------------------------------
+Tue Sep 2 10:25:16 UTC 2014 - peter.trommler(a)ohm-hochschule.de
+
+- regenerate spec file
+
+-------------------------------------------------------------------
Old:
----
unordered-containers-0.2.3.0.tar.gz
New:
----
unordered-containers-0.2.4.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-unordered-containers.spec ++++++
--- /var/tmp/diff_new_pack.hcQsNU/_old 2014-11-26 20:55:20.000000000 +0100
+++ /var/tmp/diff_new_pack.hcQsNU/_new 2014-11-26 20:55:20.000000000 +0100
@@ -1,8 +1,7 @@
#
# spec file for package ghc-unordered-containers
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# Copyright (c) 2012 Peter Trommler peter.trommler(a)ohm-hochschule.de
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,43 +18,46 @@
%global pkg_name unordered-containers
-%global common_summary Haskell %{pkg_name} library
-
-%global common_description A %{pkg_name} library for Haskell.
-
Name: ghc-unordered-containers
-Version: 0.2.3.0
+Version: 0.2.4.0
Release: 0
-Summary: %{common_summary}
+Summary: Efficient hashing-based container types
License: BSD-3-Clause
Group: System/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# BEGIN cabal2spec
Url: http://hackage.haskell.org/package/%{pkg_name}
Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_na…
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %{!?without_hscolour:hscolour}
+
BuildRequires: ghc-Cabal-devel
+BuildRequires: ghc-rpm-macros
+# Begin cabal-rpm deps:
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-hashable-devel
-BuildRequires: ghc-rpm-macros
-# END cabal2spec
+# End cabal-rpm deps
%description
-%{common_description}
+Efficient hashing-based container types. The containers have been optimized for
+performance critical use, both in terms of large data quantities and high
+speed.
+
+The declared cost of each operation is either worst-case or amortized, but
+remains valid even if structures are shared.
+
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Languages/Other
-Requires: ghc-compiler
-Requires(post): ghc-compiler
-Requires(postun): ghc-compiler
+Group: Development/Libraries/Other
+Provides: %{name}-static = %{version}-%{release}
+Requires: ghc-compiler = %{ghc_version}
+Requires(post): ghc-compiler = %{ghc_version}
+Requires(postun): ghc-compiler = %{ghc_version}
Requires: %{name} = %{version}-%{release}
%description devel
-%{common_description}
-This package contains the development files.
+This package provides the Haskell %{pkg_name} library development
+files.
+
%prep
%setup -q -n %{pkg_name}-%{version}
++++++ unordered-containers-0.2.3.0.tar.gz -> unordered-containers-0.2.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/Data/HashMap/Array.hs new/unordered-containers-0.2.4.0/Data/HashMap/Array.hs
--- old/unordered-containers-0.2.3.0/Data/HashMap/Array.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/Data/HashMap/Array.hs 2014-04-12 12:40:40.000000000 +0200
@@ -52,10 +52,23 @@
import Control.Applicative (Applicative)
import Control.DeepSeq
import Control.Monad.ST hiding (runST)
-import GHC.Exts
+-- GHC 7.7 exports toList/fromList from GHC.Exts
+-- In order to avoid warnings on previous GHC versions, we provide
+-- an explicit import list instead of only hiding the offending symbols
+import GHC.Exts (Array#, Int(..), newArray#, readArray#, writeArray#,
+ indexArray#, unsafeFreezeArray#, unsafeThawArray#,
+ MutableArray#)
import GHC.ST (ST(..))
import Prelude hiding (filter, foldr, length, map, read)
+
+#if __GLASGOW_HASKELL__ >= 702
+import GHC.Exts (sizeofArray#, copyArray#, thawArray#, sizeofMutableArray#,
+ copyMutableArray#)
+#endif
+
+#if defined(ASSERTS)
import qualified Prelude
+#endif
import Data.HashMap.Unsafe (runST)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/Data/HashMap/Base.hs new/unordered-containers-0.2.4.0/Data/HashMap/Base.hs
--- old/unordered-containers-0.2.3.0/Data/HashMap/Base.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/Data/HashMap/Base.hs 2014-04-12 12:40:40.000000000 +0200
@@ -31,6 +31,7 @@
-- * Transformations
, map
+ , mapWithKey
, traverseWithKey
-- * Difference and intersection
@@ -58,6 +59,7 @@
, fromListWith
-- Internals used by the strict version
+ , Hash
, Bitmap
, bitmapIndexedOrFull
, collision
@@ -79,11 +81,13 @@
import Control.DeepSeq (NFData(rnf))
import Control.Monad.ST (ST)
import Data.Bits ((.&.), (.|.), complement)
+import Data.Data hiding (Typeable)
import qualified Data.Foldable as Foldable
import qualified Data.List as L
import Data.Monoid (Monoid(mempty, mappend))
import Data.Traversable (Traversable(..))
import Data.Word (Word)
+import GHC.Exts ((==#), build, reallyUnsafePtrEquality#)
import Prelude hiding (filter, foldr, lookup, map, null, pred)
import qualified Data.HashMap.Array as A
@@ -94,11 +98,11 @@
import Data.HashMap.UnsafeShift (unsafeShiftL, unsafeShiftR)
import Data.Typeable (Typeable)
-#if defined(__GLASGOW_HASKELL__)
-import Data.Data hiding (Typeable)
-import GHC.Exts ((==#), build, reallyUnsafePtrEquality#)
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Exts (isTrue#)
#endif
+
------------------------------------------------------------------------
-- | Convenience function. Compute a hash value for the given value.
@@ -143,7 +147,6 @@
mappend = union
{-# INLINE mappend #-}
-#if __GLASGOW_HASKELL__
instance (Data k, Data v, Eq k, Hashable k) => Data (HashMap k v) where
gfoldl f z m = z fromList `f` toList m
toConstr _ = fromListConstr
@@ -158,7 +161,6 @@
hashMapDataType :: DataType
hashMapDataType = mkDataType "Data.HashMap.Base.HashMap" [fromListConstr]
-#endif
type Hash = Word
type Bitmap = Word
@@ -237,14 +239,12 @@
member k m = case lookup k m of
Nothing -> False
Just _ -> True
-#if __GLASGOW_HASKELL__ >= 700
-{-# INLINEABLE member #-}
-#endif
+{-# INLINABLE member #-}
-- | /O(log n)/ Return the value to which the specified key is mapped,
-- or 'Nothing' if this map contains no mapping for the key.
lookup :: (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
-lookup k0 = go h0 k0 0
+lookup k0 m0 = go h0 k0 0 m0
where
h0 = hash k0
go !_ !_ !_ Empty = Nothing
@@ -259,9 +259,7 @@
go h k _ (Collision hx v)
| h == hx = lookupInArray k v
| otherwise = Nothing
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE lookup #-}
-#endif
-- | /O(log n)/ Return the value to which the specified key is mapped,
-- or the default value if this map contains no mapping for the key.
@@ -316,7 +314,7 @@
| otherwise = runST (two s h k x hy ky y)
go h k x s t@(BitmapIndexed b ary)
| b .&. m == 0 =
- let ary' = A.insert ary i $! Leaf h (L k x)
+ let !ary' = A.insert ary i $! Leaf h (L k x)
in bitmapIndexedOrFull (b .|. m) ary'
| otherwise =
let !st = A.index ary i
@@ -336,9 +334,7 @@
go h k x s t@(Collision hy v)
| h == hy = Collision h (updateOrSnocWith const k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE insert #-}
-#endif
-- | In-place update version of insert
unsafeInsert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
@@ -373,9 +369,7 @@
go h k x s t@(Collision hy v)
| h == hy = return $! Collision h (updateOrSnocWith const k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE unsafeInsert #-}
-#endif
-- | Create a map from two key-value pairs which hashes don't collide.
two :: Shift -> Hash -> k -> v -> Hash -> k -> v -> ST s (HashMap k v)
@@ -436,9 +430,7 @@
go h k x s t@(Collision hy v)
| h == hy = Collision h (updateOrSnocWith f k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE insertWith #-}
-#endif
-- | In-place update version of insertWith
unsafeInsertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v
@@ -472,9 +464,7 @@
go h k x s t@(Collision hy v)
| h == hy = return $! Collision h (updateOrSnocWith f k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE unsafeInsertWith #-}
-#endif
-- | /O(log n)/ Remove the mapping for the specified key from this map
-- if present.
@@ -529,14 +519,12 @@
| otherwise -> Collision h (A.delete v i)
Nothing -> t
| otherwise = t
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE delete #-}
-#endif
-- | /O(log n)/ Adjust the value tied to a given key in this map only
-- if it is present. Otherwise, leave the map alone.
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> HashMap k v -> HashMap k v
-adjust f k0 = go h0 k0 0
+adjust f k0 m0 = go h0 k0 0 m0
where
h0 = hash k0
go !_ !_ !_ Empty = Empty
@@ -560,9 +548,7 @@
go h k _ t@(Collision hy v)
| h == hy = Collision h (updateWith f k v)
| otherwise = t
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE adjust #-}
-#endif
------------------------------------------------------------------------
-- * Combine
@@ -571,9 +557,7 @@
-- mapping from the first will be the mapping in the result.
union :: (Eq k, Hashable k) => HashMap k v -> HashMap k v -> HashMap k v
union = unionWith const
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE union #-}
-#endif
-- | /O(n+m)/ The union of two maps. If a key occurs in both maps,
-- the provided function (first argument) will be used to compute the
@@ -712,6 +696,7 @@
A.map' (\ (L k v) -> L k (f k v)) ary
{-# INLINE mapWithKey #-}
+-- | /O(n)/ Transform this map by applying a function to every value.
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2
map f = mapWithKey (const f)
{-# INLINE map #-}
@@ -744,9 +729,7 @@
go m k v = case lookup k b of
Nothing -> insert k v m
_ -> m
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE difference #-}
-#endif
-- | /O(n*log m)/ Intersection of two maps. Return elements of the first
-- map for keys existing in the second.
@@ -756,9 +739,7 @@
go m k v = case lookup k b of
Just _ -> insert k v m
_ -> m
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE intersection #-}
-#endif
-- | /O(n+m)/ Intersection of two maps. If a key occurs in both maps
-- the provided function is used to combine the values from the two
@@ -770,9 +751,7 @@
go m k v = case lookup k b of
Just w -> insert k (f v w) m
_ -> m
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE intersectionWith #-}
-#endif
------------------------------------------------------------------------
-- * Folds
@@ -921,28 +900,20 @@
-- | /O(n)/ Return a list of this map's elements. The list is
-- produced lazily.
toList :: HashMap k v -> [(k, v)]
-#if defined(__GLASGOW_HASKELL__)
toList t = build (\ c z -> foldrWithKey (curry c) z t)
-#else
-toList = foldrWithKey (\ k v xs -> (k, v) : xs) []
-#endif
{-# INLINE toList #-}
-- | /O(n)/ Construct a map with the supplied mappings. If the list
-- contains duplicate mappings, the later mappings take precedence.
fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
fromList = L.foldl' (\ m (k, v) -> unsafeInsert k v m) empty
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE fromList #-}
-#endif
-- | /O(n*log n)/ Construct a map from a list of elements. Uses
-- the provided function to merge duplicate entries.
fromListWith :: (Eq k, Hashable k) => (v -> v -> v) -> [(k, v)] -> HashMap k v
fromListWith f = L.foldl' (\ m (k, v) -> unsafeInsertWith f k v m) empty
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINE fromListWith #-}
-#endif
------------------------------------------------------------------------
-- Array operations
@@ -958,9 +929,7 @@
(L kx v)
| k == kx -> Just v
| otherwise -> go k ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE lookupInArray #-}
-#endif
-- | /O(n)/ Lookup the value associated with the given key in this
-- array. Returns 'Nothing' if the key wasn't found.
@@ -973,9 +942,7 @@
(L kx _)
| k == kx -> Just i
| otherwise -> go k ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE indexOf #-}
-#endif
updateWith :: Eq k => (v -> v) -> k -> A.Array (Leaf k v) -> A.Array (Leaf k v)
updateWith f k0 ary0 = go k0 ary0 0 (A.length ary0)
@@ -985,9 +952,7 @@
| otherwise = case A.index ary i of
(L kx y) | k == kx -> A.update ary i (L k (f y))
| otherwise -> go k ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE updateWith #-}
-#endif
updateOrSnocWith :: Eq k => (v -> v -> v) -> k -> v -> A.Array (Leaf k v)
-> A.Array (Leaf k v)
@@ -1003,9 +968,7 @@
| otherwise = case A.index ary i of
(L kx y) | k == kx -> A.update ary i (L k (f v y))
| otherwise -> go k v ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE updateOrSnocWith #-}
-#endif
updateOrConcatWith :: Eq k => (v -> v -> v) -> A.Array (Leaf k v) -> A.Array (Leaf k v) -> A.Array (Leaf k v)
updateOrConcatWith f ary1 ary2 = A.run $ do
@@ -1033,9 +996,7 @@
go (iEnd+1) (i2+1)
go n1 0
return mary
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE updateOrConcatWith #-}
-#endif
------------------------------------------------------------------------
-- Manually unrolled loops
@@ -1118,9 +1079,9 @@
-- | Check if two the two arguments are the same value. N.B. This
-- function might give false negatives (due to GC moving objects.)
ptrEq :: a -> a -> Bool
-#if defined(__GLASGOW_HASKELL__)
+#if __GLASGOW_HASKELL__ < 707
ptrEq x y = reallyUnsafePtrEquality# x y ==# 1#
#else
-ptrEq _ _ = False
+ptrEq x y = isTrue# (reallyUnsafePtrEquality# x y ==# 1#)
#endif
{-# INLINE ptrEq #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/Data/HashMap/Lazy.hs new/unordered-containers-0.2.4.0/Data/HashMap/Lazy.hs
--- old/unordered-containers-0.2.3.0/Data/HashMap/Lazy.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/Data/HashMap/Lazy.hs 2014-04-12 12:40:40.000000000 +0200
@@ -17,10 +17,6 @@
-- duplicate keys; each key can map to at most one value. A 'HashMap'
-- makes no guarantees as to the order of its elements.
--
--- This map is strict in the keys and lazy in the values; keys are
--- evaluated to /weak head normal form/ before they are added to the
--- map.
---
-- The implementation is based on /hash array mapped tries/. A
-- 'HashMap' is often faster than other tree-based set types,
-- especially when key comparison is expensive, as in the case of
@@ -31,6 +27,9 @@
-- operations are constant time.
module Data.HashMap.Lazy
(
+ -- * Strictness properties
+ -- $strictness
+
HashMap
-- * Construction
@@ -57,6 +56,7 @@
-- * Transformations
, HM.map
+ , mapWithKey
, traverseWithKey
-- * Difference and intersection
@@ -85,3 +85,9 @@
) where
import Data.HashMap.Base as HM
+
+-- $strictness
+--
+-- This module satisfies the following strictness property:
+--
+-- * Key arguments are evaluated to WHNF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/Data/HashMap/Strict.hs new/unordered-containers-0.2.4.0/Data/HashMap/Strict.hs
--- old/unordered-containers-0.2.3.0/Data/HashMap/Strict.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/Data/HashMap/Strict.hs 2014-04-12 12:40:40.000000000 +0200
@@ -17,11 +17,6 @@
-- duplicate keys; each key can map to at most one value. A 'HashMap'
-- makes no guarantees as to the order of its elements.
--
--- This map is strict in both the keys and the values; keys and values
--- are evaluated to /weak head normal form/ before they are added to
--- the map. Exception: the provided instances are the same as for the
--- lazy version of this module.
---
-- The implementation is based on /hash array mapped tries/. A
-- 'HashMap' is often faster than other tree-based set types,
-- especially when key comparison is expensive, as in the case of
@@ -32,6 +27,9 @@
-- operations are constant time.
module Data.HashMap.Strict
(
+ -- * Strictness properties
+ -- $strictness
+
HashMap
-- * Construction
@@ -58,6 +56,7 @@
-- * Transformations
, map
+ , mapWithKey
, traverseWithKey
-- * Difference and intersection
@@ -94,9 +93,18 @@
import qualified Data.HashMap.Base as HM
import Data.HashMap.Base hiding (
adjust, fromList, fromListWith, insert, insertWith, intersectionWith,
- lookupDefault, map, singleton, unionWith)
+ map, mapWithKey, singleton, unionWith)
import Data.HashMap.Unsafe (runST)
+-- $strictness
+--
+-- This module satisfies the following strictness properties:
+--
+-- 1. Key arguments are evaluated to WHNF;
+--
+-- 2. Keys and values are evaluated to WHNF before they are stored in
+-- the map.
+
------------------------------------------------------------------------
-- * Construction
@@ -107,22 +115,12 @@
------------------------------------------------------------------------
-- * Basic interface
--- | /O(log n)/ Return the value to which the specified key is mapped,
--- or the default value if this map contains no mapping for the key.
-lookupDefault :: (Eq k, Hashable k)
- => v -- ^ Default value to return.
- -> k -> HashMap k v -> v
-lookupDefault !def k t = HM.lookupDefault def k t
-{-# INLINABLE lookupDefault #-}
-
-- | /O(log n)/ Associate the specified value with the specified
-- key in this map. If this map previously contained a mapping for
-- the key, the old value is replaced.
insert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
insert k !v = HM.insert k v
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE insert #-}
-#endif
-- | /O(log n)/ Associate the value with the key in this map. If
-- this map previously contained a mapping for the key, the old value
@@ -133,18 +131,18 @@
-- > where f new old = new + old
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v
-> HashMap k v
-insertWith f k0 !v0 m0 = go h0 k0 v0 0 m0
+insertWith f k0 v0 m0 = go h0 k0 v0 0 m0
where
h0 = hash k0
- go !h !k x !_ Empty = Leaf h (L k x)
+ go !h !k x !_ Empty = leaf h k x
go h k x s (Leaf hy l@(L ky y))
| hy == h = if ky == k
- then let !v' = f x y in Leaf h (L k v')
- else collision h l (L k x)
- | otherwise = runST (two s h k x hy ky y)
+ then leaf h k (f x y)
+ else x `seq` (collision h l (L k x))
+ | otherwise = x `seq` runST (two s h k x hy ky y)
go h k x s (BitmapIndexed b ary)
| b .&. m == 0 =
- let ary' = A.insert ary i $! Leaf h (L k x)
+ let ary' = A.insert ary i $! leaf h k x
in bitmapIndexedOrFull (b .|. m) ary'
| otherwise =
let st = A.index ary i
@@ -162,9 +160,7 @@
go h k x s t@(Collision hy v)
| h == hy = Collision h (updateOrSnocWith f k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE insertWith #-}
-#endif
-- | In-place update version of insertWith
unsafeInsertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v
@@ -172,15 +168,17 @@
unsafeInsertWith f k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
- go !h !k x !_ Empty = return $! Leaf h (L k x)
+ go !h !k x !_ Empty = return $! leaf h k x
go h k x s (Leaf hy l@(L ky y))
| hy == h = if ky == k
- then let !v' = f x y in return $! Leaf h (L k v')
- else return $! collision h l (L k x)
+ then return $! leaf h k (f x y)
+ else do
+ let l' = x `seq` (L k x)
+ return $! collision h l l'
| otherwise = two s h k x hy ky y
go h k x s t@(BitmapIndexed b ary)
| b .&. m == 0 = do
- ary' <- A.insertM ary i $! Leaf h (L k x)
+ ary' <- A.insertM ary i $! leaf h k x
return $! bitmapIndexedOrFull (b .|. m) ary'
| otherwise = do
st <- A.indexM ary i
@@ -198,19 +196,17 @@
go h k x s t@(Collision hy v)
| h == hy = return $! Collision h (updateOrSnocWith f k x v)
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE unsafeInsertWith #-}
-#endif
-- | /O(log n)/ Adjust the value tied to a given key in this map only
-- if it is present. Otherwise, leave the map alone.
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> HashMap k v -> HashMap k v
-adjust f k0 = go h0 k0 0
+adjust f k0 m0 = go h0 k0 0 m0
where
h0 = hash k0
go !_ !_ !_ Empty = Empty
go h k _ t@(Leaf hy (L ky y))
- | hy == h && ky == k = let !v' = f y in Leaf h (L k v')
+ | hy == h && ky == k = leaf h k (f y)
| otherwise = t
go h k s t@(BitmapIndexed b ary)
| b .&. m == 0 = t
@@ -229,9 +225,7 @@
go h k _ t@(Collision hy v)
| h == hy = Collision h (updateWith f k v)
| otherwise = t
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE adjust #-}
-#endif
------------------------------------------------------------------------
-- * Combine
@@ -248,7 +242,7 @@
-- leaf vs. leaf
go s t1@(Leaf h1 l1@(L k1 v1)) t2@(Leaf h2 l2@(L k2 v2))
| h1 == h2 = if k1 == k2
- then Leaf h1 . L k1 $! f v1 v2
+ then leaf h1 k1 (f v1 v2)
else collision h1 l1 l2
| otherwise = goDifferentHash s h1 h2 t1 t2
go s t1@(Leaf h1 (L k1 v1)) t2@(Collision h2 ls2)
@@ -330,13 +324,14 @@
mapWithKey f = go
where
go Empty = Empty
- go (Leaf h (L k v)) = let !v' = f k v in Leaf h $ L k v'
+ go (Leaf h (L k v)) = leaf h k (f k v)
go (BitmapIndexed b ary) = BitmapIndexed b $ A.map' go ary
go (Full ary) = Full $ A.map' go ary
go (Collision h ary) =
Collision h $ A.map' (\ (L k v) -> let !v' = f k v in L k v') ary
{-# INLINE mapWithKey #-}
+-- | /O(n)/ Transform this map by applying a function to every value.
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2
map f = mapWithKey (const f)
{-# INLINE map #-}
@@ -356,9 +351,7 @@
go m k v = case HM.lookup k b of
Just w -> insert k (f v w) m
_ -> m
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE intersectionWith #-}
-#endif
------------------------------------------------------------------------
-- ** Lists
@@ -367,10 +360,8 @@
-- list contains duplicate mappings, the later mappings take
-- precedence.
fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
-fromList = L.foldl' (\ m (k, v) -> HM.unsafeInsert k v m) empty
-#if __GLASGOW_HASKELL__ >= 700
+fromList = L.foldl' (\ m (k, !v) -> HM.unsafeInsert k v m) empty
{-# INLINABLE fromList #-}
-#endif
-- | /O(n*log n)/ Construct a map from a list of elements. Uses
-- the provided function to merge duplicate entries.
@@ -389,10 +380,13 @@
| otherwise = case A.index ary i of
(L kx y) | k == kx -> let !v' = f y in A.update ary i (L k v')
| otherwise -> go k ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE updateWith #-}
-#endif
+-- | Append the given key and value to the array. If the key is
+-- already present, instead update the value of the key by applying
+-- the given function to the new and old value (in that order). The
+-- value is always evaluated to WHNF before being inserted into the
+-- array.
updateOrSnocWith :: Eq k => (v -> v -> v) -> k -> v -> A.Array (Leaf k v)
-> A.Array (Leaf k v)
updateOrSnocWith f k0 v0 ary0 = go k0 v0 ary0 0 (A.length ary0)
@@ -402,11 +396,20 @@
-- Not found, append to the end.
mary <- A.new_ (n + 1)
A.copy ary 0 mary 0 n
- A.write mary n (L k v)
+ let !l = v `seq` (L k v)
+ A.write mary n l
return mary
| otherwise = case A.index ary i of
(L kx y) | k == kx -> let !v' = f v y in A.update ary i (L k v')
| otherwise -> go k v ary (i+1) n
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE updateOrSnocWith #-}
-#endif
+
+------------------------------------------------------------------------
+-- Smart constructors
+--
+-- These constructors make sure the value is in WHNF before it's
+-- inserted into the constructor.
+
+leaf :: Hash -> k -> v -> HashMap k v
+leaf h k !v = Leaf h (L k v)
+{-# INLINE leaf #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/Data/HashSet.hs new/unordered-containers-0.2.4.0/Data/HashSet.hs
--- old/unordered-containers-0.2.3.0/Data/HashSet.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/Data/HashSet.hs 2014-04-12 12:40:40.000000000 +0200
@@ -60,20 +60,17 @@
) where
import Control.DeepSeq (NFData(..))
+import Data.Data hiding (Typeable)
import Data.HashMap.Base (HashMap, foldrWithKey)
import Data.Hashable (Hashable)
import Data.Monoid (Monoid(..))
+import GHC.Exts (build)
import Prelude hiding (filter, foldr, map, null)
import qualified Data.Foldable as Foldable
import qualified Data.HashMap.Lazy as H
import qualified Data.List as List
import Data.Typeable (Typeable)
-#if defined(__GLASGOW_HASKELL__)
-import Data.Data hiding (Typeable)
-import GHC.Exts (build)
-#endif
-
-- | A set of values. A set cannot contain duplicate values.
newtype HashSet a = HashSet {
asMap :: HashMap a ()
@@ -103,7 +100,6 @@
showsPrec d m = showParen (d > 10) $
showString "fromList " . shows (toList m)
-#if __GLASGOW_HASKELL__
instance (Data a, Eq a, Hashable a) => Data (HashSet a) where
gfoldl f z m = z fromList `f` toList m
toConstr _ = fromListConstr
@@ -118,7 +114,6 @@
hashSetDataType :: DataType
hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
-#endif
-- | /O(1)/ Construct an empty set.
empty :: HashSet a
@@ -127,9 +122,7 @@
-- | /O(1)/ Construct a set with a single element.
singleton :: Hashable a => a -> HashSet a
singleton a = HashSet (H.singleton a ())
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE singleton #-}
-#endif
-- | /O(n+m)/ Construct a set containing all elements from both sets.
--
@@ -162,24 +155,18 @@
member a s = case H.lookup a (asMap s) of
Just _ -> True
_ -> False
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE member #-}
-#endif
-- | /O(min(n,W))/ Add the specified value to this set.
insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
insert a = HashSet . H.insert a () . asMap
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE insert #-}
-#endif
-- | /O(min(n,W))/ Remove the specified value from this set if
-- present.
delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
delete a = HashSet . H.delete a . asMap
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE delete #-}
-#endif
-- | /O(n)/ Transform this set by applying a function to every value.
-- The resulting set may be smaller than the source.
@@ -191,17 +178,13 @@
-- not existing in the second.
difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE difference #-}
-#endif
-- | /O(n)/ Intersection of two sets. Return elements present in both
-- the first set and the second.
intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
-#if __GLASGOW_HASKELL__ >= 700
{-# INLINABLE intersection #-}
-#endif
-- | /O(n)/ Reduce this set by applying a binary operator to all
-- elements, using the given starting value (typically the
@@ -231,11 +214,7 @@
-- | /O(n)/ Return a list of this set's elements. The list is
-- produced lazily.
toList :: HashSet a -> [a]
-#if defined(__GLASGOW_HASKELL__)
toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
-#else
-toList = foldrWithKey (\ k _ xs -> k : xs) [] . asMap
-#endif
{-# INLINE toList #-}
-- | /O(n*min(W, n))/ Construct a set from a list of elements.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/benchmarks/Benchmarks.hs new/unordered-containers-0.2.4.0/benchmarks/Benchmarks.hs
--- old/unordered-containers-0.2.3.0/benchmarks/Benchmarks.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/benchmarks/Benchmarks.hs 2014-04-12 12:40:40.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, GADTs #-}
+{-# LANGUAGE CPP, GADTs, PackageImports #-}
module Main where
@@ -10,6 +10,7 @@
import Data.Bits ((.&.))
import Data.Hashable (Hashable)
import qualified Data.ByteString as BS
+import qualified "hashmap" Data.HashMap as IHM
import qualified Data.HashMap.Strict as HM
import qualified Data.IntMap as IM
import qualified Data.Map as M
@@ -40,6 +41,8 @@
m = M.fromList elems :: M.Map String Int
mbs = M.fromList elemsBS :: M.Map BS.ByteString Int
im = IM.fromList elemsI :: IM.IntMap Int
+ ihm = IHM.fromList elems :: IHM.Map String Int
+ ihmbs = IHM.fromList elemsBS :: IHM.Map BS.ByteString Int
defaultMainWith defaultConfig
(liftIO . evaluate $ rnf [B m, B mbs, B hm, B hmbs, B hmi, B im])
[
@@ -80,6 +83,42 @@
]
]
+ -- ** Map from the hashmap package
+ , bgroup "hashmap/Map"
+ [ bgroup "lookup"
+ [ bench "String" $ whnf (lookupIHM keys) ihm
+ , bench "ByteString" $ whnf (lookupIHM keysBS) ihmbs
+ ]
+ , bgroup "lookup-miss"
+ [ bench "String" $ whnf (lookupIHM keys') ihm
+ , bench "ByteString" $ whnf (lookupIHM keysBS') ihmbs
+ ]
+ , bgroup "insert"
+ [ bench "String" $ whnf (insertIHM elems) IHM.empty
+ , bench "ByteStringString" $ whnf (insertIHM elemsBS) IHM.empty
+ ]
+ , bgroup "insert-dup"
+ [ bench "String" $ whnf (insertIHM elems) ihm
+ , bench "ByteStringString" $ whnf (insertIHM elemsBS) ihmbs
+ ]
+ , bgroup "delete"
+ [ bench "String" $ whnf (deleteIHM keys) ihm
+ , bench "ByteString" $ whnf (deleteIHM keysBS) ihmbs
+ ]
+ , bgroup "delete-miss"
+ [ bench "String" $ whnf (deleteIHM keys') ihm
+ , bench "ByteString" $ whnf (deleteIHM keysBS') ihmbs
+ ]
+ , bgroup "size"
+ [ bench "String" $ whnf IHM.size ihm
+ , bench "ByteString" $ whnf IHM.size ihmbs
+ ]
+ , bgroup "fromList"
+ [ bench "String" $ whnf IHM.fromList elems
+ , bench "ByteString" $ whnf IHM.fromList elemsBS
+ ]
+ ]
+
-- ** IntMap
, bgroup "IntMap"
[ bench "lookup" $ whnf (lookupIM keysI) im
@@ -152,39 +191,29 @@
-- fromList
, bgroup "fromList"
- [ bgroup name
- [ bgroup "long"
- [ bench "String" $ whnf fl1 elems
- , bench "ByteString" $ whnf fl2 elemsBS
- , bench "Int" $ whnf fl3 elemsI
- ]
- , bgroup "short"
- [ bench "String" $ whnf fl1 elemsDup
- , bench "ByteString" $ whnf fl2 elemsDupBS
- , bench "Int" $ whnf fl3 elemsDupI
- ]
+ [ bgroup "long"
+ [ bench "String" $ whnf HM.fromList elems
+ , bench "ByteString" $ whnf HM.fromList elemsBS
+ , bench "Int" $ whnf HM.fromList elemsI
+ ]
+ , bgroup "short"
+ [ bench "String" $ whnf HM.fromList elemsDup
+ , bench "ByteString" $ whnf HM.fromList elemsDupBS
+ , bench "Int" $ whnf HM.fromList elemsDupI
]
- | (name,fl1,fl2,fl3)
- <- [("Base",HM.fromList,HM.fromList,HM.fromList)
- ,("insert",fromList_insert,fromList_insert,fromList_insert)]
]
- -- fromList
+ -- fromListWith
, bgroup "fromListWith"
- [ bgroup name
- [ bgroup "long"
- [ bench "String" $ whnf (fl1 (+)) elems
- , bench "ByteString" $ whnf (fl2 (+)) elemsBS
- , bench "Int" $ whnf (fl3 (+)) elemsI
- ]
- , bgroup "short"
- [ bench "String" $ whnf (fl1 (+)) elemsDup
- , bench "ByteString" $ whnf (fl2 (+)) elemsDupBS
- , bench "Int" $ whnf (fl3 (+)) elemsDupI
- ]
+ [ bgroup "long"
+ [ bench "String" $ whnf (HM.fromListWith (+)) elems
+ , bench "ByteString" $ whnf (HM.fromListWith (+)) elemsBS
+ , bench "Int" $ whnf (HM.fromListWith (+)) elemsI
+ ]
+ , bgroup "short"
+ [ bench "String" $ whnf (HM.fromListWith (+)) elemsDup
+ , bench "ByteString" $ whnf (HM.fromListWith (+)) elemsDupBS
+ , bench "Int" $ whnf (HM.fromListWith (+)) elemsDupI
]
- | (name,fl1,fl2,fl3)
- <- [("Base",HM.fromListWith,HM.fromListWith,HM.fromListWith)
- ,("insert",fromListWith_insert,fromListWith_insert,fromListWith_insert)]
]
]
]
@@ -261,6 +290,30 @@
-> M.Map BS.ByteString Int #-}
------------------------------------------------------------------------
+-- * Map from the hashmap package
+
+lookupIHM :: (Eq k, Hashable k, Ord k) => [k] -> IHM.Map k Int -> Int
+lookupIHM xs m = foldl' (\z k -> fromMaybe z (IHM.lookup k m)) 0 xs
+{-# SPECIALIZE lookupIHM :: [String] -> IHM.Map String Int -> Int #-}
+{-# SPECIALIZE lookupIHM :: [BS.ByteString] -> IHM.Map BS.ByteString Int
+ -> Int #-}
+
+insertIHM :: (Eq k, Hashable k, Ord k) => [(k, Int)] -> IHM.Map k Int
+ -> IHM.Map k Int
+insertIHM xs m0 = foldl' (\m (k, v) -> IHM.insert k v m) m0 xs
+{-# SPECIALIZE insertIHM :: [(String, Int)] -> IHM.Map String Int
+ -> IHM.Map String Int #-}
+{-# SPECIALIZE insertIHM :: [(BS.ByteString, Int)] -> IHM.Map BS.ByteString Int
+ -> IHM.Map BS.ByteString Int #-}
+
+deleteIHM :: (Eq k, Hashable k, Ord k) => [k] -> IHM.Map k Int -> IHM.Map k Int
+deleteIHM xs m0 = foldl' (\m k -> IHM.delete k m) m0 xs
+{-# SPECIALIZE deleteIHM :: [String] -> IHM.Map String Int
+ -> IHM.Map String Int #-}
+{-# SPECIALIZE deleteIHM :: [BS.ByteString] -> IHM.Map BS.ByteString Int
+ -> IHM.Map BS.ByteString Int #-}
+
+------------------------------------------------------------------------
-- * IntMap
lookupIM :: [Int] -> IM.IntMap Int -> Int
@@ -271,18 +324,3 @@
deleteIM :: [Int] -> IM.IntMap Int -> IM.IntMap Int
deleteIM xs m0 = foldl' (\m k -> IM.delete k m) m0 xs
-
-------------------------------------------------------------------------
--- * Reference implementations
-
-fromList_insert :: (Eq k, Hashable k) => [(k, v)] -> HM.HashMap k v
-fromList_insert = foldl' (\ m (k, v) -> HM.insert k v m) HM.empty
-#if __GLASGOW_HASKELL__ >= 700
-{-# INLINABLE fromList_insert #-}
-#endif
-
-fromListWith_insert :: (Eq k, Hashable k) => (v -> v -> v) -> [(k, v)] -> HM.HashMap k v
-fromListWith_insert f = foldl' (\ m (k, v) -> HM.insertWith f k v m) HM.empty
-#if __GLASGOW_HASKELL__ >= 700
-{-# INLINABLE fromListWith_insert #-}
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/tests/Strictness.hs new/unordered-containers-0.2.4.0/tests/Strictness.hs
--- old/unordered-containers-0.2.3.0/tests/Strictness.hs 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/tests/Strictness.hs 2014-04-12 12:40:40.000000000 +0200
@@ -44,9 +44,6 @@
pLookupDefaultKeyStrict :: Int -> HashMap Key Int -> Bool
pLookupDefaultKeyStrict def m = isBottom $ HM.lookupDefault def bottom m
-pLookupDefaultValueStrict :: Key -> HashMap Key Int -> Bool
-pLookupDefaultValueStrict k m = isBottom $ HM.lookupDefault bottom k m
-
pAdjustKeyStrict :: (Int -> Int) -> HashMap Key Int -> Bool
pAdjustKeyStrict f m = isBottom $ HM.adjust f bottom m
@@ -72,6 +69,21 @@
| HM.member k m = isBottom $ HM.insertWith (const2 bottom) k v m
| otherwise = isBottom $ HM.insertWith f k bottom m
+pFromListKeyStrict :: Bool
+pFromListKeyStrict = isBottom $ HM.fromList [(undefined :: Key, 1 :: Int)]
+
+pFromListValueStrict :: Bool
+pFromListValueStrict = isBottom $ HM.fromList [(K 1, undefined)]
+
+pFromListWithKeyStrict :: (Int -> Int -> Int) -> Bool
+pFromListWithKeyStrict f =
+ isBottom $ HM.fromListWith f [(undefined :: Key, 1 :: Int)]
+
+pFromListWithValueStrict :: [(Key, Int)] -> Bool
+pFromListWithValueStrict xs = case xs of
+ [] -> True
+ (x:_) -> isBottom $ HM.fromListWith (\ _ _ -> undefined) (x:xs)
+
------------------------------------------------------------------------
-- * Test list
@@ -85,7 +97,6 @@
, testProperty "member is key-strict" $ keyStrict HM.member
, testProperty "lookup is key-strict" $ keyStrict HM.lookup
, testProperty "lookupDefault is key-strict" pLookupDefaultKeyStrict
- , testProperty "lookupDefault is value-strict" pLookupDefaultValueStrict
, testProperty "! is key-strict" $ keyStrict (flip (HM.!))
, testProperty "delete is key-strict" $ keyStrict HM.delete
, testProperty "adjust is key-strict" pAdjustKeyStrict
@@ -94,6 +105,10 @@
, testProperty "insert is value-strict" pInsertValueStrict
, testProperty "insertWith is key-strict" pInsertWithKeyStrict
, testProperty "insertWith is value-strict" pInsertWithValueStrict
+ , testProperty "fromList is key-strict" pFromListKeyStrict
+ , testProperty "fromList is value-strict" pFromListValueStrict
+ , testProperty "fromListWith is key-strict" pFromListWithKeyStrict
+ , testProperty "fromListWith is value-strict" pFromListWithValueStrict
]
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.3.0/unordered-containers.cabal new/unordered-containers-0.2.4.0/unordered-containers.cabal
--- old/unordered-containers-0.2.3.0/unordered-containers.cabal 2012-12-14 01:19:47.000000000 +0100
+++ new/unordered-containers-0.2.4.0/unordered-containers.cabal 2014-04-12 12:40:41.000000000 +0200
@@ -1,5 +1,5 @@
name: unordered-containers
-version: 0.2.3.0
+version: 0.2.4.0
synopsis: Efficient hashing-based container types
description:
Efficient hashing-based container types. The containers have been
@@ -14,7 +14,7 @@
maintainer: johan.tibell(a)gmail.com
Homepage: https://github.com/tibbe/unordered-containers
bug-reports: https://github.com/tibbe/unordered-containers/issues
-copyright: 2010-2012 Johan Tibell
+copyright: 2010-2014 Johan Tibell
2010 Edward Z. Yang
category: Data
build-type: Simple
@@ -154,6 +154,7 @@
criterion,
deepseq >= 1.1,
hashable >= 1.0.1.1,
+ hashmap,
mtl,
random
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0