unamb 0.1.4 → 0.1.5
raw patch · 2 files changed
+15/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src/Data/Unamb.hs +14/−4
- unamb.cabal +1/−1
src/Data/Unamb.hs view
@@ -117,10 +117,20 @@ -- | Commutative operation with annihilator, in parallel. For instance, -- '(*)'/0, '(&&)'/'False', '(||)'/'True', 'min'/'minBound', 'max'/'maxBound'. parAnnihilator :: Eq a => (a -> a -> a) -> a -> (a -> a -> a)-parAnnihilator op ann = parCommute op'- where- op' u v | u == ann = u- | otherwise = op u v++-- parAnnihilator op ann = parCommute op'+-- where+-- op' u v | u == ann = u+-- | otherwise = op u v++-- The parCommute version can waste work while trying the two orderings.+-- In the following version, one branch tries just one annihilator test.++parAnnihilator op ann x y =+ assuming (x == ann) ann `unamb`+ (if y == ann then ann else x `op` y)++ -- | Parallel min with minBound short-circuit pmin :: (Ord a, Bounded a) => a -> a -> a
unamb.cabal view
@@ -1,5 +1,5 @@ Name: unamb-Version: 0.1.4+Version: 0.1.5 Cabal-Version: >= 1.2 Synopsis: Unambiguous choice Category: Concurrency, Data, Other