free-algebras 0.1.0.1 → 0.1.0.2
raw patch · 8 files changed
+20/−56 lines, 8 filesdep ~hedgehogdep ~mtlPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: hedgehog, mtl
API changes (from Hackage documentation)
- Data.Semigroup.Abelian: instance Data.Semigroup.Abelian.AbelianSemigroup a => Data.Semigroup.Abelian.AbelianSemigroup (Data.Semigroup.Option a)
+ Data.Semigroup.Abelian: instance Data.Semigroup.Abelian.AbelianSemigroup a => Data.Semigroup.Abelian.AbelianSemigroup (GHC.Maybe.Maybe a)
Files
- ChangeLog.md +3/−0
- README.md +1/−1
- free-algebras.cabal +4/−4
- src/Control/Algebra/Free.hs +1/−20
- src/Data/Algebra/Free.hs +2/−14
- src/Data/Group/Free.hs +2/−5
- src/Data/Semigroup/Abelian.hs +7/−9
- src/Data/Semigroup/Semilattice.hs +0/−3
ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for free-algebras +## Version 0.1.0.2+- Support `GHC-9.0`, `GHC-9.2` and `GHC-9.4`, drop support for `GHC-8.6` or earlier.+ ## Version 0.0.8.0 - Added two properties for each: `foldMapFree`, `foldNatFree` and `foldNatFree2`.
README.md view
@@ -1,6 +1,6 @@ # Free Algebras [](http://github.com/coot)-[](https://circleci.com/gh/coot/free-algebras/tree/master)+[](https://github.com/coot/free-algebras/actions/workflows/posix.yml) Universal algebra approach (which is compatible with categorical approach) to free algebras (including higher order structures like functors, applicative
free-algebras.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: free-algebras-version: 0.1.0.1+version: 0.1.0.2 synopsis: Free algebras description: Algebraic approach to free algebras, inspired by Univeral Algebra and@@ -19,7 +19,7 @@ ChangeLog.md README.md stability: experimental-tested-with: GHC==8.6.5, GHC==8.8.4, GHC==8.10.4+tested-with: GHC==8.8.4, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4, GHC==9.4.2 source-repository head type: git@@ -57,7 +57,7 @@ , free >= 4.0 && <6.0 , groups >= 0.3 && <0.6 , kan-extensions >= 4.1 && <6.0- , mtl >= 2.2 && <2.3+ , mtl >= 2.2 && <2.4 , transformers >= 0.5 && <0.6 default-language: Haskell2010 @@ -92,7 +92,7 @@ , dlist , free , groups- , hedgehog >= 0.6 && < 1.1+ , hedgehog >= 0.6 && < 1.3 , kan-extensions , mtl , transformers
src/Control/Algebra/Free.hs view
@@ -13,10 +13,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}-#if __GLASGOW_HASKELL__ >= 806 {-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-}-#endif -- 'ListT' transformer is depreciated {-# OPTIONS_GHC -Wno-deprecations #-}@@ -54,9 +52,7 @@ ) where import Control.Applicative ( Alternative (..)-#if __GLASGOW_HASKELL__ >= 806 , liftA2-#endif ) import Control.Applicative.Free (Ap) import qualified Control.Applicative.Free as Ap@@ -64,11 +60,7 @@ import qualified Control.Applicative.Free.Final as Final import Control.Alternative.Free (Alt (..)) import qualified Control.Alternative.Free as Alt-#if __GLASGOW_HASKELL__ >= 806 import Control.Monad ( MonadPlus (..), foldM, join)-#else-import Control.Monad ( foldM, join)-#endif import Control.Monad.Except (ExceptT (..), MonadError (..)) import Control.Monad.Free (Free) import qualified Control.Monad.Free as Free@@ -86,9 +78,7 @@ import Control.Monad.Writer.Class (MonadWriter (..)) import qualified Control.Monad.Writer.Lazy as L (WriterT (..)) import qualified Control.Monad.Writer.Strict as S (WriterT (..))-#if __GLASGOW_HASKELL__ >= 806 import Control.Monad.Zip (MonadZip (..))-#endif import Data.Kind (Constraint, Type) import Data.Fix (Fix, cataM) import Data.Functor.Coyoneda (Coyoneda (..), liftCoyoneda)@@ -216,7 +206,7 @@ -- | @'unFoldNatFree'@ is an inverse of @'foldNatFree'@ ----- It is uniquelly determined by its universal property (by Yonneda lemma):+-- It is uniquely determined by its universal property (by Yonneda lemma): -- -- prop> unFoldNatFree id = ruturnFree1 --@@ -609,7 +599,6 @@ runFree1 :: forall g. c g => (forall x. f x -> g x) -> g a } -#if __GLASGOW_HASKELL__ >= 806 -- -- instances for @'Free1'@ using quantified constraints --@@ -651,13 +640,7 @@ Free1 f >>= k = Free1 $ \h -> f h >>= (\a -> case k a of Free1 l -> l h) - Free1 f >> Free1 g = Free1 $ \h -> f h >> g h -#if __GLASGOW_HASKELL__ < 808- fail s = Free1 $ \_ -> fail s-#endif-- instance (forall h. c h => Alternative h, c (Free1 c f)) => Alternative (Free1 c f) where empty = Free1 $ \_ -> empty@@ -694,8 +677,6 @@ liftFree = \fa -> Free1 $ \g -> g fa foldNatFree nat (Free1 f) = f nat--#endif -- $monadContT --
src/Data/Algebra/Free.hs view
@@ -38,9 +38,6 @@ import Prelude -#if __GLASGOW_HASKELL__ < 808-import Data.DList (DList)-#endif import Data.DList as DList import Data.Functor.Identity (Identity (..)) #if MIN_VERSION_data_fix(0,3,0)@@ -52,16 +49,7 @@ import Data.Kind (Constraint, Type) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NonEmpty-import Data.Monoid ( Endo (..)-#if __GLASGOW_HASKELL__ < 808- , Monoid (..)-#endif- , Dual (..))-#if __GLASGOW_HASKELL__ < 808-import Data.Semigroup ( Semigroup- , (<>)- )-#endif+import Data.Monoid (Endo (..), Dual (..)) import Data.Algebra.Pointed (Pointed (..)) --@@ -144,7 +132,7 @@ -- | Inverse of @'foldMapFree'@ ----- It is uniquelly determined by its universal property (by Yonneda lemma):+-- It is uniquely determined by its universal property (by Yonneda lemma): -- -- prop> unFoldMapFree id = returnFree --
src/Data/Group/Free.hs view
@@ -30,9 +30,6 @@ #endif import Data.Group (Group (..)) import Data.List (foldl')-#if __GLASGOW_HASKELL__ < 808-import Data.Semigroup (Semigroup (..))-#endif import Data.Algebra.Free ( AlgebraType@@ -62,11 +59,11 @@ fmap f (FreeGroup as) = FreeGroup $ bimap f f <$> as instance Applicative FreeGroup where- pure = return+ pure a = FreeGroup $ DList.singleton (Right a) (<*>) = ap instance Monad FreeGroup where- return a = FreeGroup $ DList.singleton (Right a)+ return = pure FreeGroup as >>= f = FreeGroup $ as >>= runFreeGroup . either f f -- | Normalize a @Dlist@, i.e. remove adjacent inverses from a word, i.e.
src/Data/Semigroup/Abelian.hs view
@@ -1,6 +1,9 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} +-- 'Option' will be removed in 'ghc-9.2'.+{-# OPTIONS_GHC -Wno-deprecations #-}+ module Data.Semigroup.Abelian ( AbelianSemigroup , FreeAbelianSemigroup@@ -14,19 +17,15 @@ import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set)-#if __GLASGOW_HASKELL__ < 808 import Data.Semigroup- ( Semigroup (..),-#else-import Data.Semigroup- (-#endif- All+ ( All , Any , Dual , Max , Min+#if __GLASGOW_HASKELL__ < 902 , Option+#endif , Product , Sum )@@ -60,9 +59,8 @@ instance Ord a => AbelianSemigroup (Min a) -#if __GLASGOW_HASKELL__ >= 900 instance AbelianSemigroup a => AbelianSemigroup (Maybe a)-#else+#if __GLASGOW_HASKELL__ < 902 instance AbelianSemigroup a => AbelianSemigroup (Option a) #endif
src/Data/Semigroup/Semilattice.hs view
@@ -13,9 +13,6 @@ import Data.IntSet (IntSet) import Data.Semigroup ( All , Any-#if __GLASGOW_HASKELL__ < 808- , Semigroup-#endif , sconcat) import Data.Set (Set) import qualified Data.Set as Set