# bos/statistics

Fix build issues with GHC 7

1 parent 9af78af commit fcdf19287fe9ff04eaae2303c166b00f10174298 Bryan O'Sullivan committed
Showing with 7 additions and 8 deletions.
1. +3 −4 Statistics/Function.hs
2. +1 −1 Statistics/Sample/Powers.hs
3. +3 −3 statistics.cabal
7 Statistics/Function.hs
 @@ -24,15 +24,14 @@ module Statistics.Function import Control.Exception (assert) import Control.Monad.Primitive (PrimMonad) -import Data.Vector.Algorithms.Combinators (apply) -import Data.Vector.Generic (unsafeFreeze) +import Data.Vector.Generic (modify, unsafeFreeze) import qualified Data.Vector.Algorithms.Intro as I import qualified Data.Vector.Generic as G import qualified Data.Vector.Generic.Mutable as M -- | Sort a vector. sort :: (Ord e, G.Vector v e) => v e -> v e -sort = apply I.sort +sort = modify I.sort {-# INLINE sort #-} -- | Partially sort a vector, such that the least /k/ elements will be @@ -41,7 +40,7 @@ partialSort :: (G.Vector v e, Ord e) => Int -- ^ The number /k/ of least elements. -> v e -> v e -partialSort k = apply (\a -> I.partialSort a k) +partialSort k = modify (\a -> I.partialSort a k) {-# INLINE partialSort #-} -- | Return the indices of a vector.
2 Statistics/Sample/Powers.hs
 @@ -82,7 +82,7 @@ powers :: G.Vector v Double => -> Powers powers k | k < 2 = error "Statistics.Sample.powers: too few powers" - | otherwise = fini . G.foldl' go (unsafePerformIO \$ MU.newWith l 0) + | otherwise = fini . G.foldl' go (unsafePerformIO \$ MU.replicate l 0) where go ms x = inlinePerformIO \$ loop 0 1 where loop !i !xk | i == l = return ms
6 statistics.cabal
 @@ -1,5 +1,5 @@ name: statistics -version: 0.8.0.3 +version: 0.8.0.4 synopsis: A library of statistical types, data, and functions description: This library provides a number of common functions and types useful @@ -63,8 +63,8 @@ library mwc-random >= 0.7.0.0, primitive >= 0.3, time, - vector >= 0.6.0.2, - vector-algorithms >= 0.3.2 + vector >= 0.7.0.0, + vector-algorithms >= 0.4 if impl(ghc >= 6.10) build-depends: base >= 4