ply-loader 0.4.2 → 0.5.0
raw patch · 3 files changed
+14/−13 lines, 3 filesdep ~vectorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: vector
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- ply-loader.cabal +3/−3
- src/PLY/Internal/StrictReplicate.hs +7/−10
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.5.0++Update to `vector-0.11.0.0` API+ # 0.4.2 Add upper bound on `vector`
ply-loader.cabal view
@@ -1,5 +1,5 @@ name: ply-loader-version: 0.4.2+version: 0.5.0 synopsis: PLY file loader. description: PLY is a lightweight file format for representing 3D@@ -41,7 +41,7 @@ bytestring >= 0.10, linear >= 0.2, lens >= 3.0,- vector >= 0.9 && < 0.11,+ vector >= 0.11, filepath, directory, parallel-io >= 0.3.2,@@ -57,6 +57,6 @@ build-depends: base >= 4.6 && < 5, bytestring >= 0.10, linear >= 0.2,- vector >= 0.9 && < 0.11,+ vector >= 0.11, ply-loader default-language: Haskell2010
src/PLY/Internal/StrictReplicate.hs view
@@ -1,19 +1,16 @@ {-# LANGUAGE BangPatterns #-} module PLY.Internal.StrictReplicate where-import Data.Vector.Generic (Vector, unstream)-import Data.Vector.Fusion.Stream (unsafeFromList)-import Data.Vector.Fusion.Stream.Monadic (Stream (..), Step(..), size, toList)-import Data.Vector.Fusion.Util (delay_inline)-import Data.Vector.Fusion.Stream.Size (Size(..))+import Data.Vector.Generic (Vector, fromList)+import Data.Vector.Fusion.Bundle.Monadic (fromStream, toList)+import Data.Vector.Fusion.Bundle.Size (Size(..))+import Data.Vector.Fusion.Stream.Monadic (Stream (..), Step(..)) -- | Yield a 'Stream' of values obtained by performing the monadic -- action the given number of times. Each value yielded by the monadic -- action is evaluated to WHNF. replicateStreamM' :: Monad m => Int -> m a -> Stream m a {-# INLINE [1] replicateStreamM' #-}--- NOTE: We delay inlining max here because GHC will create a join point for--- the call to newArray# otherwise which is not really nice.-replicateStreamM' n p = Stream step n (Exact (delay_inline max n 0))+replicateStreamM' n p = Stream step n where {-# INLINE [0] step #-} step i | i <= 0 = return Done@@ -24,6 +21,6 @@ -- evaluated to WHNF. replicateM' :: (Monad m, Vector v a) => Int -> m a -> m (v a) replicateM' n p = do let s = replicateStreamM' n p- xs <- toList s- return . unstream $ unsafeFromList (size s) xs+ xs <- toList (fromStream s (Exact n))+ return (fromList xs) {-# INLINE replicateM' #-}