Skip to content

Missing brackets when replacing flip(:) #125

@feature-not-a-bug

Description

@feature-not-a-bug

I discovered this while getting haskell-language-server set up. haskell/haskell-language-server#3020

Original file

$ cat foo.hlint.hs
foo :: [a] -> [a]
foo = foldl (\xs x -> x : xs) []

Refactored version:

$ hlint --refactor foo.hlint.hs
foo :: [a] -> [a]
foo = foldl (flip :) []

The expected code would be:

foo :: [a] -> [a]
foo = foldl (flip (:)) []

Using apply-refact-0.10.0.0 and The Glorious Glasgow Haskell Compilation System, version 9.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions