Reports when a Unit (()) is not matched in a pattern.
config =
[ NoUmatchedUnit.rule
]
Fail
foo : () -> Int
foo _ =
3
Success
foo : () -> Int
foo () =
3
When (not) to enable this rule
Nobody on your team thinks explicitly matching against the Unit makes the code
more readable (as far as showing that there wasn't a "real" value being ignored).
When you feel that Unit is often used as a placeholder for a value that will
soon be filled in later.
Try it out
You can try this rule out by running the following command:
Reports when a Unit (
()) is not matched in a pattern.Fail
Success
When (not) to enable this rule
Try it out
You can try this rule out by running the following command: