primitive-extras 0.1.3 → 0.1.3.1
raw patch · 2 files changed
+15/−1 lines, 2 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ PrimitiveExtras.IO: replicateArray :: Int -> IO a -> IO (Array a)
Files
- library/PrimitiveExtras/IO.hs +14/−0
- primitive-extras.cabal +1/−1
library/PrimitiveExtras/IO.hs view
@@ -25,3 +25,17 @@ loop (succ index) else unsafeFreezeArray array in loop 0++replicateArray :: Int -> IO a -> IO (Array a)+replicateArray size elementIO =+ do+ array <- newArray size undefined+ let+ loop index =+ if index < size+ then do+ element <- elementIO+ writeArray array index element+ loop (succ index)+ else unsafeFreezeArray array+ in loop 0
primitive-extras.cabal view
@@ -1,7 +1,7 @@ name: primitive-extras version:- 0.1.3+ 0.1.3.1 category: Primitive synopsis: