packages feed

ListLike 4.7.8.1 → 4.7.8.2

raw patch · 7 files changed

+36/−16 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ CHANGES ======= +#### 4.7.8.2 (2023-10-10)++  - pacify GHC 9.8's new `x-partial` warning+  - tested with GHC 7.10 - 9.8+ #### 4.7.8.1 (2023-07-12)    - allow `bytestring-0.12` and fix its deprecation warnings
ListLike.cabal view
@@ -1,12 +1,13 @@+Cabal-Version: >= 1.10 Name: ListLike-Version: 4.7.8.1+Version: 4.7.8.2+ License: BSD3 Maintainer: David Fox <dsf@seereason.com>, Andreas Abel Author: John Goerzen Copyright: Copyright (c) 2007-2008 John Goerzen license-file: COPYRIGHT Category: list, string, text, bytestring, vector-Cabal-Version: >= 1.10 Build-Type: Simple homepage: http://github.com/ddssff/listlike synopsis: Generalized support for list-like structures@@ -23,8 +24,9 @@ Stability: Stable  Tested-With:-  GHC == 9.6.2-  GHC == 9.4.5+  GHC == 9.8.1+  GHC == 9.6.3+  GHC == 9.4.7   GHC == 9.2.8   GHC == 9.0.2   GHC == 8.10.7@@ -66,10 +68,10 @@           Data.ListLike.FMList   -- Other-Modules: Data.ConfigFile.Lexer   Build-Depends: base       >= 4.8   && < 5-                ,containers >= 0.3   && < 0.7+                ,containers >= 0.3   && < 0.8                 ,bytestring >= 0.9.1 && < 0.13                 ,array      >= 0.3   && < 0.6-                ,text       >= 0.11  && < 1.3  || == 2.0.*+                ,text       >= 0.11  && < 1.3  || >= 2.0 && < 2.2                 ,vector     >= 0.5   && < 0.14                 ,dlist      >= 0.7   && < 1.1                 ,fmlist     >= 0.8   && < 0.10
README.md view
@@ -1,5 +1,7 @@-[![Build Status](https://secure.travis-ci.org/ddssff/ListLike.png?branch=master)](http://travis-ci.org/ddssff/ListLike)-[![Build Status](https://github.com/ddssff/ListLike/workflows/Haskell-CI/badge.svg)](https://github.com/ddssff/ListLike/actions)+[![Build Status](https://github.com/ddssff/listlike/actions/workflows/haskell-ci.yml/badge.svg?branch=master)](https://github.com/ddssff/listlike/actions/workflows/haskell-ci.yml)+[![Hackage](https://img.shields.io/hackage/v/ListLike.svg)](https://hackage.haskell.org/package/ListLike)+[![Stackage Nightly](http://stackage.org/package/ListLike/badge/nightly)](http://stackage.org/nightly/package/ListLike)+[![Stackage LTS](http://stackage.org/package/ListLike/badge/lts)](http://stackage.org/lts/package/ListLike)  ListLike ========
src/Data/ListLike/Base.hs view
@@ -605,9 +605,11 @@     cons x l = x : l     snoc l x = l ++ [x]     append = (++)-    head = L.head+    -- Andreas Abel, 2023-10-10, issue #32:+    -- Use implementation of 'head' and 'tail' in terms of 'uncons' to avoid the x-partial warning under GHC 9.8+    uncons []       = Nothing+    uncons (x : xs) = Just (x, xs)     last = L.last-    tail = L.tail     init = L.init     null = L.null     length = L.length
src/Data/ListLike/DList.hs view
@@ -50,7 +50,9 @@   -- The following tail function restores the spirit of difference   -- lists, at the cost of breaking data abstraction, i.e.,   -- using the constructor and destructor of the newtype DList.-  tail = UnsafeDList . (List.tail .) . unsafeApplyDList+  -- Andreas Abel, 2023-10-10, issue #32:+  -- Use @drop 1@ instead of @tail@ as the latter triggers the x-partial warning in GHC 9.8.+  tail = UnsafeDList . (List.drop 1 .) . unsafeApplyDList #else   tail = D.tail #endif
testsrc/TestInfrastructure.hs view
@@ -271,10 +271,11 @@     foldl1 f (MyList x) = foldl1 f x  instance Sem.Semigroup (MyList a) where-  (<>) = mappend+    MyList x <> MyList y = MyList (x ++ y)+ instance Monoid (MyList a) where     mempty = MyList []-    mappend (MyList x) (MyList y) = MyList (x ++ y)+    mappend = (Sem.<>)  instance IsList (MyList a) where     type Item (MyList a) = a@@ -283,8 +284,10 @@  instance LL.ListLike (MyList a) a where     singleton x = MyList [x]-    head (MyList x) = head x-    tail (MyList x) = MyList (tail x)+    -- Andreas Abel, 2023-10-10, issue #32:+    -- Avoid 'head' and 'tail' from 'Prelude' and thus the x-partial warning of GHC 9.8.+    head (MyList (x:xs)) = x+    tail (MyList (x:xs)) = MyList xs     null (MyList x) = null x  instance IsString (MyList Char) where
testsrc/runtests.hs view
@@ -58,9 +58,13 @@ prop_cons f i = llcmp (LL.cons i f) (i : (LL.toList f)) prop_append f1 f2 = llcmp (LL.append f1 f2) (LL.toList f1 ++ LL.toList f2) prop_head f = not (LL.null f) ==> LL.head f == head (LL.toList f)-prop_last f = not (LL.null f) ==> LL.last f == last (LL.toList f)+  where head (x:xs) = x+  -- Andreas Abel, 2023-10-10, issue #32:+  -- Redefine 'head' and 'tail' to avoid the x-partial warning of GHC 9.8. prop_tail f = not (LL.null f) ==> llcmp (LL.tail f) (tail (LL.toList f))+  where tail (x:xs) = xs prop_init f = not (LL.null f) ==> llcmp (LL.init f) (init (LL.toList f))+prop_last f = not (LL.null f) ==> LL.last f == last (LL.toList f) prop_null f = LL.null f == null (LL.toList f) prop_length2 f = checkLengths f (LL.toList f) prop_length3 f1 f2 = llcmp (LL.append f1 f2) (LL.toList f1 ++ LL.toList f2)