Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-safe for openSUSE:Factory checked in at 2024-01-26 22:47:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-safe (Old) and /work/SRC/openSUSE:Factory/.ghc-safe.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-safe" Fri Jan 26 22:47:26 2024 rev:16 rq:1141629 version:0.3.21 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-safe/ghc-safe.changes 2023-04-04 21:23:03.922095657 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-safe.new.1815/ghc-safe.changes 2024-01-26 22:47:39.637047983 +0100 @@ -1,0 +2,15 @@ +Thu Jan 18 16:51:51 UTC 2024 - Peter Simons <psim...@suse.com> + +- Update safe to version 0.3.21. + 0.3.21, released 2024-01-18 + #34, mark headErr/tailErr as Partial + +------------------------------------------------------------------- +Sun Jan 14 10:19:26 UTC 2024 - Peter Simons <psim...@suse.com> + +- Update safe to version 0.3.20. + 0.3.20, released 2024-01-14 + #34, add headErr, tailErr + #33, avoid using head/tail to avoid x-partial + +------------------------------------------------------------------- Old: ---- safe-0.3.19.tar.gz New: ---- safe-0.3.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-safe.spec ++++++ --- /var/tmp/diff_new_pack.8z7raT/_old 2024-01-26 22:47:41.169103156 +0100 +++ /var/tmp/diff_new_pack.8z7raT/_new 2024-01-26 22:47:41.173103300 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-safe # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %global pkgver %{pkg_name}-%{version} %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.3.19 +Version: 0.3.21 Release: 0 Summary: Library of safe (exception free) functions License: BSD-3-Clause ++++++ safe-0.3.19.tar.gz -> safe-0.3.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/safe-0.3.19/CHANGES.txt new/safe-0.3.21/CHANGES.txt --- old/safe-0.3.19/CHANGES.txt 2020-05-24 22:20:06.000000000 +0200 +++ new/safe-0.3.21/CHANGES.txt 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,10 @@ Changelog for Safe +0.3.21, released 2024-01-18 + #34, mark headErr/tailErr as Partial +0.3.20, released 2024-01-14 + #34, add headErr, tailErr + #33, avoid using head/tail to avoid x-partial 0.3.19, released 2020-05-24 #30, undeprecate maximumDef and friends, fold*1Def 0.3.18, released 2019-12-04 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/safe-0.3.19/LICENSE new/safe-0.3.21/LICENSE --- old/safe-0.3.19/LICENSE 2020-03-08 17:47:11.000000000 +0100 +++ new/safe-0.3.21/LICENSE 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright Neil Mitchell 2007-2020. +Copyright Neil Mitchell 2007-2024. 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/safe-0.3.19/README.md new/safe-0.3.21/README.md --- old/safe-0.3.19/README.md 2019-05-26 13:36:03.000000000 +0200 +++ new/safe-0.3.21/README.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,4 @@ -# Safe [](https://hackage.haskell.org/package/safe) [](https://www.stackage.org/package/safe) [](https://travis-ci.org/ndmitchell/safe) +# Safe [](https://hackage.haskell.org/package/safe) [](https://www.stackage.org/package/safe) [](https://github.com/ndmitchell/safe/actions) A library wrapping `Prelude`/`Data.List` functions that can throw exceptions, such as `head` and `!!`. Each unsafe function has up to four variants, e.g. with `tail`: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/safe-0.3.19/Safe/Exact.hs new/safe-0.3.21/Safe/Exact.hs --- old/safe-0.3.19/Safe/Exact.hs 2018-06-08 22:14:03.000000000 +0200 +++ new/safe-0.3.21/Safe/Exact.hs 2001-09-09 03:46:40.000000000 +0200 @@ -96,7 +96,7 @@ -- > | n >= 0 && n <= length xs = drop n xs -- > | otherwise = error "some message" dropExact :: Partial => Int -> [a] -> [a] -dropExact i xs = withFrozenCallStack $ splitAtExact_ (addNote "" "dropExact") id (flip const) i xs +dropExact i xs = withFrozenCallStack $ splitAtExact_ (addNote "" "dropExact") id (\_ x -> x) i xs -- | -- > splitAtExact n xs = @@ -116,10 +116,10 @@ takeExactDef def = fromMaybe def .^ takeExactMay dropExactNote :: Partial => String -> Int -> [a] -> [a] -dropExactNote note i xs = withFrozenCallStack $ splitAtExact_ (addNote note "dropExactNote") id (flip const) i xs +dropExactNote note i xs = withFrozenCallStack $ splitAtExact_ (addNote note "dropExactNote") id (\_ x -> x) i xs dropExactMay :: Int -> [a] -> Maybe [a] -dropExactMay = splitAtExact_ (const Nothing) Just (flip const) +dropExactMay = splitAtExact_ (const Nothing) Just (\_ x -> x) dropExactDef :: [a] -> Int -> [a] -> [a] dropExactDef def = fromMaybe def .^ dropExactMay diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/safe-0.3.19/Safe.hs new/safe-0.3.21/Safe.hs --- old/safe-0.3.19/Safe.hs 2020-05-24 22:10:40.000000000 +0200 +++ new/safe-0.3.21/Safe.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,10 +1,15 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} + +{-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-} + {- | A module wrapping @Prelude@/@Data.List@ functions that can throw exceptions, such as @head@ and @!!@. -Each unsafe function has up to four variants, e.g. with @tail@: +Each unsafe function has up to five variants, e.g. with @tail@: -* @'tail' :: [a] -> [a]@, raises an error on @tail []@. +* @'tail' :: [a] -> [a]@, raises an error on @tail []@, as provided by 'Prelude'. + +* @'tailErr' :: [a] -> [a]@, alias for @tail@ that doesn't trigger an @x-partial@ warning and does raise errors. * @'tailMay' :: [a] -> /Maybe/ [a]@, turns errors into @Nothing@. @@ -23,6 +28,8 @@ module Safe( -- * New functions abort, at, lookupJust, findJust, elemIndexJust, findIndexJust, + -- * Partial functions + tailErr, headErr, -- * Safe wrappers tailMay, tailDef, tailNote, tailSafe, initMay, initDef, initNote, initSafe, @@ -94,11 +101,28 @@ --------------------------------------------------------------------- -- WRAPPERS +-- | Identical to 'tail', namely that fails on an empty list. +-- Useful to avoid the @x-partial@ warning introduced in GHC 9.8. +-- +-- > tailErr [] = error "Prelude.tail: empty list" +-- > tailErr [1,2,3] = [2,3] +tailErr :: Partial => [a] -> [a] +tailErr = tail + +-- | Identical to 'head', namely that fails on an empty list. +-- Useful to avoid the @x-partial@ warning introduced in GHC 9.8. +-- +-- > headErr [] = error "Prelude.head: empty list" +-- > headErr [1,2,3] = 1 +headErr :: Partial => [a] -> a +headErr = head + -- | -- > tailMay [] = Nothing -- > tailMay [1,3,4] = Just [3,4] tailMay :: [a] -> Maybe [a] -tailMay = liftMay null tail +tailMay [] = Nothing +tailMay (_:xs) = Just xs -- | -- > tailDef [12] [] = [12] @@ -134,7 +158,7 @@ headMay, lastMay :: [a] -> Maybe a -headMay = liftMay null head +headMay = listToMaybe lastMay = liftMay null last headDef, lastDef :: a -> [a] -> a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/safe-0.3.19/safe.cabal new/safe-0.3.21/safe.cabal --- old/safe-0.3.19/safe.cabal 2020-05-24 22:20:13.000000000 +0200 +++ new/safe-0.3.21/safe.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,17 +1,17 @@ -cabal-version: >= 1.18 +cabal-version: 1.18 build-type: Simple name: safe -version: 0.3.19 +version: 0.3.21 license: BSD3 license-file: LICENSE category: Unclassified author: Neil Mitchell <ndmitch...@gmail.com> maintainer: Neil Mitchell <ndmitch...@gmail.com> -copyright: Neil Mitchell 2007-2020 +copyright: Neil Mitchell 2007-2024 homepage: https://github.com/ndmitchell/safe#readme synopsis: Library of safe (exception free) functions bug-reports: https://github.com/ndmitchell/safe/issues -tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2 +tested-with: GHC==9.8, GHC==9.6, GHC==9.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8 description: A library wrapping @Prelude@/@Data.List@ functions that can throw exceptions, such as @head@ and @!!@. Each unsafe function has up to four variants, e.g. with @tail@: