The Layout Rule
sumSquares x y = a + b
where
a = x ^ 2 -- (^) is the power function
b = y ^ 2
ghci> sumSquares 2 5
29sumSquares x y = a + b
where
{
a = x ^ 2; -- we need to separate expressions with ';' in this case
b = y ^ 2
}
ghci> sumSquares 2 5
29Last updated