diff -Nru haskell-prelude-extras-0.4/CHANGELOG.markdown haskell-prelude-extras-0.4.0.2/CHANGELOG.markdown --- haskell-prelude-extras-0.4/CHANGELOG.markdown 2014-04-19 04:13:40.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/CHANGELOG.markdown 2015-09-09 14:25:36.000000000 +0000 @@ -1,3 +1,11 @@ +0.4.0.2 +------- +* Mark `Prelude.Extras` as Trustworthy + +0.4.0.1 +------- +* Added instances for the types in base where possible + 0.4 --- * Derived `Functor`, `Foldable`, and `Traversable` for `Lift1` and `Lift2` diff -Nru haskell-prelude-extras-0.4/debian/changelog haskell-prelude-extras-0.4.0.2/debian/changelog --- haskell-prelude-extras-0.4/debian/changelog 2015-06-01 11:16:46.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/debian/changelog 2015-12-04 05:23:10.000000000 +0000 @@ -1,14 +1,22 @@ -haskell-prelude-extras (0.4-3build2) wily; urgency=medium +haskell-prelude-extras (0.4.0.2-1) unstable; urgency=medium - * Rebuild for new GHC ABIs. + * New upstream release - -- Colin Watson Mon, 01 Jun 2015 12:16:46 +0100 + -- Clint Adams Fri, 04 Dec 2015 00:23:10 -0500 -haskell-prelude-extras (0.4-3build1) wily; urgency=medium +haskell-prelude-extras (0.4-5) unstable; urgency=medium - * Rebuild for new GHC ABIs. + * Switch Vcs-Git/Vcs-Browser headers to new location. - -- Colin Watson Sat, 23 May 2015 14:34:32 +0100 + -- Clint Adams Thu, 03 Dec 2015 14:54:56 -0500 + +haskell-prelude-extras (0.4-4) experimental; urgency=medium + + * Bump standards-version to 3.9.6 + * Depend on haskell-devscripts >= 0.10 to ensure that this package + builds against GHC in experimental + + -- Joachim Breitner Thu, 20 Aug 2015 10:28:27 +0200 haskell-prelude-extras (0.4-3) unstable; urgency=medium diff -Nru haskell-prelude-extras-0.4/debian/control haskell-prelude-extras-0.4.0.2/debian/control --- haskell-prelude-extras-0.4/debian/control 2015-04-27 09:46:09.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/debian/control 2015-12-04 05:23:10.000000000 +0000 @@ -1,18 +1,18 @@ Source: haskell-prelude-extras -Section: haskell -Priority: extra Maintainer: Debian Haskell Group Uploaders: Clint Adams -Build-Depends: debhelper (>= 9) - , cdbs - , haskell-devscripts (>= 0.9) - , ghc - , ghc-prof -Build-Depends-Indep: ghc-doc -Standards-Version: 3.9.5 -Homepage: http://hackage.haskell.org/package/prelude-extras -Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-prelude-extras -Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-prelude-extras +Priority: extra +Section: haskell +Build-Depends: debhelper (>= 9), + haskell-devscripts (>= 0.10), + cdbs, + ghc, + ghc-prof, +Build-Depends-Indep: ghc-doc, +Standards-Version: 3.9.6 +Homepage: http://github.com/ekmett/prelude-extras +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-haskell/DHG_packages.git/ +Vcs-Git: git://git.debian.org/git/pkg-haskell/DHG_packages.git X-Description: higher-order versions of Prelude classes Haskell 98 - higher order versions of Prelude classes to ease programming with polymorphic recursion and reduce @@ -20,12 +20,12 @@ Package: libghc-prelude-extras-dev Architecture: any -Depends: ${haskell:Depends} - , ${shlibs:Depends} - , ${misc:Depends} -Recommends: ${haskell:Recommends} -Suggests: ${haskell:Suggests} -Provides: ${haskell:Provides} +Depends: ${haskell:Depends}, + ${shlibs:Depends}, + ${misc:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, +Provides: ${haskell:Provides}, Description: ${haskell:ShortDescription}${haskell:ShortBlurb} ${haskell:LongDescription} . @@ -33,22 +33,23 @@ Package: libghc-prelude-extras-prof Architecture: any -Depends: ${haskell:Depends} - , ${misc:Depends} -Recommends: ${haskell:Recommends} -Suggests: ${haskell:Suggests} -Provides: ${haskell:Provides} +Depends: ${haskell:Depends}, + ${misc:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, +Provides: ${haskell:Provides}, Description: ${haskell:ShortDescription}${haskell:ShortBlurb} ${haskell:LongDescription} . ${haskell:Blurb} Package: libghc-prelude-extras-doc -Section: doc Architecture: all -Depends: ${misc:Depends}, ${haskell:Depends} -Recommends: ${haskell:Recommends} -Suggests: ${haskell:Suggests} +Section: doc +Depends: ${misc:Depends}, + ${haskell:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, Description: ${haskell:ShortDescription}${haskell:ShortBlurb} ${haskell:LongDescription} . diff -Nru haskell-prelude-extras-0.4/prelude-extras.cabal haskell-prelude-extras-0.4.0.2/prelude-extras.cabal --- haskell-prelude-extras-0.4/prelude-extras.cabal 2014-04-19 04:13:40.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/prelude-extras.cabal 2015-09-09 14:25:36.000000000 +0000 @@ -1,8 +1,8 @@ name: prelude-extras category: Polymorphism, Combinators -version: 0.4 +version: 0.4.0.2 license: BSD3 -cabal-version: >= 1.2 +cabal-version: >= 1.6 license-file: LICENSE author: Edward A. Kmett maintainer: Edward A. Kmett @@ -10,9 +10,10 @@ homepage: http://github.com/ekmett/prelude-extras bug-reports: http://github.com/ekmett/prelude-extras/issues copyright: Copyright (C) 2011-2014 Edward A. Kmett -synopsis: Haskell 98 - higher order versions of Prelude classes +synopsis: Higher order versions of Prelude classes +tested-with: GHC == 7.10.2, GHC == 7.8.4, GHC == 7.6.3, GHC == 7.4.2, GHC == 7.0.4 description: - Haskell 98 - higher order versions of Prelude classes to ease programming with polymorphic recursion and reduce UndecidableInstances + Higher order versions of Prelude classes to ease programming with polymorphic recursion and reduce UndecidableInstances . See for further discussion of the approach taken here. build-type: Simple @@ -23,6 +24,10 @@ .vim.custom CHANGELOG.markdown +source-repository head + type: git + location: git://github.com/ekmett/prelude-extras + library build-depends: base >= 4 && < 5 extensions: CPP diff -Nru haskell-prelude-extras-0.4/src/Prelude/Extras.hs haskell-prelude-extras-0.4.0.2/src/Prelude/Extras.hs --- haskell-prelude-extras-0.4/src/Prelude/Extras.hs 2014-04-19 04:13:40.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/src/Prelude/Extras.hs 2015-09-09 14:25:36.000000000 +0000 @@ -6,6 +6,14 @@ #define DEFAULT_SIGNATURES {-# LANGUAGE DefaultSignatures #-} #endif +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 701 +-- GHC.Conc isn't generally safe, but we're just using TVar +{-# LANGUAGE Trustworthy #-} +#endif + +#ifndef MIN_VERSION_base +#define MIN_VERSION_base(x,y,z) 1 +#endif module Prelude.Extras ( @@ -35,13 +43,37 @@ , Lift2(..) ) where +import Control.Applicative import Control.Arrow (first) -import Data.Foldable -import Data.Traversable +import Control.Concurrent (Chan, MVar) +import Data.Complex (Complex) +import Data.Fixed +import Data.IORef (IORef) +import Data.Monoid +import Data.Ratio (Ratio) +import Foreign.ForeignPtr (ForeignPtr) +import Foreign.Ptr (Ptr, FunPtr) +import Foreign.StablePtr (StablePtr) +import GHC.Conc (TVar) import Text.Read import qualified Text.ParserCombinators.ReadP as P import qualified Text.Read.Lex as L +#if MIN_VERSION_base(4,8,0) +import Data.Functor.Identity +#else +import Data.Foldable +import Data.Traversable +#endif + +#if MIN_VERSION_base(4,7,0) +import Data.Proxy +#endif + +#if MIN_VERSION_base(4,6,0) +import Data.Ord (Down(..)) +#endif + infixr 4 ==#, /=#, <#, <=#, >=#, ># infixr 4 ==##, /=##, <##, <=##, >=##, >## @@ -66,6 +98,38 @@ instance Eq1 [] where (==#) = (==) +#if MIN_VERSION_base(4,8,0) +instance Eq1 Identity where (==#) = (==) +instance Eq1 f => Eq1 (Alt f) where Alt x ==# Alt y = x ==# y +#endif +#if MIN_VERSION_base(4,7,0) +instance Eq1 Proxy where (==#) = (==) +instance Eq1 ZipList where (==#) = (==) +#else +instance Eq1 ZipList where ZipList xs ==# ZipList ys = xs == ys +#endif +#if MIN_VERSION_base(4,6,0) +instance Eq1 Down where (==#) = (==) +#endif +instance Eq1 Dual where (==#) = (==) +instance Eq1 Sum where (==#) = (==) +instance Eq1 Product where (==#) = (==) +instance Eq1 First where (==#) = (==) +instance Eq1 Last where (==#) = (==) +instance Eq1 Ptr where (==#) = (==) +instance Eq1 FunPtr where (==#) = (==) +instance Eq1 MVar where (==#) = (==) +instance Eq1 IORef where (==#) = (==) +instance Eq1 ForeignPtr where (==#) = (==) +instance Eq1 TVar where (==#) = (==) +instance Eq1 Fixed where (==#) = (==) +instance Eq1 StablePtr where (==#) = (==) +#if MIN_VERSION_base(4,4,0) +instance Eq1 Ratio where (==#) = (==) +instance Eq1 Complex where (==#) = (==) +instance Eq1 Chan where (==#) = (==) +#endif + class Eq2 f where (==##) :: (Eq a, Eq b) => f a b -> f a b -> Bool #ifdef DEFAULT_SIGNATURES @@ -105,6 +169,29 @@ instance Ord1 Maybe where compare1 = compare instance Ord a => Ord1 (Either a) where compare1 = compare instance Ord1 [] where compare1 = compare +#if MIN_VERSION_base(4,8,0) +instance Ord1 Identity where compare1 = compare +instance Ord1 f => Ord1 (Alt f) where compare1 (Alt x) (Alt y) = compare1 x y +#endif +#if MIN_VERSION_base(4,7,0) +instance Ord1 Proxy where compare1 = compare +instance Ord1 ZipList where compare1 = compare +#else +instance Ord1 ZipList where compare1 (ZipList xs) (ZipList ys) = compare xs ys +#endif +#if MIN_VERSION_base(4,6,0) +instance Ord1 Down where compare1 = compare +#endif +instance Ord1 Dual where compare1 = compare +instance Ord1 Sum where compare1 = compare +instance Ord1 Product where compare1 = compare +instance Ord1 First where compare1 = compare +instance Ord1 Last where compare1 = compare +instance Ord1 Ptr where compare1 = compare +instance Ord1 FunPtr where compare1 = compare +instance Ord1 ForeignPtr where compare1 = compare +instance Ord1 Fixed where compare1 = compare + -- needs Haskell 2011 -- instance Ord1 Complex where compare1 = compare @@ -158,6 +245,38 @@ instance Show1 [] where showsPrec1 = showsPrec instance Show a => Show1 (Either a) where showsPrec1 = showsPrec instance Show a => Show1 ((,) a) where showsPrec1 = showsPrec +#if MIN_VERSION_base(4,8,0) +instance Show1 Identity where showsPrec1 = showsPrec +#endif +#if MIN_VERSION_base(4,7,0) +instance Show1 Proxy where showsPrec1 = showsPrec +instance Show1 ZipList where showsPrec1 = showsPrec +#else +instance Show1 ZipList where + showsPrec1 p (ZipList xs) + = showString "ZipList {getZipList = " + . showList xs + . showString "}" +#endif +#if MIN_VERSION_base(4,8,0) +instance Show1 Down where showsPrec1 = showsPrec +instance Show1 f => Show1 (Alt f) where + showsPrec1 p (Alt x) + = showParen (p > 10) + $ showString "Alt " + . showsPrec1 11 x +#endif +instance Show1 Dual where showsPrec1 = showsPrec +instance Show1 Sum where showsPrec1 = showsPrec +instance Show1 Product where showsPrec1 = showsPrec +instance Show1 First where showsPrec1 = showsPrec +instance Show1 Last where showsPrec1 = showsPrec +instance Show1 Ptr where showsPrec1 = showsPrec +instance Show1 FunPtr where showsPrec1 = showsPrec +instance Show1 ForeignPtr where showsPrec1 = showsPrec +#if MIN_VERSION_base(4,4,0) +instance Show1 Complex where showsPrec1 = showsPrec +#endif -- instance Show1 Complex @@ -247,6 +366,80 @@ readsPrec1 = readsPrec readList1 = readList +#if MIN_VERSION_base(4,8,0) +instance Read1 Identity where + readsPrec1 = readsPrec + readList1 = readList + +instance Read1 f => Read1 (Alt f) where + readsPrec1 p + = readParen (p > 10) $ \s -> + do ("Alt",s1) <- lex s + (x,s2) <- readsPrec1 11 s1 + return (Alt x, s2) + +#endif + +#if MIN_VERSION_base(4,7,0) +instance Read1 Proxy where + readsPrec1 = readsPrec + readList1 = readList +instance Read1 ZipList where + readsPrec1 = readsPrec + readList1 = readList +#else +instance Read1 ZipList where + readList1 = readList1Default + readsPrec1 _ + = readParen False $ \s -> + do ("ZipList" , s1) <- lex s + ("{" , s2) <- lex s1 + ("getZipList", s3) <- lex s2 + ("=" , s4) <- lex s3 + (xs , s5) <- readList s4 + ("}" , s6) <- lex s5 + return (ZipList xs, s6) +#endif + +#if MIN_VERSION_base(4,7,0) +instance Read1 Down where + readsPrec1 = readsPrec + readList1 = readList +#elif MIN_VERSION_base(4,6,0) +instance Read1 Down where + readList1 = readList1Default + readsPrec1 p = readParen (p > 10) $ \s -> + do ("Down",s1) <- lex s + (x ,s2) <- readsPrec 11 s1 + return (Down x, s2) +#endif + +instance Read1 Dual where + readsPrec1 = readsPrec + readList1 = readList + +instance Read1 Sum where + readsPrec1 = readsPrec + readList1 = readList + +instance Read1 Product where + readsPrec1 = readsPrec + readList1 = readList + +instance Read1 First where + readsPrec1 = readsPrec + readList1 = readList + +instance Read1 Last where + readsPrec1 = readsPrec + readList1 = readList + +#if MIN_VERSION_base(4,4,0) +instance Read1 Complex where + readsPrec1 = readsPrec + readList1 = readList +#endif + class Read2 f where readsPrec2 :: (Read a, Read b) => Int -> ReadS (f a b) #ifdef DEFAULT_SIGNATURES diff -Nru haskell-prelude-extras-0.4/.travis.yml haskell-prelude-extras-0.4.0.2/.travis.yml --- haskell-prelude-extras-0.4/.travis.yml 2014-04-19 04:13:40.000000000 +0000 +++ haskell-prelude-extras-0.4.0.2/.travis.yml 2015-09-09 14:25:36.000000000 +0000 @@ -1,4 +1,90 @@ -language: haskell +# This file has been generated -- see https://github.com/hvr/multi-ghc-travis +language: c +sudo: false + +cache: + directories: + - $HOME/.cabsnap + - $HOME/.cabal/packages + +before_cache: + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar + +matrix: + include: + - env: CABALVER=1.16 GHCVER=7.0.4 + compiler: ": #GHC 7.0.4" + addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}} + - env: CABALVER=1.16 GHCVER=7.4.2 + compiler: ": #GHC 7.4.2" + addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}} + - env: CABALVER=1.16 GHCVER=7.6.3 + compiler: ": #GHC 7.6.3" + addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}} + - env: CABALVER=1.18 GHCVER=7.8.4 + compiler: ": #GHC 7.8.4" + addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} + - env: CABALVER=1.22 GHCVER=7.10.2 + compiler: ": #GHC 7.10.2" + addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}} + +before_install: + - unset CC + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + +install: + - cabal --version + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" + - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; + then + zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > + $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; + fi + - travis_retry cabal update -v + - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config + - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt + - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt + +# check whether current requested install-plan matches cached package-db snapshot + - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; + then + echo "cabal build-cache HIT"; + rm -rfv .ghc; + cp -a $HOME/.cabsnap/ghc $HOME/.ghc; + cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; + else + echo "cabal build-cache MISS"; + rm -rf $HOME/.cabsnap; + mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; + cabal install --only-dependencies --enable-tests --enable-benchmarks; + fi + +# snapshot package-db on cache miss + - if [ ! -d $HOME/.cabsnap ]; + then + echo "snapshotting package-db to build-cache"; + mkdir $HOME/.cabsnap; + cp -a $HOME/.ghc $HOME/.cabsnap/ghc; + cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; + fi + +# Here starts the actual work to be performed for the package under test; +# any command which exits with a non-zero exit code causes the build to fail. +script: + - if [ -f configure.ac ]; then autoreconf -i; fi + - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging + - cabal build # this builds all libraries and executables (including tests/benchmarks) + - cabal test + - cabal check + - cabal sdist # tests that a source-distribution can be generated + +# Check that the resulting source distribution can be built & installed. +# If there are no other `.tar.gz` files in `dist`, this can be even simpler: +# `cabal install --force-reinstalls dist/*-*.tar.gz` + - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && + (cd dist && cabal install --force-reinstalls "$SRC_TGZ") + notifications: irc: channels: