The rule you are violating is described in Note 1 in Section 10.3 . Let me quote:
1. , (n > m). , L , . : [, . ] p , , h.
:
f x = let
h y = let
p z = z
in p
in h
if -statement - f'. ( , , p - h.) if -statement , , (.. if , f'). .
p f', .
Edit:
, , p , f', , , (.. ). , do . :
f =
f'
where f' = -- no do
if True then
return ()
else
return ()
where/let do, -, . :
1) :
f = let y = do
Just 1
in y
2) :
f = let y =
Just 1
in y
3) :
f = do
Just 1
4) :
f = do
Just 1
, (4) (1), (1) ( ).
2:
, , ! ( , . . .)
: , do -notation . NondecreasingIndentation, . . .
, , if-then-else -part:
{-
f =
f'
where f' = do
if True then
return ()
else
return ()
NondecreasingIndentation , . (4), , .
TL; DR
. do - , . GHC do - - , NoNondecreasingIndentation.