On Mon, 22 Jun 2009, Malcolm Wallace wrote:

Example:

 f a b = g (a+b) (b-a)
       where g a c = a*c

ghc warns that g's parameter a shadows the parameter to f.  So we
introduce a primed identifier to eliminate the warning:

 f a b = g (a+b) (b-a)
       where g a' c = a*c

Now, no warnings!  But, oops, this function does not do the same thing.
We forgot to add a prime to all occurrences of a on the right-hand-side.

Actually there will be the warning, that a' is unused.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to