subG 0.5.3.0 → 0.6.0.0
raw patch · 9 files changed
+45/−25 lines, 9 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- Data/MinMax.hs +5/−3
- Data/MinMax/Preconditions.hs +5/−3
- Data/MinMax3Plus.hs +5/−3
- Data/MinMax3Plus/Preconditions.hs +5/−3
- Data/SubG.hs +8/−5
- Data/SubG/Unfold.hs +5/−2
- LICENSE +1/−1
- subG.cabal +5/−5
CHANGELOG.md view
@@ -55,3 +55,9 @@ ## 0.5.3.0 -- 2022-03-24 * Fifth version revised C. Updated the dependency boundaries to support the latest GHC and Cabal versions.++## 0.6.0.0 -- 2023-01-24++* Sixth version. Switched to NoImplicitPrelude extension. Updated dependencies boundaries. Some+ metadata improvements.+
Data/MinMax.hs view
@@ -1,15 +1,17 @@ -- | -- Module : Data.MinMax--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Functions to find both minimum and maximum elements of the 'F.Foldable' structure of the 'Ord'ered elements. +{-# LANGUAGE NoImplicitPrelude #-}+ module Data.MinMax where -import Prelude hiding (takeWhile,dropWhile,span)+import GHC.Base import Data.SubG import qualified Data.Foldable as F import qualified Data.List as L (sortBy)
Data/MinMax/Preconditions.hs view
@@ -1,16 +1,18 @@ -- | -- Module : Data.MinMax.Preconditions--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Functions to find both minimum and maximum elements of the 'F.Foldable' structure of the 'Ord'ered elements. With the preconditions that the -- structure at least have enough elements (this is contrary to the functions from the module Data.MinMax not checked internally). +{-# LANGUAGE NoImplicitPrelude #-}+ module Data.MinMax.Preconditions where -import Prelude hiding (takeWhile,dropWhile,span)+import GHC.Base import Data.SubG import qualified Data.Foldable as F import qualified Data.List as L (sortBy)
Data/MinMax3Plus.hs view
@@ -1,15 +1,17 @@ -- | -- Module : Data.MinMax3Plus--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Functions to find both minimum and maximum elements of the 'F.Foldable' structure of the 'Ord'ered elements. +{-# LANGUAGE NoImplicitPrelude #-}+ module Data.MinMax3Plus where -import Prelude hiding (takeWhile,dropWhile,span)+import GHC.Base import Data.SubG import qualified Data.Foldable as F import qualified Data.List as L (sortBy)
Data/MinMax3Plus/Preconditions.hs view
@@ -1,16 +1,18 @@ -- | -- Module : Data.MinMax3Plus.Preconditions--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Functions to find both minimum and maximum elements of the 'F.Foldable' structure of the 'Ord'ered elements. With the preconditions that the -- structure at least have enough elements (this is contrary to the functions from the module Data.MinMax not checked internally). +{-# LANGUAGE NoImplicitPrelude #-}+ module Data.MinMax3Plus.Preconditions where -import Prelude hiding (takeWhile,dropWhile,span)+import GHC.Base import Data.SubG import qualified Data.Foldable as F import qualified Data.List as L (sortBy)
Data/SubG.hs view
@@ -1,14 +1,14 @@ -- | -- Module : Data.SubG--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Some extension to the 'F.Foldable' and 'Monoid' classes. Introduces a new class 'InsertLeft' -- the class of types of values that can be inserted from the left -- to the 'F.Foldable' structure that is simultaneously the data that is also the 'Monoid' instance. -{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, NoImplicitPrelude #-} module Data.SubG ( InsertLeft(..)@@ -36,7 +36,10 @@ , partitionG ) where -import Prelude hiding (dropWhile, span, takeWhile)+import GHC.Base+import GHC.Num+import GHC.Real+import Data.Tuple import qualified Data.Foldable as F import Data.Monoid @@ -205,7 +208,7 @@ | otherwise = (zs,x %@ ts,k + 1,n) -- | If a structure is empty, just returns 'Nothing'.-safeHeadG :: (Foldable t) => t a -> Maybe a+safeHeadG :: (F.Foldable t) => t a -> Maybe a safeHeadG = F.find (const True) -- | If the structure is empty, just returns itself. Uses strict variant of the foldl, so is
Data/SubG/Unfold.hs view
@@ -1,18 +1,21 @@ -- | -- Module : Data.SubG.Unfold--- Copyright : (c) OleksandrZhabenko 2021+-- Copyright : (c) OleksandrZhabenko 2021-2023 -- License : MIT -- Stability : Experimental--- Maintainer : olexandr543@yahoo.com+-- Maintainer : oleksandr.zhabenko@yahoo.com -- -- Generalization of the 'Data.List.unfoldr' for the data type that has 'InsertLeft' and 'Monoid' instances. -- Inspired by: https://www.works-hub.com/learn/number-anamorphisms-aka-unfolds-explained-50e1a by Marty Stumpf. +{-# LANGUAGE NoImplicitPrelude #-}+ module Data.SubG.Unfold ( unfoldG , iterateG ) where +import GHC.Base import Data.SubG import Data.Monoid
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020-2021 OleksandrZhabenko+Copyright (c) 2020-2023 Oleksandr Zhabenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
subG.cabal view
@@ -2,14 +2,14 @@ -- see http://haskell.org/cabal/users-guide/ name: subG-version: 0.5.3.0+version: 0.6.0.0 synopsis: Some extension to the Foldable and Monoid classes.-description: Introduces a new class InsertLeft -- the class of types of values that can be inserted from the left to the Foldable structure that is a data that is also the Monoid instance. Also contains some functions to find out both minimum and maximum elements of the finite Foldable structures.+description: Introduces a new class InsertLeft — the class of types of values that can be inserted from the left to the Foldable structure that is a data that is also the Monoid instance. Also contains some functions to find out both minimum and maximum elements of the finite Foldable structures. homepage: https://hackage.haskell.org/package/subG license: MIT license-file: LICENSE author: OleksandrZhabenko-maintainer: olexandr543@yahoo.com+maintainer: oleksandr.zhabenko@yahoo.com copyright: Oleksandr Zhabenko category: Data, Development build-type: Simple@@ -19,7 +19,7 @@ library exposed-modules: Data.SubG, Data.SubG.Unfold, Data.MinMax, Data.MinMax3Plus, Data.MinMax.Preconditions, Data.MinMax3Plus.Preconditions -- other-modules:- other-extensions: MultiParamTypeClasses, FlexibleInstances- build-depends: base >=4.8 && <5+ other-extensions: MultiParamTypeClasses, FlexibleInstances, NoImplicitPrelude+ build-depends: base >=4.13 && <5 -- hs-source-dirs: default-language: Haskell2010