[Haskell-cafe] How can i safely change the value of specified key ?

minh thu noteed at gmail.com
Thu Oct 22 03:37:00 EDT 2009


2009/10/22 zaxis <z_axis at 163.com>:
>
> aaa <- newIORef ([]::[(Int,Int)])
> writeIORef aaa [(1,1),(2,2),(3,3)]
>
> then if i want to change aaa to [(1,1),(2,222),(3,3)] , what's the best way
> ?
> re-write aaa is not permitted.

Why do you say that ? You can use again writeIORef of modifyIORef to
change aaa's content.

Cheers,
Thu


More information about the Haskell-Cafe mailing list