CurryInfo: stylechecker-2.0.0 / Check.AST.Indent.Do.checkDo'

definition:
checkDo' :: SpanInfo -> [Statement a] -> Expression a -> Int -> CSM ()
checkDo' si (st:sts) expr i = case si of 
  (SpanInfo (Span (Position lp p) eP) _) -> 
    if checkDoStatements (getCol (getSpanInfo st)) sts expr
      then
        unless ((getLi (getSpanInfo st)) == lp)
          (do let colSts = (getCol (getSpanInfo st))
              unless ((colSts == (i+2)) ||(colSts == p+2))
                (report (Message (Span (Position lp p) eP)
                            (colorizeKey "do" <+> text "body wrong indention")
                            ( text "indent by 2"
                              <+> colorizeKey "spaces"
                              <+> text "from"
                              <+> colorizeKey "do"
                              <+> text " or"
                              <+> colorizeKey "outer block"
                              )
                        )
                )
        )
      else report (Message (Span (Position lp p) eP)
                    ((colorizeKey "do") <+> text "body not aligned") (text "align body"))
  _ -> return ()
-- If no statements exist, check only indentation:
checkDo' si [] expr i = case si of
  (SpanInfo (Span (Position lp p) eP) _) ->
    unless ((getLi (getSpanInfo expr)) == lp)
      (do let colSts = (getCol (getSpanInfo expr))
          unless ((colSts == (i+2) ||(colSts == p+2)))
            (report (Message (Span (Position lp p) eP)
                        (colorizeKey "do" <+> text "body wrong indention")
                        ( text "indent by 2"
                          <+> colorizeKey "spaces"
                          <+> text "from"
                          <+> colorizeKey "do"
                          <+> text " or"
                          <+> colorizeKey "outer block"
                        )
                    )
            )
    )
  _ -> return ()
demand:
arguments 1 2
deterministic:
deterministic operation
documentation:
-- Checks if to stametments and expression are aligned, emits a warning otherwise.
--
-- If aligned, checks indentation, if first statement in same line as `do`
-- all is well, else, see if they are indented by two from `do` or outer Block.
failfree:
(_, _, _, _)
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{({SpanInfo},{:},_,_) |-> _ || ({NoSpanInfo},{:},_,_) |-> _ || ({SpanInfo},{[]},_,_) |-> _ || ({NoSpanInfo},{[]},_,_) |-> _}
name:
checkDo'
precedence:
no precedence defined
result-values:
_
signature:
Curry.SpanInfo.SpanInfo -> [Curry.Types.Statement a] -> Curry.Types.Expression a
-> Prelude.Int
-> Control.Monad.Trans.State.StateT Types.CheckState Data.Functor.Identity.Identity ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term