packages feed

acts 0.3.0.0 → 0.3.1.0

raw patch · 3 files changed

+30/−7 lines, 3 filesdep ~basedep ~finitarydep ~groupsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, finitary, groups

API changes (from Hackage documentation)

Files

acts.cabal view
@@ -1,7 +1,7 @@ cabal-version:  2.4
 name:           acts
-version:        0.3.0.0
-synopsis:       Semigroup actions, groups, and torsors.
+version:        0.3.1.0
+synopsis:       Semigroup actions and torsors.
 category:       Algebra, Math
 license:        BSD-3-Clause
 build-type:     Simple
@@ -42,17 +42,30 @@   type: git
   location: git://github.com/sheaf/acts.git
 
+flag finitary
+  description:
+    Use the 'finitary' library to define actions on finite enumerations.
+    .
+    Disable to remove dependencies on `finite-typelits` and `finitary`.
+  default: True
+  manual: False
+
 common common
 
   build-depends: 
       base
         >= 4.12 && < 4.15
-    , finitary
-        ^>= 1.2.0.0
-    , finite-typelits
-        ^>= 0.1.4.2
     , groups
         ^>= 0.4.0.0
+
+  if flag(finitary)
+    cpp-options:
+        -DFIN
+    build-depends:
+        finitary
+          ^>= 1.2.0.0
+      , finite-typelits
+          ^>= 0.1.4.2
 
   default-language:
       Haskell2010
changelog.md view
@@ -1,5 +1,10 @@ # Changelog for package `acts`
 
+## 0.3.1.0 ( February 23, 2020 )
+
+* Add a cabal flag to remove dependencies on `finite-typelits` and `finitary`,
+at the cost of the instances providing actions on finite types.
+
 ## 0.3.0.0 ( February 16, 2020 )
 
 * Switch to using the `groups` package for the definition of the `Group` typeclass,
src/Data/Act.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE
-    DeriveGeneric
+    CPP
+  , DeriveGeneric
   , DeriveDataTypeable
   , DerivingVia
   , FlexibleInstances
@@ -72,6 +73,7 @@ import Control.DeepSeq
   ( NFData )
 
+#ifdef FIN
 -- finitary
 import Data.Finitary
   ( Finitary(..) )
@@ -79,6 +81,7 @@ -- finite-typelits
 import Data.Finite
   ( Finite )
+#endif
 
 -- groups
 import Data.Group
@@ -198,6 +201,7 @@   deriving stock   ( Show, Read, Data, Generic, Generic1 )
   deriving newtype ( Eq, Ord, NFData )
 
+#ifdef FIN
 -- | Act on a type through its 'Finitary' instance.
 instance ( Semigroup s, Act    s ( Finite n ), Finitary a, n ~ Cardinality a )
         => Act    s ( Finitely a ) where
@@ -206,6 +210,7 @@ instance ( Group     g, Torsor g ( Finite n ), Finitary a, n ~ Cardinality a )
       => Torsor g ( Finitely a ) where
   Finitely x --> Finitely y = toFinite x --> toFinite y
+#endif 
 
 -----------------------------------------------------------------