From the indentation, it is obvious (both to us and Haskell) that a
and b
are local definitions in the function sumSquares
, defined using the where
keyword. Local definitions exist as intermediate helper expressions that help us with structuring our functions and make our code more readable. It is also possible to wrap the local variables a and b in curly braces to explicitly state the grouping in which case the layout does not matter (although it's best practice to use the layout rule to give our code better readability), but we need to also explicitly separate each local definition with ;
: