I’m supposed to take this code:
f x y z = x^3 - g (x + g (y - g z) + g (z^2))
where g x = 2*x^2 + 10*x + 1
And rewrite it without where (or let).
They mean to write it with a Lambda function (\x ->…)
I’m trying to reuse a Lambda function on Haskell. Any ideas?
As bravit hints at, you can rewrite a non-recursive
letusing a lambda in the following way:where
xis a variable andAandBare expressions.