Skip to content

Be more careful about suggestions in the presence of unknown operators #993

@Kyuuhachi

Description

@Kyuuhachi

I have a custom operator

infixl 4 <*! -- same as <$> and <*>
(<*!) :: Applicative f => f (a -> b) -> a -> f b
a <*! b = a <*> pure b

When used like f =<< g <$> x <*! y, hlint suggests changing it to f . g =<< (x <*! y), which is not correct. Replacing it with f =<< g <$> x <*> pure y gives no such suggestion (but is more verbose!), which implies that it's related to some operators being known and not. There might be other rules that have similar problems.

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