I'm writing some Haskell code to learn the language, and I've run into the syntax error:
Vec2.hs:33:27: parse error on input '='
The code I've written here is below. The error is pointing at the 2nd term in vec2Normalize
iLength = ...
I don't see the syntax error
-- Get the inverse length of v and multiply the components by it
-- Resulting in the normalized form of v
vec2Normalize :: Vec2 -> Vec2
vec2Normalize v@(x,y) = (x * iLength, y * iLength)
where length = vec2Length v
iLength = if length == 0 then 1 else (1 / length)