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

2009-10-22 Thread Bulat Ziganshin
Hello zaxis, Thursday, October 22, 2009, 1:03:21 PM, you wrote: > Is [(1,1),(2,2),(3,3)] been regarded as a hash ? If not, what is the best > way to change it to [(1,1),(2,),(3,3)] in function `f` ? f = map (\x@(a,b) -> if a==2 then (a,) else x) or f xs = [(a, if a==2 then else b)

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

2009-10-22 Thread Bulat Ziganshin
Hello zaxis, Thursday, October 22, 2009, 1:03:21 PM, you wrote: >>>value <- readIORef aaa >>>writeIORef aaa (f value) > then aaa will *point to* a new value. The original value will be Garbage > Collected, right ? yes, exactly > BTW, > Is [(1,1),(2,2),(3,3)] been regarded as a hash ? If not,