Skip to content

Should single-line if expressions be allowed? #209

@gyzerok

Description

@gyzerok

Following code

isPalindrome : List comparable -> Bool
isPalindrome list =
    List.map2 (,) list (List.reverse list)
        |> List.foldl
            (\( x, y ) acc -> if x == y then acc else False)
            True

turns to this

isPalindrome : List comparable -> Bool
isPalindrome list =
    List.map2 (,) list (List.reverse list)
        |> List.foldl
            (\( x, y ) acc ->
                if x == y then
                    acc
                else
                    False
            )
            True

What do you think about it guys?

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.9(temporary label for search filtering)discussion

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions