diff -Nru haskell-monoid-extras-0.2.2.2/CHANGES haskell-monoid-extras-0.3.2.4/CHANGES --- haskell-monoid-extras-0.2.2.2/CHANGES 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/CHANGES 2013-11-28 04:23:44.000000000 +0000 @@ -1,3 +1,37 @@ +* 0.3.2.4: 27 November 2013 + + - allow semigroups-0.12 + +* 0.3.2.3: 19 October 2013 + + - Allow groupoids-4 and semigroupoids-4 + +* 0.3.2.2: 26 September 2013 + + - allow semigroups-0.11 + +* 0.3.2.1: 25 September 2013 + + - allow groups-0.4 + +* 0.3.2: 30 August 2013 + + - new Group instance for Endomorphism + +* 0.3.1: 20 August 2013 + + - new module Data.Monoid.Endomorphism + - add derived Functor, Foldable, and Traversable instances for Data.Monoid.Inf.Inf + +* 0.3: 2 May 2013 + + - generalize PosInf to Inf, which supports making monoids out of + semigroups under both min and max + +* 0.2.2.3: 28 March 2013 + + - bump upper bound to allow base-4.7 + * 0.2.2.2: 7 January 2013 - bump upper bound to allow semigroups-0.9 diff -Nru haskell-monoid-extras-0.2.2.2/LICENSE haskell-monoid-extras-0.3.2.4/LICENSE --- haskell-monoid-extras-0.2.2.2/LICENSE 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/LICENSE 2013-11-28 04:23:44.000000000 +0000 @@ -1,4 +1,12 @@ -Copyright (c) 2012, Brent Yorgey +Copyright (c) 2012-2013, monoid-extras team: + + Daniel Bergey + Nathan van Doorn + Daniil Frumin + Hans Höglund + Daniel Wagner + Ryan Yates + Brent Yorgey All rights reserved. diff -Nru haskell-monoid-extras-0.2.2.2/debian/changelog haskell-monoid-extras-0.3.2.4/debian/changelog --- haskell-monoid-extras-0.2.2.2/debian/changelog 2013-05-24 10:51:27.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/debian/changelog 2013-12-26 21:57:58.000000000 +0000 @@ -1,3 +1,31 @@ +haskell-monoid-extras (0.3.2.4-1build1) trusty; urgency=medium + + * Rebuild for new GHC ABIs. + + -- Colin Watson Thu, 26 Dec 2013 21:57:58 +0000 + +haskell-monoid-extras (0.3.2.4-1) unstable; urgency=low + + * New upstream version. + + -- Clint Adams Sat, 07 Dec 2013 23:23:18 -0500 + +haskell-monoid-extras (0.3.2.3-2) unstable; urgency=low + + * Patch out use of groupoids (now part of semigroupoids) + + -- Joachim Breitner Sun, 24 Nov 2013 14:28:52 +0000 + +haskell-monoid-extras (0.3.2.3-1) unstable; urgency=low + + [ Joachim Breitner ] + * Adjust watch file to new hackage layout + + [ Clint Adams ] + * New upstream version. + + -- Clint Adams Sat, 09 Nov 2013 11:51:36 -0500 + haskell-monoid-extras (0.2.2.2-2) unstable; urgency=low * Enable compat level 9 diff -Nru haskell-monoid-extras-0.2.2.2/debian/control haskell-monoid-extras-0.3.2.4/debian/control --- haskell-monoid-extras-0.2.2.2/debian/control 2013-05-24 08:55:23.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/debian/control 2013-12-08 04:24:05.000000000 +0000 @@ -8,12 +8,18 @@ , haskell-devscripts (>= 0.8.15) , ghc , ghc-prof - , libghc-semigroups-dev (>= 0.8) - , libghc-semigroups-dev (<< 0.10) + , libghc-groups-dev (<< 0.5) + , libghc-groups-prof + , libghc-semigroupoids-dev (<< 5) + , libghc-semigroupoids-prof + , libghc-semigroups-dev (>= 0.4) + , libghc-semigroups-dev (<< 0.13) , libghc-semigroups-prof Build-Depends-Indep: ghc-doc + , libghc-groups-doc + , libghc-semigroupoids-doc , libghc-semigroups-doc -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Homepage: http://hackage.haskell.org/package/monoid-extras Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-monoid-extras Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-monoid-extras diff -Nru haskell-monoid-extras-0.2.2.2/debian/patches/no-groupoids haskell-monoid-extras-0.3.2.4/debian/patches/no-groupoids --- haskell-monoid-extras-0.2.2.2/debian/patches/no-groupoids 1970-01-01 00:00:00.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/debian/patches/no-groupoids 2013-12-08 04:24:28.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Do not use groupoid (now part of semigroupoids) +Author: Joachim Breitner + +--- haskell-monoid-extras-0.3.2.3.orig/monoid-extras.cabal ++++ haskell-monoid-extras-0.3.2.3/monoid-extras.cabal +@@ -33,9 +33,8 @@ library + + build-depends: base >= 4.3 && < 4.8, + groups < 0.5, +- groupoids < 5, + semigroups >= 0.8 && < 0.13, +- semigroupoids < 5 ++ semigroupoids >= 4.0 && < 5 + + hs-source-dirs: src + diff -Nru haskell-monoid-extras-0.2.2.2/debian/patches/series haskell-monoid-extras-0.3.2.4/debian/patches/series --- haskell-monoid-extras-0.2.2.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/debian/patches/series 2013-12-08 04:23:15.000000000 +0000 @@ -0,0 +1 @@ +no-groupoids diff -Nru haskell-monoid-extras-0.2.2.2/debian/watch haskell-monoid-extras-0.3.2.4/debian/watch --- haskell-monoid-extras-0.2.2.2/debian/watch 2013-01-05 10:43:26.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/debian/watch 2013-12-08 04:23:15.000000000 +0000 @@ -1,5 +1,2 @@ version=3 -opts="downloadurlmangle=s|archive/([\w\d_-]+)/([\d\.]+)/|archive/$1/$2/$1-$2.tar.gz|,\ -filenamemangle=s|(.*)/$|monoid-extras-$1.tar.gz|" \ - http://hackage.haskell.org/packages/archive/monoid-extras \ - ([\d\.]*\d)/ +http://hackage.haskell.org/package/monoid-extras/distro-monitor .*-([0-9\.]+).(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff -Nru haskell-monoid-extras-0.2.2.2/monoid-extras.cabal haskell-monoid-extras-0.3.2.4/monoid-extras.cabal --- haskell-monoid-extras-0.2.2.2/monoid-extras.cabal 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/monoid-extras.cabal 2013-11-28 04:23:44.000000000 +0000 @@ -1,5 +1,5 @@ name: monoid-extras -version: 0.2.2.2 +version: 0.3.2.4 synopsis: Various extra monoid-related definitions and utilities description: Various extra monoid-related definitions and utilities, such as monoid actions, monoid coproducts, \"deletable\" @@ -24,18 +24,22 @@ Data.Monoid.Coproduct, Data.Monoid.Cut, Data.Monoid.Deletable, + Data.Monoid.Endomorphism, + Data.Monoid.Inf, Data.Monoid.MList, - Data.Monoid.PosInf, Data.Monoid.Recommend, Data.Monoid.Split, Data.Monoid.WithSemigroup - build-depends: base >= 4.3 && < 4.7, - semigroups >= 0.8 && < 0.10 + build-depends: base >= 4.3 && < 4.8, + groups < 0.5, + groupoids < 5, + semigroups >= 0.8 && < 0.13, + semigroupoids < 5 hs-source-dirs: src other-extensions: DeriveFunctor, FlexibleInstances, MultiParamTypeClasses, - TypeOperators \ No newline at end of file + TypeOperators diff -Nru haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Action.hs haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Action.hs --- haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Action.hs 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Action.hs 2013-11-28 04:23:44.000000000 +0000 @@ -1,6 +1,5 @@ -{-# LANGUAGE MultiParamTypeClasses - , FlexibleInstances - #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | @@ -17,7 +16,7 @@ ( Action(..) ) where -import Data.Semigroup +import Data.Semigroup ------------------------------------------------------------ -- Monoid and semigroup actions @@ -32,7 +31,7 @@ -- * @act (m1 ``mappend`` m2) = act m1 . act m2@ -- -- Semigroup instances are required to satisfy the second law but with --- '(<>)' instead of 'mappend'. Additionally, if the type @s@ has +-- ('<>') instead of 'mappend'. Additionally, if the type @s@ has -- any algebraic structure, @act m@ should be a homomorphism. For -- example, if @s@ is also a monoid we should have @act m mempty = -- mempty@ and @act m (s1 ``mappend`` s2) = (act m s1) ``mappend`` @@ -60,7 +59,25 @@ act :: m -> s -> s act = const id +-- | @()@ acts as the identity. +instance Action () l where + act () = id + -- | @Nothing@ acts as the identity; @Just m@ acts as @m@. instance Action m s => Action (Option m) s where act (Option Nothing) s = s act (Option (Just m)) s = act m s + +-- | @Endo@ acts by application. +-- +-- Note that in order for this instance to satisfy the @Action@ +-- laws, whenever the type @a@ has some sort of algebraic structure, +-- the type @Endo a@ must be considered to represent /homomorphisms/ +-- (structure-preserving maps) on @a@, even though there is no way +-- to enforce this in the type system. For example, if @a@ is an +-- instance of @Monoid@, then one should only use @Endo a@ values +-- @f@ with the property that @f mempty = mempty@ and @f (a <> b) = +-- f a <> f b@. +instance Action (Endo a) a where + act = appEndo + diff -Nru haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Endomorphism.hs haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Endomorphism.hs --- haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Endomorphism.hs 1970-01-01 00:00:00.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Endomorphism.hs 2013-11-28 04:23:44.000000000 +0000 @@ -0,0 +1,38 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Data.Monoid.Endomorphism +-- Copyright : (c) 2013 diagrams-core team (see LICENSE) +-- License : BSD-style (see LICENSE) +-- Maintainer : diagrams-discuss@googlegroups.com +-- +-- The monoid of endomorphisms over any 'Category'. +-- +----------------------------------------------------------------------------- + +module Data.Monoid.Endomorphism + ( Endomorphism(..) + ) + where + +import Control.Category +import Data.Group +import Data.Groupoid +import Data.Semigroup +import Data.Semigroupoid +import Prelude hiding (id, (.)) + +-- | An 'Endomorphism' in a given 'Category' is a morphism from some +-- object to itself. The set of endomorphisms for a particular +-- object form a monoid, with composition as the combining operation +-- and the identity morphism as the identity element. +newtype Endomorphism k a = Endomorphism {getEndomorphism :: k a a} + +instance Semigroupoid k => Semigroup (Endomorphism k a) where + Endomorphism a <> Endomorphism b = Endomorphism (a `o` b) + +instance Category k => Monoid (Endomorphism k a) where + mempty = Endomorphism id + Endomorphism a `mappend` Endomorphism b = Endomorphism (a . b) + +instance (Category k, Groupoid k) => Group (Endomorphism k a) where + invert (Endomorphism a) = Endomorphism (inv a) \ No newline at end of file diff -Nru haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Inf.hs haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Inf.hs --- haskell-monoid-extras-0.2.2.2/src/Data/Monoid/Inf.hs 1970-01-01 00:00:00.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/src/Data/Monoid/Inf.hs 2013-11-28 04:23:44.000000000 +0000 @@ -0,0 +1,86 @@ +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE FlexibleInstances #-} +----------------------------------------------------------------------------- +-- | +-- Module : Data.Monoid.Inf +-- Copyright : (c) 2012 diagrams-core team (see LICENSE) +-- License : BSD-style (see LICENSE) +-- Maintainer : diagrams-discuss@googlegroups.com +-- +-- Make semigroup under 'min' or 'max' into monoids by adjoining an +-- element corresponding to infinity (positive or negative, +-- respectively). These types are similar to @Option (Min a)@ and +-- @Option (Max a)@ respectively, except that the 'Ord' instance +-- matches the 'Monoid' instance. +-- +----------------------------------------------------------------------------- + +module Data.Monoid.Inf + ( Inf(..) + , PosInf, NegInf + , minimum, maximum + -- * Type-restricted constructors + , posInfty, negInfty + , posFinite, negFinite + ) where + +import Data.Semigroup +import Prelude hiding (maximum, minimum) +import qualified Prelude as P + +import Data.Foldable (Foldable) +import Data.Traversable (Traversable) + +data Pos +data Neg + +data Inf p a = Infinity | Finite a + deriving (Eq, Show, Read, Functor, Foldable, Traversable) + +type PosInf a = Inf Pos a +type NegInf a = Inf Neg a + +instance Ord a => Ord (Inf Pos a) where + compare Infinity Infinity = EQ + compare Infinity Finite{} = GT + compare Finite{} Infinity = LT + compare (Finite a) (Finite b) = compare a b + +instance Ord a => Ord (Inf Neg a) where + compare Infinity Infinity = EQ + compare Infinity Finite{} = LT + compare Finite{} Infinity = GT + compare (Finite a) (Finite b) = compare a b + +instance Ord a => Semigroup (Inf Pos a) where + (<>) = min + +instance Ord a => Semigroup (Inf Neg a) where + (<>) = max + +instance Ord a => Monoid (Inf Pos a) where + mempty = Infinity + mappend = (<>) + +instance Ord a => Monoid (Inf Neg a) where + mempty = Infinity + mappend = (<>) + +minimum :: Ord a => [a] -> PosInf a +minimum xs = P.minimum (Infinity : map Finite xs) + +maximum :: Ord a => [a] -> NegInf a +maximum xs = P.maximum (Infinity : map Finite xs) + +posInfty :: PosInf a +negInfty :: NegInf a +posFinite :: a -> PosInf a +negFinite :: a -> NegInf a + +posInfty = Infinity +negInfty = Infinity +posFinite = Finite +negFinite = Finite diff -Nru haskell-monoid-extras-0.2.2.2/src/Data/Monoid/MList.hs haskell-monoid-extras-0.3.2.4/src/Data/Monoid/MList.hs --- haskell-monoid-extras-0.2.2.2/src/Data/Monoid/MList.hs 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/src/Data/Monoid/MList.hs 2013-11-28 04:23:44.000000000 +0000 @@ -1,12 +1,14 @@ -{-# LANGUAGE TypeOperators - , MultiParamTypeClasses - , TypeSynonymInstances - , FlexibleInstances - , OverlappingInstances - , UndecidableInstances - , TypeFamilies - , GeneralizedNewtypeDeriving - #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverlappingInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE TypeSynonymInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +{-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | @@ -37,9 +39,9 @@ , SM(..) ) where -import Control.Arrow -import Data.Monoid.Action -import Data.Semigroup +import Control.Arrow +import Data.Monoid.Action +import Data.Semigroup -- $mlist -- @@ -113,9 +115,6 @@ -- heterogeneous monoidal lists on each other. newtype SM m = SM m -instance Action () l where - act _ a = a - instance (Action (SM a) l2, Action l1 l2) => Action (a, l1) l2 where act (a,l) = act (SM a) . act l diff -Nru haskell-monoid-extras-0.2.2.2/src/Data/Monoid/PosInf.hs haskell-monoid-extras-0.3.2.4/src/Data/Monoid/PosInf.hs --- haskell-monoid-extras-0.2.2.2/src/Data/Monoid/PosInf.hs 2013-01-07 21:18:02.000000000 +0000 +++ haskell-monoid-extras-0.3.2.4/src/Data/Monoid/PosInf.hs 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Data.Monoid.PosInf --- Copyright : (c) 2012 diagrams-core team (see LICENSE) --- License : BSD-style (see LICENSE) --- Maintainer : diagrams-discuss@googlegroups.com --- --- Make a semigroup under 'min' into a monoid by adjoining an element --- corresponding to positive infinity. --- ------------------------------------------------------------------------------ - -module Data.Monoid.PosInf - ( PosInf(..) - , minimum - ) where - -import Data.Semigroup -import qualified Prelude as P -import Prelude hiding (minimum) - -data PosInf a = Finite a | PosInfty - deriving (Eq, Ord, Show) - -instance Ord a => Semigroup (PosInf a) where - (<>) = min - -instance Ord a => Monoid (PosInf a) where - mempty = PosInfty - mappend = (<>) - -minimum :: Ord a => [a] -> PosInf a -minimum xs = P.minimum (PosInfty : map Finite xs) \ No newline at end of file