[Haskell-cafe] STUArray

Frederik Eaton frederik at a5.repetae.net
Sun Mar 12 02:43:47 EST 2006


On Sun, Mar 12, 2006 at 09:05:58AM +0300, Bulat Ziganshin wrote:
> Hello Frederik,
> 
> Sunday, March 12, 2006, 5:58:42 AM, you wrote:
> 
> FE> Perhaps some sort of warning in the documentation for STUArray is in
> FE> order, until Bulat's code can be incorporated?
> 
> excellent idea. you can make diff for Data.Array.ST/IO and send it to the
> libs maillist

$ diff -u libraries/base/Data/Array/IO.hs{.old,}
--- libraries/base/Data/Array/IO.hs.old 2006-03-12 07:29:28.000000000 +0000
+++ libraries/base/Data/Array/IO.hs     2006-03-12 07:24:27.000000000 +0000
@@ -11,6 +11,8 @@
 --
 -- Mutable boxed and unboxed arrays in the IO monad.
 --
+-- XXX I'm not sure what to put here.
+--
 -----------------------------------------------------------------------------
 
 module Data.Array.IO (
[1]$ diff -u libraries/base/Data/Array/ST.hs{.old,}
--- libraries/base/Data/Array/ST.hs.old 2006-03-12 07:29:58.000000000 +0000
+++ libraries/base/Data/Array/ST.hs     2006-03-12 07:39:41.000000000 +0000
@@ -10,6 +10,15 @@
 --
 -- Mutable boxed and unboxed arrays in the 'Control.Monad.ST.ST' monad.
 --
+-- Beware that it is currently not easy to use STArray
+-- polymorphically, since conditioning on "forall s . MArray (STUArray
+-- s) e (ST s)" is impossible. Hopefully this should be fixed soon
+-- (with an Unboxed class, Bulat Ziganshin is working on it).
+--
+-- See http://www.mail-archive.com/haskell%40haskell.org/msg17085.html
+--
+-- Use IOArray if you want your element types to be polymorphic.
+--
 -----------------------------------------------------------------------------
 
 module Data.Array.ST (



More information about the Libraries mailing list