summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandrZhabenko <>2020-10-16 16:07:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-10-16 16:07:00 (GMT)
commitadfa68116371922a6ccd59743aed2b8b34a4a252 (patch)
treee9cbb7466d92835aee222e755bc2afaab64e4a30
parent5714298a102a0efbc7ce3ad65acb6b5136676371 (diff)
version 0.1.1.00.1.1.0
-rw-r--r--CHANGELOG.md5
-rw-r--r--Data/SubG.hs13
-rw-r--r--subG.cabal6
3 files changed, 16 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b41c4f5..33c8d18 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,3 +3,8 @@
## 0.1.0.0 -- 2020-10-16
* First version. Released on an unsuspecting world.
+
+## 0.1.1.0 -- 2020-10-16
+
+* First version revised A. Discontinued the support for the GHC-7.8.* series.
+
diff --git a/Data/SubG.hs b/Data/SubG.hs
index af0015a..d8a2a48 100644
--- a/Data/SubG.hs
+++ b/Data/SubG.hs
@@ -5,12 +5,14 @@
-- Stability : Experimental
-- Maintainer : olexandr543@yahoo.com
--
---
+-- Some extension to the 'F.Foldable' and 'Monoid' classes. Introduces a new class 'InsertLeft' -- the type of values that can be inserted from the left
+-- to the 'F.Foldable' structure that is simultaneously the 'Monoid' instance.
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Data.SubG (
- subG
+ InsertLeft(..)
+ , subG
, dropWhile
, takeWhile
, span
@@ -23,7 +25,8 @@ import Data.Monoid
infixr 1 %@, %^
-class (Foldable t, Eq a, Eq (t a)) => InsertLeft t a where
+-- | Some extension to the 'F.Foldable' and 'Monoid' classes.
+class (F.Foldable t, Eq a, Eq (t a)) => InsertLeft t a where
(%@) :: a -> t a -> t a -- infixr 1
(%^) :: t a -> t (t a) -> t (t a)
@@ -31,9 +34,9 @@ instance (Eq a) => InsertLeft [] a where
(%@) = (:)
(%^) = (:)
--- | Inspired by: 'https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.OldList.html#words'
+-- | Inspired by: https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.OldList.html#words
-- and Graham Hutton. A tutorial on the universality and expressiveness of fold. J. Functional Programming 9 (4): 355–372, July 1999.
--- that is available at the URL: 'https://www.cs.nott.ac.uk/~pszgmh/fold.pdf'.
+-- that is available at the URL: https://www.cs.nott.ac.uk/~pszgmh/fold.pdf.
subG :: (InsertLeft t a, Monoid (t a), Monoid (t (t a))) => t a -> t a -> t (t a)
subG whspss xs = if F.null ts then mempty else w %^ subG whspss s''
where ts = dropWhile (`F.elem` whspss) xs
diff --git a/subG.cabal b/subG.cabal
index 9edb2ac..d880215 100644
--- a/subG.cabal
+++ b/subG.cabal
@@ -2,9 +2,9 @@
-- see http://haskell.org/cabal/users-guide/
name: subG
-version: 0.1.0.0
+version: 0.1.1.0
synopsis: Some extension to the Foldable and Monoid classes.
-description: Some extension to the Foldable and Monoid classes. Introduces a new class InsertLeft of the types that can be inserted with values from the left.
+description: Some extension to the Foldable and Monoid classes. Introduces a new class InsertLeft -- the type of values that can be inserted from the left to the Foldable structure that is also a Monoid.
homepage: https://hackage.haskell.org/package/subG
license: MIT
license-file: LICENSE
@@ -20,6 +20,6 @@ library
exposed-modules: Data.SubG
-- other-modules:
other-extensions: MultiParamTypeClasses, FlexibleInstances
- build-depends: base >=4.7 && <4.15
+ build-depends: base >=4.8 && <4.15
-- hs-source-dirs:
default-language: Haskell2010