On 9 July 2010, at 08:13
Felipe Lessa <[email protected]> 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.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to