
22 Oct
2009
22 Oct
'09
5:28 a.m.
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,2222),(3,3)] in function `f` ?
f = map (\x@(a,b) -> if a==2 then (a,2222) else x) or f xs = [(a, if a==2 then 2222 else b) | (a,b) <- xs] but anyway, modifying one value inside complex datastructure is not FP way. you should consider writing a function that maps your entire input data to output one -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com