Add a createT analogue for arrays
Carter Schonwald
carter.schonwald at gmail.com
Thu Mar 15 14:49:23 UTC 2018
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 <david.feuer at gmail.com> wrote:
> 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 at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180315/e0cb30e5/attachment.html>
More information about the Libraries
mailing list