Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSimpleLetBody should report destructuring for named patterns in other modules #6

Open
jfmengels opened this issue Sep 13, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jfmengels
Copy link
Owner

At the moment, the rule doesn't report the destructuring of single variant constructors when we don't know whether the type has any phantom types (as that could be the purpose of the destructuring).

This correctly doesn't get reported.

type A b = A String
a = let (A b) = xyz
    in A b

but we only gather information about constructors from the current module. If a single-variant custom type from another module or from a dependency is used in such a way when it doesn't have a phantom type variable, then we should report it.

module SomeModule exposing (A(..))
type A b = A String

-- other module
import SomeModule exposing (A(..))
-- should be simplified
a = let (A b) = xyz
    in A b
@jfmengels jfmengels added enhancement New feature or request help wanted Extra attention is needed labels Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant