<div style="min-height:22px;margin-bottom:8px;">I have make some comments on reddit, but still I want to record them here:</div><div style="min-height:22px;margin-bottom:8px;">After reading the new code, I got a feeling that there're some API lacking considerations. Here is some of my personal concerns:</div><div style="min-height:22px;margin-bottom:8px;"><div class="Comment__body " style="box-sizing: border-box; overflow-x: hidden; overflow-y: auto;"><div class="md" style="box-sizing: border-box;"><ol style="box-sizing: border-box; margin-top: 0px; margin-bottom: 9px;"><li style="box-sizing: border-box;"><p style="box-sizing: border-box; word-wrap: break-word; word-break: keep-all; margin: 0px 0px 9px;">The generalized MVar is basically useless because ST is meant to seal its state token, you won't want to add a forkST. You can argue that the atomic operations on MutVar is already added, but still I want to justify its usefulness.</p></li><li style="box-sizing: border-box;"><p style="box-sizing: border-box; word-wrap: break-word; word-break: keep-all; margin: 0px 0px 9px;">There're too much combinators added to PrimArray, is there a plan to port these to other arrays? </p></li><li style="box-sizing: border-box;"><p style="box-sizing: border-box; word-wrap: break-word; word-break: keep-all; margin: 0px 0px 9px;">If we ever provide toList operations, then I would really want it to be a good producer in base's fold-build fusion' view, it's robust and easy to implement, and folding is basically the same speed with List.fold and toList.</p></li></ol><p style="box-sizing: border-box; word-wrap: break-word; word-break: keep-all; margin: 0px 0px 9px;">Anyway it seems I missed the bike shedding, but still I want to thank for all the efforts, I'll try to follow new GitHub workflow more closely.</p></div></div><div class="Comment__toolsContainer clearfix " style="box-sizing: border-box; overflow: auto;"></div></div><div style="min-height:22px;margin-bottom:8px;">Cheers </div><div style="min-height:22px;margin-bottom:8px;">Winter</div><span class="mail-footer" aria-hidden="true">·¢×ÔÎÒµÄiPhone</span><div id="original-content"><br><br><div><div style="font-size:70%;padding:2px 0;">------------------ Original ------------------</div><div style="font-size:70%;background:#f0f0f0;color:#212121;padding:8px;border-radius:4px"><div><b>From:</b> Carter Schonwald <carter.schonwald@gmail.com></div><div><b>Date:</b> Thu,May 31,2018 2:55 AM</div><div><b>To:</b> haskell-cafe <haskell-cafe@haskell.org>, Haskell Libraries <libraries@haskell.org></div><div><b>Subject:</b> Re: [Haskell-cafe] ANN: primitive 0.6.4.0</div></div></div><br><div dir="ltr">This is a pretty exciting (albeit minor version)<div><br></div><div>I'd like to especially thank David Feuer (treeowl ) and Andrew Martin (andrewthad) for their contributions</div><div><br></div><div>the change log has a huge number of bug fixes relative to 0.6.2-3</div><div><br></div><div>also we added some new modules of features </div><div><br></div><div>PrimArray --- unboxed nonsliceable vectors</div><div>MVar -- Mvars that run in any PrimMonad</div><div><br></div><div>augmented the Data.Primitive exports for increased consistency </div><div>(the new .Ptr and .Mvar modules aren't exported in this minor version so users can easily migrate)</div><div><br></div><div><h2 style=" box-sizing:border-box;margin-bottom:16px;font-size:1.5em;font-weight:600;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239);color:rgb(36,41,46); ; ; ; ; ; ; ; font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px ">Changes in version 0.6.4.0</h2><ul style=" box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46); ; ; ; ; ; ; ; font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial "><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Introduce<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.PrimArray</code>, which offers types and function for dealing with a<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">ByteArray</code><span> </span>tagged with a phantom type variable for tracking the element type.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Implement<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">isByteArrayPinned</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">isMutableByteArrayPinned</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Add<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Eq1</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Ord1</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Show1</code>, and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Read1</code><span> </span>instances for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Improve the test suite. This includes having property tests for typeclasses from<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">base</code><span> </span>such as<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Eq</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Ord</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Functor</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Applicative</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Monad</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">IsList</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Monoid</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Foldable</code>, and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Traversable</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the broken<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">IsList</code><span> </span>instance for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">ByteArray</code>. The old definition would allocate a byte array of the correct size and then leave the memory unitialized instead of writing the list elements to it.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the broken<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Functor</code><span> </span>instance for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code>. The old definition would allocate an array of the correct size with thunks for erroring installed at every index. It failed to replace these thunks with the result of the function applied to the elements of the argument array.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the broken<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Applicative</code><span> </span>instances of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>. The old implementation of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  "><*></code><span> </span>for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code>failed to initialize some elements but correctly initialized others in the resulting<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code>. It is unclear what the old behavior of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  "><*></code><span> </span>was for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>, but it was incorrect.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the broken<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Monad</code><span> </span>instances for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the implementation of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">foldl1</code><span> </span>in the<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Foldable</code><span> </span>instances for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Array</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>. In both cases, the old implementation simply returned the first element of the array and made no use of the other elements in the array.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Fix the implementation of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">mconcat</code><span> </span>in the<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Monoid</code><span> </span>instance for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">SmallArray</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Implement<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.Ptr</code>, implementations of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Ptr</code><span> </span>functions that require a<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Prim</code><span> </span>constraint instead of a<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Storable</code><span> </span>constraint.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Add<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">PrimUnlifted</code><span> </span>instances for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">TVar</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">MVar</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Use<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">compareByteArrays#</code><span> </span>for the<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Eq</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Ord</code><span> </span>instances of<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">ByteArray</code><span> </span>when building with GHC 8.4 and newer.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Add<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Prim</code><span> </span>instances for lots of types in<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Foreign.C.Types</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">System.Posix.Types</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Reexport<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.SmallArray</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.UnliftedArray</code><span> </span>from<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Add fold functions and map function to<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.UnliftedArray</code>. Add typeclass instances for<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">IsList</code>,<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Ord</code>, and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Show</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Add<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">defaultSetByteArray#</code><span> </span>and<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">defaultSetOffAddr#</code><span> </span>to<span> </span><code style=" box-sizing:border-box; ; ; ; ; ; ;  ">Data.Primitive.Types</code>.</p></li></ul><br></div></div>

</div>