if-style

DescriptionStyling of if-statements
Options
  • indented
  • hanging
Defaultindented
Ormoluindented
Sincev0.19.0.0

This option determines whether the keywords then and else should be indented (the default) or hanging off the current indentation. Indenting looks more consistent with case statements, while hanging looks more consistent with if-statements in other languages.

Examples

testUser =
    if condition
        then do
            first
            branch
        else
            if another condition
                then do
                    second
                    branch
                else do
                    third
                    branch
testUser =
    if condition then do
        first
        branch
    else
        if another condition then do
            second
            branch
        else do
            third
            branch

For more examples, see the test files.