Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | Allow MatchExpr and MatchStmt to have nested patterns. Such as | qunyanm | 2015-05-14 |
function last<T>(xs: List<T>): T requires xs != Nil { match xs case Cons(y, Nil) => y case Cons(y, Cons(z, zs)) => last(Cons(z, zs)) } And function minus(x: Nat, y: Nat): Nat { match (x, y) case (Zero, _) => Zero case (Suc(_), Zero) => x case (Suc(a), Suc(b)) => minus(a, b) } |