Excellent idea. This does indeed seem to be the cleanest way to explain the necessary type constraints. I think we (Simon M) may add it to the library.
Simon | -----Original Message----- | From: Dean Herington [mailto:[EMAIL PROTECTED]] | Sent: 13 February 2003 15:21 | To: [EMAIL PROTECTED] | Subject: MArray and newSTUArray | | The MArray class in Data.Array.MArray is a very nice abstraction. | However, when creating an array whose type partakes of MArray, say | STUArray, I find myself defining and using a type-specific creation | function, such as: | | newSTUArray :: (MArray (STUArray s) e (ST s), Ix i) | => (i, i) -> e -> ST s (STUArray s i e) | newSTUArray = newArray | | so that I don't have to give a complicated type declaration for each use | of `newArray` that creates an STUArray. | | 1. Is there a better (more concise/convenient) way to provide the | necessary type information? | 2. If not, should functions such as `newSTUArray` be provided in the | libraries? | | -- Dean | | _______________________________________________ | Haskell-Cafe mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
