commit ghc-semigroups for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
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@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)](http://travis-ci.org/ekmett/semigroups)
+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
participants (1)
-
root@hilbert.suse.de