
22 Oct
2009
22 Oct
'09
5:34 a.m.
2009/10/22 zaxis
f xs = (2,2222) : filter ((/=2) . fst) xs It works but not general as `f` still needs to change other value according to the "KEY". Maybe Data.List will supply what i need.
I don't think Data.List has what you want as-is. The above code is generalized simply: replace k v xs = (k,v) : filter ((/=v) . fst) xs Cheers, Thu