
Sounds reasonable to me.
Is this kinda like the api in the whitherable package ?
On Sun, Mar 11, 2018 at 1:30 AM David Feuer
The vector package offers
createT :: Traversable t => (forall s. ST s (t (MVector s a))) -> t (Vector a)
This is a generalization of create, which is very similar to runSTArray in the array package. I suggest we add functions
runSTArrays :: Traversable t => (forall s. ST s (t (STArray s i e))) -> t (Array i e)
runSTUArrays :: Traversable t => (forall s. ST s (t (STUArray s i e))) -> t (UArray i e)
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. _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries