Skip to content

Indentation of guards on where functions is wrong #104

@kevinkjt2000

Description

@kevinkjt2000

What the plugin does automatically:

countGarbageChars :: String -> Integer
countGarbageChars "" = 0
countGarbageChars (x:xs)
  | x == '<' = countUntilClosed xs
  | x == '!' = countGarbageChars (drop 1 xs)
  | otherwise = countGarbageChars xs
  where countUntilClosed (x:xs)
        | x == '>' = 0
        | x == '!' = countUntilClosed (drop 1 xs)
        | otherwise = 1 + countUntilClosed xs

What ghc expects:

countGarbageChars :: String -> Integer
countGarbageChars "" = 0
countGarbageChars (x:xs)
  | x == '<' = countUntilClosed xs
  | x == '!' = countGarbageChars (drop 1 xs)
  | otherwise = countGarbageChars xs
  where countUntilClosed (x:xs)
          | x == '>' = 0
          | x == '!' = countUntilClosed (drop 1 xs)
          | otherwise = 1 + countUntilClosed xs

nvim --version

NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui

I only had w0rp/ale and this plugin loaded to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions