[{"name":"EqualsCaseable","comment":" Rule, reporting `==` when equivalent `case of` exists\n\n@docs forbid, ForbiddenLocation\n\n","unions":[{"name":"ForbiddenLocation","comment":" Configuration option for [`EqualsCaseable.forbid`](#forbid).\nCan be either\n\n\n### \"forbid only when used in the test of an `if`\" → `InIf`\n\nreported\n\n    a =\n        if list == [] then\n            \"empty\"\n\n        else\n            \"filled\"\n\nnot reported\n\n    a =\n        case list of\n            [] ->\n                \"empty\"\n\n            _ :: _ ->\n                \"filled\"\n\n\n### \"forbid always\" → `Everywhere`\n\nreported\n\n    a =\n        if list == [] then\n            \"empty\"\n\n        else\n            \"filled\"\n\n    b =\n        users |> List.filter (\\u -> u.role == Moderator)\n\nnot reported\n\n    a =\n        users\n            |> List.filter\n                (\\u ->\n                    case u.role of\n                        Moderator ->\n                            True\n\n                        _ ->\n                            False\n                )\n\n\n### What should I choose?\n\nIf `(\\a -> a.something == Variant)` etc is a very common pattern\nin your code base, you'll have an easier time\nconverting all the `if`s first.\n\nTo get the discussed benefits like \"Now the compiler will tell me all the places I need to make a new decision\",\nyou do need to refactor all these equality checks.\n\nYour goal should be `EqualsCaseable.forbid Everywhere`\n\n","args":[],"cases":[["InIf",[]],["Everywhere",[]]]}],"aliases":[],"values":[{"name":"forbid","comment":" Reports when `==` is used but there's there is an equivalent `case of` available.\n\n    config =\n        [ EqualsCaseable.forbid EqualsCaseable.InIf\n        ]\n\nWhere the given [`ForbiddenLocation`](#ForbiddenLocation)\ncan be either\n\n  - \"only when used in the test of an `if`\" → `InIf`\n  - \"always\" → `Everywhere`\n\n\n## reported\n\n    a =\n        if list == [] then\n            \"empty\"\n\n        else\n            \"filled\"\n\n\n## not reported\n\n    a =\n        case list of\n            [] ->\n                \"empty\"\n\n            _ :: _ ->\n                \"filled\"\n\n","type":"EqualsCaseable.ForbiddenLocation -> Review.Rule.Rule"}],"binops":[]}]