Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Revision history for pqueue

## 1.7.0.0

* Change `Read` and `Show` instances to use `fromList`
([#144](https://github.com/lspitzner/pqueue/issues/144))

## 1.6.0.0 -- 2025-10-11

* Deprecate `mapU` and replace it by `mapMonotonic` in `Data.PQeueu.Min` and `Data.PQueue.Max`
Expand Down
12 changes: 6 additions & 6 deletions src/BinomialQueue/Internals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -726,21 +726,21 @@ instance NFData a => NFData (MinQueue a) where

instance (Ord a, Show a) => Show (MinQueue a) where
showsPrec p xs = showParen (p > 10) $
showString "fromAscList " . shows (toAscList xs)
showString "fromList " . shows (toAscList xs)

instance Read a => Read (MinQueue a) where
instance (Ord a, Read a) => Read (MinQueue a) where
#ifdef __GLASGOW_HASKELL__
readPrec = parens $ prec 10 $ do
Ident "fromAscList" <- lexP
Ident "fromList" <- lexP
xs <- readPrec
return (fromAscList xs)
return (fromList xs)

readListPrec = readListPrecDefault
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromAscList",s) <- lex r
("fromList",s) <- lex r
(xs,t) <- reads s
return (fromAscList xs,t)
return (fromList xs,t)
#endif

instance Ord a => Semigroup (MinQueue a) where
Expand Down
12 changes: 6 additions & 6 deletions src/Data/PQueue/Internals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -357,21 +357,21 @@ instance NFData a => NFData (MinQueue a) where

instance (Ord a, Show a) => Show (MinQueue a) where
showsPrec p xs = showParen (p > 10) $
showString "fromAscList " . shows (toAscList xs)
showString "fromList " . shows (toAscList xs)

instance Read a => Read (MinQueue a) where
instance (Ord a, Read a) => Read (MinQueue a) where
#ifdef __GLASGOW_HASKELL__
readPrec = parens $ prec 10 $ do
Ident "fromAscList" <- lexP
Ident "fromList" <- lexP
xs <- readPrec
return (fromAscList xs)
return (fromList xs)

readListPrec = readListPrecDefault
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromAscList",s) <- lex r
("fromList",s) <- lex r
(xs,t) <- reads s
return (fromAscList xs,t)
return (fromList xs,t)
#endif

instance Ord a => Semigroup (MinQueue a) where
Expand Down
12 changes: 6 additions & 6 deletions src/Data/PQueue/Max.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

import Data.Coerce (coerce)
#if !MIN_VERSION_base(4,20,0)
import Data.Foldable (foldl')

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.2.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.2.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.6.5)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.6.5)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.4.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.4.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.6.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.6.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.4.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.4.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.2.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.2.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.2.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.2.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.6.5)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.6.5)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.6.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.6.7)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.4.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.4.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.8.4)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.4.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (9.4.8)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.2.2)

The import of ‘Data.Foldable’ is redundant

Check warning on line 92 in src/Data/PQueue/Max.hs

View workflow job for this annotation

GitHub Actions / build (8.2.2)

The import of ‘Data.Foldable’ is redundant
#endif
import Data.Maybe (fromMaybe)
import Data.Semigroup (Semigroup(..), stimesMonoid)
Expand Down Expand Up @@ -124,21 +124,21 @@

instance (Ord a, Show a) => Show (MaxQueue a) where
showsPrec p xs = showParen (p > 10) $
showString "fromDescList " . shows (toDescList xs)
showString "fromList " . shows (toDescList xs)

instance Read a => Read (MaxQueue a) where
instance (Ord a, Read a) => Read (MaxQueue a) where
#ifdef __GLASGOW_HASKELL__
readPrec = parens $ prec 10 $ do
Ident "fromDescList" <- lexP
Ident "fromList" <- lexP
xs <- readPrec
return (fromDescList xs)
return (fromList xs)

readListPrec = readListPrecDefault
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromDescList",s) <- lex r
("fromList",s) <- lex r
(xs,t) <- reads s
return (fromDescList xs,t)
return (fromList xs,t)
#endif

instance Ord a => Semigroup (MaxQueue a) where
Expand Down
12 changes: 6 additions & 6 deletions src/Data/PQueue/Prio/Internals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,21 @@ instance Ord k => Monoid (MinPQueue k a) where

instance (Ord k, Show k, Show a) => Show (MinPQueue k a) where
showsPrec p xs = showParen (p > 10) $
showString "fromAscList " . shows (toAscList xs)
showString "fromList " . shows (toAscList xs)

instance (Read k, Read a) => Read (MinPQueue k a) where
instance (Ord k, Read k, Read a) => Read (MinPQueue k a) where
#ifdef __GLASGOW_HASKELL__
readPrec = parens $ prec 10 $ do
Ident "fromAscList" <- lexP
Ident "fromList" <- lexP
xs <- readPrec
return (fromAscList xs)
return (fromList xs)

readListPrec = readListPrecDefault
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromAscList",s) <- lex r
("fromList",s) <- lex r
(xs,t) <- reads s
return (fromAscList xs,t)
return (fromList xs,t)
#endif

-- | The union of a list of queues: (@'unions' == 'List.foldl' 'union' 'empty'@).
Expand Down
12 changes: 6 additions & 6 deletions src/Data/PQueue/Prio/Max/Internals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,21 @@ instance Ord k => Monoid (MaxPQueue k a) where

instance (Ord k, Show k, Show a) => Show (MaxPQueue k a) where
showsPrec p xs = showParen (p > 10) $
showString "fromDescList " . shows (toDescList xs)
showString "fromList " . shows (toDescList xs)

instance (Read k, Read a) => Read (MaxPQueue k a) where
instance (Ord k, Read k, Read a) => Read (MaxPQueue k a) where
#ifdef __GLASGOW_HASKELL__
readPrec = parens $ prec 10 $ do
Ident "fromDescList" <- lexP
Ident "fromList" <- lexP
xs <- readPrec
return (fromDescList xs)
return (fromList xs)

readListPrec = readListPrecDefault
#else
readsPrec p = readParen (p > 10) $ \r -> do
("fromDescList",s) <- lex r
("fromList",s) <- lex r
(xs,t) <- reads s
return (fromDescList xs,t)
return (fromList xs,t)
#endif

instance Functor (MaxPQueue k) where
Expand Down
Loading