Hello community, here is the log from the commit of package ghc-tagged for openSUSE:Factory checked in at 2015-08-23 15:43:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-tagged (Old) and /work/SRC/openSUSE:Factory/.ghc-tagged.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-tagged" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-tagged/ghc-tagged.changes 2015-05-21 08:38:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-tagged.new/ghc-tagged.changes 2015-08-23 17:39:10.000000000 +0200 @@ -1,0 +2,10 @@ +Fri Aug 7 08:29:50 UTC 2015 - [email protected] + +- update to 0.8.1 +* Add KProxy to the backwards compatibility Data.Proxy module. +* Add a Generic instance to Proxy. +* Added Data.Proxy.TH, based on the code from Frames by Anthony Cowley. +* Removed reproxy from Data.Proxy. This is a bad API decision, but it isn't present + in GHC's Data.Proxy, and this makes the API more stable. + +------------------------------------------------------------------- Old: ---- tagged-0.7.3.tar.gz New: ---- tagged-0.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-tagged.spec ++++++ --- /var/tmp/diff_new_pack.CrMVy3/_old 2015-08-23 17:39:10.000000000 +0200 +++ /var/tmp/diff_new_pack.CrMVy3/_new 2015-08-23 17:39:10.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-tagged # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,32 +15,34 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - %global pkg_name tagged Name: ghc-tagged -Version: 0.7.3 +Version: 0.8.1 Release: 0 Summary: Haskell 98 phantom types to avoid unsafely passing dummy arguments -License: BSD-3-Clause Group: System/Libraries -Url: http://hackage.haskell.org/package/%{pkg_name} -Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz +License: BSD-3-Clause +Url: https://hackage.haskell.org/package/%{pkg_name} +Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: ghc-Cabal-devel BuildRequires: ghc-rpm-macros +BuildRequires: ghc-template-haskell-devel %description -This package provides Haskell 98 phantom types to avoid unsafely passing dummy arguments. +Haskell 98 phantom types to avoid unsafely passing dummy arguments. %package devel Summary: Haskell %{pkg_name} library development files Group: Development/Libraries/Other -Requires: %{name} = %{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 This package provides the Haskell %{pkg_name} library development files. @@ -49,24 +51,31 @@ %prep %setup -q -n %{pkg_name}-%{version} + %build %ghc_lib_build + %install %ghc_lib_install + %post devel %ghc_pkg_recache + %postun devel %ghc_pkg_recache + %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE + %files devel -f %{name}-devel.files %defattr(-,root,root,-) %doc README.markdown + %changelog ++++++ tagged-0.7.3.tar.gz -> tagged-0.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/.travis.yml new/tagged-0.8.1/.travis.yml --- old/tagged-0.7.3/.travis.yml 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/.travis.yml 2015-06-28 07:54:24.000000000 +0200 @@ -1 +1,62 @@ -language: haskell +# NB: don't set `language: haskell` here + +# See also https://github.com/hvr/multi-ghc-travis for more information +env: + # we have to use CABALVER=1.16 for GHC<7.6 as well, as there's + # no package for earlier cabal versions in the PPA + - GHCVER=7.4.2 CABALVER=1.16 + - GHCVER=7.6.3 CABALVER=1.16 + - GHCVER=7.8.4 CABALVER=1.18 + - GHCVER=7.10.1 CABALVER=1.22 + - GHCVER=head CABALVER=1.22 + +matrix: + allow_failures: + - env: GHCVER=head CABALVER=1.22 + +# Note: the distinction between `before_install` and `install` is not +# important. +before_install: + - travis_retry sudo add-apt-repository -y ppa:hvr/ghc + - travis_retry sudo apt-get update + - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + - cabal --version + +install: + - travis_retry cabal update + - cabal install --only-dependencies + - travis_retry sudo apt-get -q -y install hlint || cabal install hlint + +# 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: + # -v2 provides useful information for debugging + - cabal configure -v2 + + # this builds all libraries and executables + # (including tests/benchmarks) + - cabal build + + # tests that a source-distribution can be generated + - cabal sdist + - hlint src --cpp-define HLINT + + # check that the generated source-distribution can be built & installed + - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; + cd dist/; + if [ -f "$SRC_TGZ" ]; then + cabal install --force-reinstalls "$SRC_TGZ"; + else + echo "expected '$SRC_TGZ' not found"; + exit 1; + fi + +notifications: + irc: + channels: + - "irc.freenode.org#haskell-lens" + skip_join: true + template: + - "\x0313tagged\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/CHANGELOG.markdown new/tagged-0.8.1/CHANGELOG.markdown --- old/tagged-0.7.3/CHANGELOG.markdown 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/CHANGELOG.markdown 2015-06-28 07:54:24.000000000 +0200 @@ -1,3 +1,17 @@ +0.8.1 +----- +* Add `KProxy` to the backwards compatibility `Data.Proxy` module. +* Add a `Generic` instance to `Proxy`. + +0.8.0.1 +------- +* Fix builds on GHC 7.4. + +0.8 +--- +* Added `Data.Proxy.TH`, based on the code from `Frames` by Anthony Cowley. +* Removed `reproxy` from `Data.Proxy`. This is a bad API decision, but it isn't present in GHC's `Data.Proxy`, and this makes the API more stable. + 0.7.3 --- * Support `Data.Bifunctor` in `base` for GHC 7.9+. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/HLint.hs new/tagged-0.8.1/HLint.hs --- old/tagged-0.7.3/HLint.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/tagged-0.8.1/HLint.hs 2015-06-28 07:54:24.000000000 +0200 @@ -0,0 +1,2 @@ +ignore "Use camelCase" +ignore "Eta reduce" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/LICENSE new/tagged-0.8.1/LICENSE --- old/tagged-0.7.3/LICENSE 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/LICENSE 2015-06-28 07:54:24.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2009-2013 Edward Kmett +Copyright (c) 2009-2015 Edward Kmett All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/README.markdown new/tagged-0.8.1/README.markdown --- old/tagged-0.7.3/README.markdown 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/README.markdown 2015-06-28 07:54:24.000000000 +0200 @@ -1,4 +1,4 @@ tagged ====== -Values carrying an extra [phantom type](http://www.haskell.org/haskellwiki/Phantom_type) tag. +Values carrying an extra [phantom type](https://wiki.haskell.org/Phantom_type) tag. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/old/Data/Proxy.hs new/tagged-0.8.1/old/Data/Proxy.hs --- old/tagged-0.7.3/old/Data/Proxy.hs 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/old/Data/Proxy.hs 2015-06-28 07:54:24.000000000 +0200 @@ -2,13 +2,15 @@ #ifdef LANGUAGE_DeriveDataTypeable {-# LANGUAGE DeriveDataTypeable #-} #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706 +#if __GLASGOW_HASKELL__ >= 706 +{-# LANGUAGE KindSignatures #-} {-# LANGUAGE PolyKinds #-} #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707 +#if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE StandaloneDeriving #-} #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 +#if __GLASGOW_HASKELL__ >= 702 +{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE Trustworthy #-} #endif {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -27,8 +29,8 @@ ( -- * Proxy values Proxy(..) - , reproxy , asProxyTypeOf + , KProxy(..) ) where import Control.Applicative (Applicative(..)) @@ -39,12 +41,18 @@ #ifdef __GLASGOW_HASKELL__ import GHC.Arr (unsafeIndex, unsafeRangeSize) import Data.Data +#if __GLASGOW_HASKELL__ >= 702 +import GHC.Generics (Generic) +#endif #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 707 +#if __GLASGOW_HASKELL__ >= 707 deriving instance Typeable Proxy #else data Proxy s = Proxy +#if __GLASGOW_HASKELL__ >= 702 + deriving Generic +#endif #endif instance Eq (Proxy s) where @@ -164,18 +172,6 @@ sequence _ = return Proxy {-# INLINE sequence #-} --- | Some times you need to change the proxy you have lying around. --- Idiomatic usage is to make a new combinator for the relationship --- between the proxies that you want to enforce, and define that --- combinator using 'reproxy'. --- --- > data Succ n --- > reproxySucc :: proxy n -> Proxy (Succ n) --- > reproxySucc = reproxy -reproxy :: proxy s -> Proxy t -reproxy _ = Proxy -{-# INLINE reproxy #-} - -- | 'asProxyTypeOf' is a type-restricted version of 'const'. -- It is usually used as an infix operator, and its typing forces its first -- argument (which is usually overloaded) to have the same type as the tag @@ -183,3 +179,16 @@ asProxyTypeOf :: a -> proxy a -> a asProxyTypeOf = const {-# INLINE asProxyTypeOf #-} + +-- | A concrete, promotable proxy type, for use at the kind level +-- There are no instances for this because it is intended at the kind level only +data KProxy +#if __GLASGOW_HASKELL__ >= 706 + (t :: *) +#else + t +#endif + = KProxy +#if defined(LANGUAGE_DeriveDataTypeable) + deriving Typeable +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/src/Data/Proxy/TH.hs new/tagged-0.8.1/src/Data/Proxy/TH.hs --- old/tagged-0.7.3/src/Data/Proxy/TH.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/tagged-0.8.1/src/Data/Proxy/TH.hs 2015-06-28 07:54:24.000000000 +0200 @@ -0,0 +1,96 @@ +{-# LANGUAGE CPP #-} +#ifndef MIN_VERSION_template_haskell +#define MIN_VERSION_template_haskell(x,y,z) 1 +#endif +module Data.Proxy.TH + ( pr +#if MIN_VERSION_template_haskell(2,8,0) + , pr1 +#endif + ) where + +import Data.Char +#if __GLASGOW_HASKELL__ < 710 +import Data.Functor +#endif +#if __GLASGOW_HASKELL__ < 707 +import Data.Version (showVersion) +import Paths_tagged +#endif +import Language.Haskell.TH +import Language.Haskell.TH.Quote +import Language.Haskell.TH.Syntax + +proxy_d, proxy_tc :: Name +#if __GLASGOW_HASKELL__ >= 707 +proxy_d = mkNameG_d "base" "Data.Proxy" "Proxy" +proxy_tc = mkNameG_tc "base" "Data.Proxy" "Proxy" +#else +proxy_d = mkNameG_d taggedPackageKey "Data.Proxy" "Proxy" +proxy_tc = mkNameG_tc taggedPackageKey "Data.Proxy" "Proxy" + +-- note: On 7.10+ this would use CURRENT_PACKAGE_KEY if we still housed the key. +taggedPackageKey :: String +taggedPackageKey = "tagged-" ++ showVersion version +#endif + +proxyTypeQ :: TypeQ -> TypeQ +proxyTypeQ t = appT (conT proxy_tc) t + +proxyExpQ :: TypeQ -> ExpQ +proxyExpQ t = sigE (conE proxy_d) (proxyTypeQ t) + +proxyPatQ :: TypeQ -> PatQ +proxyPatQ t = sigP (conP proxy_d []) (proxyTypeQ t) + +-- | A proxy value quasiquoter. @[pr|T|]@ will splice an expression +-- @Proxy::Proxy T@, while @[pr|A,B,C|]@ will splice in a value of +-- @Proxy :: Proxy [A,B,C]@. + +-- TODO: parse a richer syntax for the types involved here so we can include spaces, applications, etc. +pr :: QuasiQuoter +pr = QuasiQuoter (mkProxy proxyExpQ) (mkProxy proxyPatQ) (mkProxy proxyTypeQ) undefined where + mkProxy :: (TypeQ -> r) -> String -> r + mkProxy p s = case ts of + [h@(t:_)] + | isUpper t -> p $ head <$> cons + | otherwise -> p $ varT $ mkName h +#if MIN_VERSION_template_haskell(2,8,0) + _ -> p $ mkList <$> cons +#endif + where + ts = map strip $ splitOn ',' s + cons = mapM (conT . mkName) ts +#if MIN_VERSION_template_haskell(2,8,0) + mkList = foldr (AppT . AppT PromotedConsT) PromotedNilT +#endif + +#if MIN_VERSION_template_haskell(2,8,0) +-- | Like 'pr', but takes a single type, which is used to produce a +-- 'Proxy' for a single-element list containing only that type. This +-- is useful for passing a single type to a function that wants a list +-- of types. + +-- TODO: parse a richer syntax for the types involved here so we can include spaces, applications, etc. +pr1 :: QuasiQuoter +pr1 = QuasiQuoter (mkProxy proxyExpQ) (mkProxy proxyPatQ) (mkProxy proxyTypeQ) undefined where + sing x = AppT (AppT PromotedConsT x) PromotedNilT + mkProxy p s = case s of + t:_ + | isUpper t -> p (fmap sing (conT $ mkName s)) + | otherwise -> p (fmap sing (varT $ mkName s)) + _ -> error "Empty string passed to pr1" +#endif + +-- | Split on a delimiter. +splitOn :: Eq a => a -> [a] -> [[a]] +splitOn d = go where + go [] = [] + go xs = case t of + [] -> [h] + (_:t') -> h : go t' + where (h,t) = break (== d) xs + +-- | Remove white space from both ends of a 'String'. +strip :: String -> String +strip = takeWhile (not . isSpace) . dropWhile isSpace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/src/Data/Tagged.hs new/tagged-0.8.1/src/Data/Tagged.hs --- old/tagged-0.7.3/src/Data/Tagged.hs 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/src/Data/Tagged.hs 2015-06-28 07:54:24.000000000 +0200 @@ -2,16 +2,19 @@ #ifdef LANGUAGE_DeriveDataTypeable {-# LANGUAGE DeriveDataTypeable #-} #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706 +#if __GLASGOW_HASKELL__ >= 706 {-# LANGUAGE PolyKinds #-} #endif -#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 +#if __GLASGOW_HASKELL__ >= 702 +{-# LANGUAGE DeriveGeneric #-} +#if __GLASGOW_HASKELL__ < 710 {-# LANGUAGE Trustworthy #-} #endif +#endif ---------------------------------------------------------------------------- -- | -- Module : Data.Tagged --- Copyright : 2009-2013 Edward Kmett +-- Copyright : 2009-2015 Edward Kmett -- License : BSD3 -- -- Maintainer : Edward Kmett <[email protected]> @@ -34,23 +37,35 @@ , proxy , unproxy , tagWith + -- * Proxy methods GHC dropped + , reproxy ) where +#if __GLASGOW_HASKELL__ >= 710 +import Control.Applicative (liftA2) +#else import Control.Applicative ((<$>), liftA2, Applicative(..)) +import Data.Traversable (Traversable(..)) +import Data.Monoid +#endif +import Data.Foldable (Foldable(..)) import Control.Monad (liftM) #if __GLASGOW_HASKELL__ >= 709 import Data.Bifunctor #endif -import Data.Traversable (Traversable(..)) -import Data.Foldable (Foldable(..)) #ifdef __GLASGOW_HASKELL__ import Data.Data #endif import Data.Ix (Ix(..)) -import Data.Monoid #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 707 import Data.Proxy #endif +#if __GLASGOW_HASKELL__ >= 702 +import GHC.Generics (Generic) +#if __GLASGOW_HASKELL__ >= 706 +import GHC.Generics (Generic1) +#endif +#endif -- | A @'Tagged' s b@ value is a value @b@ with an attached phantom type @s@. -- This can be used in place of the more traditional but less safe idiom of @@ -61,9 +76,17 @@ -- argument, because the newtype is \"free\" newtype Tagged s b = Tagged { unTagged :: b } deriving ( Eq, Ord, Ix, Bounded +#if __GLASGOW_HASKELL__ >= 702 + , Generic +#if __GLASGOW_HASKELL__ >= 706 + , Generic1 +#endif +#endif + #if __GLASGOW_HASKELL__ >= 707 , Typeable #endif + ) #ifdef __GLASGOW_HASKELL__ @@ -296,3 +319,16 @@ tagWith :: proxy s -> a -> Tagged s a tagWith _ = Tagged {-# INLINE tagWith #-} + +-- | Some times you need to change the proxy you have lying around. +-- Idiomatic usage is to make a new combinator for the relationship +-- between the proxies that you want to enforce, and define that +-- combinator using 'reproxy'. +-- +-- @ +-- data Succ n +-- reproxySucc :: proxy n -> 'Proxy' (Succ n) +-- reproxySucc = 'reproxy' +-- @ +reproxy :: proxy a -> Proxy b +reproxy _ = Proxy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tagged-0.7.3/tagged.cabal new/tagged-0.8.1/tagged.cabal --- old/tagged-0.7.3/tagged.cabal 2014-11-04 16:29:58.000000000 +0100 +++ new/tagged-0.8.1/tagged.cabal 2015-06-28 07:54:24.000000000 +0200 @@ -1,5 +1,5 @@ name: tagged -version: 0.7.3 +version: 0.8.1 license: BSD3 license-file: LICENSE author: Edward A. Kmett @@ -9,11 +9,11 @@ synopsis: Haskell 98 phantom types to avoid unsafely passing dummy arguments homepage: http://github.com/ekmett/tagged bug-reports: http://github.com/ekmett/tagged/issues -copyright: 2009-2013 Edward A. Kmett +copyright: 2009-2015 Edward A. Kmett description: Haskell 98 phantom types to avoid unsafely passing dummy arguments build-type: Simple cabal-version: >= 1.10 -extra-source-files: .travis.yml CHANGELOG.markdown README.markdown +extra-source-files: .travis.yml CHANGELOG.markdown README.markdown HLint.hs source-repository head type: git @@ -31,6 +31,14 @@ cpp-options: -DLANGUAGE_DeriveDataTypeable other-extensions: DeriveDataTypeable - if !impl(ghc>=7.7) + if impl(ghc<7.7) hs-source-dirs: old exposed-modules: Data.Proxy + other-modules: Paths_tagged + + if impl(ghc>=7.2 && <7.5) + build-depends: ghc-prim + + if impl(ghc>=7.6) + exposed-modules: Data.Proxy.TH + build-depends: template-haskell >= 2.8 && < 2.11
