<div><div dir="auto">Sounds reasonable to me. </div><div dir="auto"><br></div><div dir="auto">Is this kinda like the api in the whitherable package ?</div><br><div class="gmail_quote"><div>On Sun, Mar 11, 2018 at 1:30 AM David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">The vector package offers<div dir="auto"><br></div><div dir="auto">createT :: Traversable t</div><div dir="auto"> => (forall s. ST s (t (MVector s a)))</div><div dir="auto"> -> t (Vector a)</div><div dir="auto"><br></div><div dir="auto">This is a generalization of create, which is very similar to runSTArray in the array package. I suggest we add functions</div><div dir="auto"><br></div><div dir="auto">runSTArrays :: Traversable t</div><div dir="auto"> => (forall s. ST s (t (STArray s i e)))</div><div dir="auto"> -> t (Array i e)</div><div dir="auto"><br></div><div dir="auto"><div dir="auto" style="font-family:sans-serif">runSTUArrays :: Traversable t</div><div dir="auto" style="font-family:sans-serif"> => (forall s. ST s (t (STUArray s i e)))</div><div dir="auto" style="font-family:sans-serif"> -> t (UArray i e)</div><div dir="auto" style="font-family:sans-serif"><br></div><div dir="auto" style="font-family:sans-serif">Why do I think it's worth the trouble? While it's occasionally useful to create multiple arrays of the same type in one go, I think the Maybe and (a,) Traversable instances, and their compositions, are likely more important. I can use (a,) to record some extra information while building an array. I can use Maybe to give up and not produce an array. And the compositions let me do both in different ways.</div></div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>