View Source cure_pattern_checker (cure v0.7.0)
Summary
Functions
Check if patterns are exhaustive for a given type
Check a match expression for exhaustiveness and redundancy
Check for redundant (unreachable) patterns
Format a diagnostic message for display
Suggest missing patterns for incomplete matches
Types
Functions
-spec check_exhaustiveness([ast_pattern()], Type :: term()) -> pattern_diagnostic().
Check if patterns are exhaustive for a given type
-spec check_match(MatchExpr :: term(), Env :: map()) -> pattern_diagnostic().
Check a match expression for exhaustiveness and redundancy
-spec check_redundancy([ast_pattern()], Type :: term()) -> pattern_diagnostic() | ok.
Check for redundant (unreachable) patterns
-spec format_diagnostic(pattern_diagnostic()) -> string().
Format a diagnostic message for display
-spec suggest_missing_patterns([ast_pattern()], Type :: term()) -> [ast_pattern()] | {error, term()}.
Suggest missing patterns for incomplete matches