2009/10/22 zaxis <[email protected]>:
>
>>>replace k v xs = (k,v) : filter ((/=v) . fst) xs
> Great ! thanks you very much
I'm not sure why you're so much happy:
Assume some function defined as follow:
foo a b c = e x y z a b c
where x = some constant
y = some other constant
z = some other constant
'e' means just that the complete body of the function foo involves x,
y, z, a, b and c. Generalizing foo to let the caller choose the values
of x, y, z is just
foo a b c x y z = e x y z a b c
-- the where is unneeded
In fact, this is what functions are made for: generalizing a given
expression so that part of the expression can be given in arguements.
E.g. turning
e a b
into
f a = e a b
Cheers,
Thu
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe