packages feed

alg 0.2.2.0 → 0.2.2.1

raw patch · 2 files changed

+8/−6 lines, 2 filesdep ~util

Dependency ranges changed: util

Files

Data/BitSet.hs view
@@ -3,10 +3,10 @@ import Control.Applicative import Control.Monad (guard) import Data.Bits-import Data.List (concatMap) import Data.Maybe import Prelude ((==)) import qualified Prelude as Base+import Util import Util.Bits  import Algebra@@ -30,9 +30,9 @@     mempty = zeroBits instance Bits a => Group (BitSet a) where invert = complement -rangeInclusive :: (PartialOrd a, Bits a) => a -> a -> [a]+rangeInclusive :: (PartialOrd a, Bits a, Alternative f) => a -> a -> f a rangeInclusive = \ x y -> go y x <* guard (x ≤ y)-  where go y x = x : concatMap (go y) (setBit x <$> setBits (y .&¬ x))+  where go y x = x <| altMap (go y ∘ setBit x) (setBits (y .&¬ x) :: [_])  (.&?¬) :: (PartialOrd a, Bits a) => a -> a -> Maybe a a .&?¬ b = a .&¬ b <$ guard (b ≤ a)
alg.cabal view
@@ -1,5 +1,5 @@ name:                alg-version:             0.2.2.0+version:             0.2.2.1 synopsis:            Algebraic structures -- description:          license:             BSD3@@ -13,6 +13,7 @@ cabal-version:       >=1.10 tested-with:         GHC ==8.0.2                    , GHC ==8.2.2+                   , GHC ==8.4.2  library   exposed-modules:     Algebra@@ -21,14 +22,15 @@   -- other-modules:          other-extensions:       build-depends:       base >=4.9 && <5-                     , util >=0.1.5 && <0.2+                     , util >=0.1.9 && <0.2   -- hs-source-dirs:         default-language:    Haskell2010   default-extensions:  NoImplicitPrelude                      , LambdaCase                      , EmptyCase+                     , PartialTypeSignatures                      , TypeOperators                      , ConstraintKinds                      , PolyKinds                      , GeneralizedNewtypeDeriving-  ghc-options:         -Wall+  ghc-options:         -Wall -Wno-partial-type-signatures