[Haskell-cafe] Other transactional arrays?

Emil Melnicov emilmeln at gmail.com
Fri Jul 9 09:31:47 EDT 2010


On 9 July 2010, at 08:13
Felipe Lessa <felipe.lessa at gmail.com> wrote:

> I guess the only problem lies with writeTVector.  I don't know much
> about STM implementation details as well, but reading the code for
> writeTVector I can't see how it could be rollbacked.  I.e., should
> something with writeTVector fail and rollback, how will the old value
> get into the mutable array?
> 
> Cheers :)
> 
> -- 
> Felipe.

Yes, you are right.  We can't omit "writeArray#" here, and this one
simply writes something to the array without any respect to transaction
log.  It seems that you can't fool Haskell's type system :)

Actually, I can use "TVar (IntMap a)" to solve my problem.
Nonetheless, I wonder if it is possible to access STM internals
within Haskell (e.g. through some primitives like writeLog# or
checkConsistency#), although it's hardly justified.

--
Emil.


More information about the Haskell-Cafe mailing list