Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-half for openSUSE:Factory checked in at 2024-12-20 23:10:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-half (Old) and /work/SRC/openSUSE:Factory/.ghc-half.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-half" Fri Dec 20 23:10:35 2024 rev:3 rq:1231444 version:0.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-half/ghc-half.changes 2024-05-06 17:52:52.334251635 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-half.new.1881/ghc-half.changes 2024-12-20 23:10:59.193378096 +0100 @@ -1,0 +2,8 @@ +Wed Dec 4 12:27:01 UTC 2024 - Peter Simons <[email protected]> + +- Update half to version 0.3.2. + 0.3.2 [2024.12.04] + ------------------ + * Drop support for pre-8.0 versions of GHC. + +------------------------------------------------------------------- Old: ---- half-0.3.1.tar.gz half.cabal New: ---- half-0.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-half.spec ++++++ --- /var/tmp/diff_new_pack.r0xLD9/_old 2024-12-20 23:11:02.237503603 +0100 +++ /var/tmp/diff_new_pack.r0xLD9/_new 2024-12-20 23:11:02.249504098 +0100 @@ -20,13 +20,12 @@ %global pkgver %{pkg_name}-%{version} %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.3.1 +Version: 0.3.2 Release: 0 Summary: Half-precision floating-point License: BSD-2-Clause URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-base-devel BuildRequires: ghc-base-prof @@ -80,7 +79,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ half-0.3.1.tar.gz -> half-0.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/half-0.3.1/CHANGELOG.markdown new/half-0.3.2/CHANGELOG.markdown --- old/half-0.3.1/CHANGELOG.markdown 2001-09-09 03:46:40.000000000 +0200 +++ new/half-0.3.2/CHANGELOG.markdown 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,7 @@ +0.3.2 [2024.12.04] +------------------ +* Drop support for pre-8.0 versions of GHC. + 0.3.1 [2021-01-04] ------------------ * Downgraded testing claims that NaNs will round-trip, as 32-bit GHCs aren't fulfilling that promise. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/half-0.3.1/half.cabal new/half-0.3.2/half.cabal --- old/half-0.3.1/half.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/half-0.3.2/half.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: >=1.10 name: half -version: 0.3.1 +version: 0.3.2 license: BSD3 license-file: LICENSE copyright: Copyright (C) 2014 Edward A. Kmett @@ -19,16 +19,19 @@ README.markdown CHANGELOG.markdown -tested-with: GHC == 7.4.2 - , GHC == 7.6.3 - , GHC == 7.8.4 - , GHC == 7.10.3 - , GHC == 8.0.2 +tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5 , GHC == 8.8.4 - , GHC == 8.10.3 + , GHC == 8.10.7 + , GHC == 9.0.2 + , GHC == 9.2.8 + , GHC == 9.4.8 + , GHC == 9.6.6 + , GHC == 9.8.4 + , GHC == 9.10.1 + , GHC == 9.12.1 source-repository head type: git @@ -41,33 +44,19 @@ Numeric.Half.Internal hs-source-dirs: src other-extensions: BangPatterns CPP DeriveDataTypeable DeriveGeneric - ForeignFunctionInterface - ghc-options: -Wall -fwarn-tabs -O2 + DeriveLift ForeignFunctionInterface PatternSynonyms + StandaloneDeriving + ghc-options: -Wall -Wtabs -O2 -Wno-missing-pattern-synonym-signatures build-depends: - base >=4.5 && <5, + base >=4.9 && <5, binary >=0.5.1.0 && <0.9, - deepseq >=1.3.0.0 && <1.5, - template-haskell + deepseq >=1.4.2.0 && <1.6, + template-haskell >=2.11 if !impl(ghcjs) c-sources: cbits/half.c - if impl(ghc >= 8.0) - other-extensions: DeriveLift StandaloneDeriving - else - other-extensions: TemplateHaskell - - if impl(ghc >=7.8) - other-extensions: PatternSynonyms - - if impl(ghc <7.6) - build-depends: - ghc-prim - - if impl(ghc >=8) - ghc-options: -Wno-missing-pattern-synonym-signatures - test-suite spec default-language: Haskell2010 type: exitcode-stdio-1.0 @@ -80,6 +69,6 @@ binary, bytestring, half, - QuickCheck >=2.14.1 && <2.15, + QuickCheck >=2.14.1 && <2.16, test-framework, test-framework-quickcheck2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/half-0.3.1/src/Numeric/Half/Internal.hs new/half-0.3.2/src/Numeric/Half/Internal.hs --- old/half-0.3.1/src/Numeric/Half/Internal.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/half-0.3.2/src/Numeric/Half/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,22 +1,11 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 800 {-# LANGUAGE TemplateHaskellQuotes #-} -#else -{-# LANGUAGE TemplateHaskell #-} -#endif -#if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE PatternSynonyms #-} -#endif {-# LANGUAGE Trustworthy #-} -#ifndef MIN_VERSION_base -#define MIN_VERSION_base(x,y,z) 1 -#endif - ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2014 Edward Kmett @@ -36,8 +25,6 @@ , fromHalf , toHalf -- * Patterns - -- | These are available with GHC-7.8 and later. -#if __GLASGOW_HASKELL__ >= 708 , pattern POS_INF , pattern NEG_INF , pattern QNaN @@ -49,7 +36,6 @@ , pattern HALF_DIG , pattern HALF_MIN_10_EXP , pattern HALF_MAX_10_EXP -#endif -- * Pure conversions , pure_floatToHalf , pure_halfToFloat @@ -59,19 +45,13 @@ import Data.Bits import Data.Function (on) import Data.Int -import Data.Typeable import Foreign.C.Types (CUShort (..)) import Foreign.Ptr (castPtr) import Foreign.Storable import GHC.Generics -#ifdef WITH_TEMPLATE_HASKELL -#endif import Text.Read (Read (..)) import Language.Haskell.TH.Syntax (Lift (..)) -#if __GLASGOW_HASKELL__ < 800 -import Language.Haskell.TH -#endif import Data.Binary (Binary (..)) @@ -91,18 +71,13 @@ -- {-# RULES "fromHalf" realToFrac = fromHalf #-} #endif +-- | A half-precision floating point value newtype -#if __GLASGOW_HASKELL__ >= 706 {-# CTYPE "unsigned short" #-} -#endif - Half = Half { getHalf :: CUShort } deriving (Generic, Typeable) + Half = Half { getHalf :: CUShort } deriving Generic instance NFData Half where -#if MIN_VERSION_deepseq(1,4,0) rnf (Half f) = rnf f -#else - rnf (Half f) = f `seq` () -#endif instance Binary Half where put (Half (CUShort w)) = put w @@ -188,8 +163,6 @@ isZero :: Half -> Bool isZero (Half h) = h .&. 0x7fff == 0 -#if __GLASGOW_HASKELL__ >= 708 - -- | Positive infinity pattern POS_INF = Half 0x7c00 @@ -217,14 +190,12 @@ -- | Number of base 10 digits that can be represented without change pattern HALF_DIG = 2 --- Minimum positive integer such that 10 raised to that power is a normalized half +-- | Minimum positive integer such that 10 raised to that power is a normalized half pattern HALF_MIN_10_EXP = -4 --- Maximum positive integer such that 10 raised to that power is a normalized half +-- | Maximum positive integer such that 10 raised to that power is a normalized half pattern HALF_MAX_10_EXP = 4 -#endif - instance Num Half where a * b = toHalf (fromHalf a * fromHalf b) a - b = toHalf (fromHalf a - fromHalf b) @@ -234,18 +205,11 @@ signum = toHalf . signum . fromHalf fromInteger a = toHalf (fromInteger a) -#if __GLASGOW_HASKELL__ >= 800 instance Lift Half where lift (Half (CUShort w)) = [| Half (CUShort w) |] #if MIN_VERSION_template_haskell(2,16,0) liftTyped (Half (CUShort w)) = [|| Half (CUShort w) ||] #endif -#else -instance Lift Half where - lift (Half (CUShort w)) = - appE (conE 'Half) . appE (conE 'CUShort) . litE . integerL . fromIntegral $ - w -#endif -- Adapted from ghc/rts/StgPrimFloat.c -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/half-0.3.1/src/Numeric/Half.hs new/half-0.3.2/src/Numeric/Half.hs --- old/half-0.3.1/src/Numeric/Half.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/half-0.3.2/src/Numeric/Half.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,8 +1,5 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} -#if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE PatternSynonyms #-} -#endif ----------------------------------------------------------------------------- -- | @@ -23,8 +20,6 @@ , fromHalf , toHalf -- * Patterns - -- | These are available with GHC-7.8 and later. -#if __GLASGOW_HASKELL__ >= 708 , pattern POS_INF , pattern NEG_INF , pattern QNaN @@ -36,7 +31,6 @@ , pattern HALF_DIG , pattern HALF_MIN_10_EXP , pattern HALF_MAX_10_EXP -#endif ) where import Numeric.Half.Internal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/half-0.3.1/test/Spec.hs new/half-0.3.2/test/Spec.hs --- old/half-0.3.1/test/Spec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/half-0.3.2/test/Spec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,9 +1,5 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -#if __GLASGOW_HASKELL__ >= 708 && __GLASGOW_HASKELL__ < 710 -{-# LANGUAGE PatternSynonyms #-} -#endif -{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# OPTIONS_GHC -Wno-orphans #-} import Numeric.Half import Numeric.Half.Internal @@ -74,7 +70,6 @@ isInfinite snan === False ] -#if __GLASGOW_HASKELL__ >= 708 , testGroup "Patterns" [ testProperty "QNaN" $ case qnan of QNaN -> True @@ -89,7 +84,6 @@ NEG_INF -> True _ -> False ] -#endif -- With GHCJS these tests are trivially true. , testGroup "Native fromHalf against C version" @@ -148,7 +142,7 @@ prop_to_half i = let ref = getHalf $ toHalf i imp = getHalf $ pure_floatToHalf i - in ref == imp + in (ref == imp) || (isNaN (Half ref) && isNaN (Half imp)) -- cover all range of Half(not Float) list1 :: [Float] @@ -156,12 +150,16 @@ r1 = filter (not . isNaN) $ map (fromHalf . Half) [0 .. 65535] r2 = sort $ filter (not . isInfinite) $ filter (>= 0) r1 r3 = r2 ++ [last r2 + 2 ** 11] - r4 = zipWith (\a b -> let d = (b - a) / 4 - in [a, a + d, a + d * 2, a + d * 3]) - r3 (tail r3) + r4 = zipWithTail (\a b -> let d = (b - a) / 4 + in [a, a + d, a + d * 2, a + d * 3]) + r3 r5 = concat r4 ++ [last r3] in r5 +zipWithTail :: (a -> a -> b) -> [a] -> [b] +zipWithTail _ [] = [] +zipWithTail f xs@(_:xss) = zipWith f xs xss + list2 :: [Float] list2 = map negate list1
