mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
68a79bc8a8
* Closes #3008 * Implements the algorithm from [Luc Maranget, Warnings for Pattern Matching](https://www.cambridge.org/core/services/aop-cambridge-core/content/view/3165B75113781E2431E3856972940347/S0956796807006223a.pdf/warnings-for-pattern-matching.pdf) to detect redundant patterns. * Adds an option to the Core pretty printer to print match patterns in a user-friendly format consistent with pattern syntax in Juvix frontend language.
11 lines
161 B
Plaintext
11 lines
161 B
Plaintext
module test007;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
f (x : List Nat) : Nat :=
|
|
case x of
|
|
| nil := 0
|
|
| x :: _ if x > 0 := x;
|
|
|
|
main : Nat := f (1 :: 2 :: nil);
|