ATS2 now supports ifcase-expressions, which are similar to
the if-expressions in Erlang. Here is an example:
//
fun
acker
{m,n:nat}
.<m,n>.
(
m: int(m)
, n: int(n)
) : intGte(0) =
(
ifcase
| m = 0 => n + 1
| n = 0 => acker(m-1, 1)
| _(*else*) => acker(m-1, acker(m, n-1))
// end of [ifcase]
)
//
Note that the ifcase-expression in the above code is equivalent
to the following one:
if m=0 then n+1 else if n=0 then acker(m-1, 1) else acker(m-1, acker(m, n-1))