Notes On Indentations
Like all ML Language Family, Hamler is indentation sensitive. Any declaration in the same block should have the same level of indentation. In the case of a declaration spans more than one line, the other lines have to be intended past the first line.
flip x f = f
x -- NOT OKAY, Hamler will see x as a seperate declaration
flip f x = f
x -- OKAY, but not recommended
Let
and Where
Bindings
Keywords such as Let and Where introduces a new block, where further indentation is needed.
distance x y = sqrt z
where
z = x' + y'
x' = x * x
y' = y * y
当前内容版权归 hamler-lang 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 hamler-lang .