let rec is_irrefut_patt =
function
| Ast.PaId (_, (Ast.IdLid (_, _))) -> true
| Ast.PaId (_, (Ast.IdUid (_, "()"))) -> true
| Ast.PaAny _ -> true
| Ast.PaNil _ -> true
| Ast.PaAli (_, x, y) ->
(is_irrefut_patt x) && (is_irrefut_patt y)
| Ast.PaRec (_, p) -> is_irrefut_patt p
| Ast.PaEq (_, _, p) -> is_irrefut_patt p
| Ast.PaSem (_, p1, p2) ->
(is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaCom (_, p1, p2) ->
(is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaOrp (_, p1, p2) ->
(is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaApp (_, p1, p2) ->
(is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaTyc (_, p, _) -> is_irrefut_patt p
| Ast.PaTup (_, pl) -> is_irrefut_patt pl
| Ast.PaOlb (_, _, (Ast.PaNil _)) -> true
| Ast.PaOlb (_, _, p) -> is_irrefut_patt p
| Ast.PaOlbi (_, _, p, _) -> is_irrefut_patt p
| Ast.PaLab (_, _, (Ast.PaNil _)) -> true
| Ast.PaLab (_, _, p) -> is_irrefut_patt p
| Ast.PaLaz (_, p) -> is_irrefut_patt p
| Ast.PaId (_, _) -> false
| Ast.PaVrn (_, _) | Ast.PaStr (_, _) | Ast.PaRng (_, _, _) |
Ast.PaFlo (_, _) | Ast.PaNativeInt (_, _) |
Ast.PaInt64 (_, _) | Ast.PaInt32 (_, _) | Ast.PaInt (_, _)
| Ast.PaChr (_, _) | Ast.PaTyp (_, _) | Ast.PaArr (_, _) |
Ast.PaAnt (_, _) -> false