summaryrefslogtreecommitdiff
path: root/tests/fact.ur
blob: c7989a3b9276569c2e9868385f8dcd59560983ba (plain)
1
2
3
4
5
fun fact n = if n <= 1 then 1 else n * fact (n - 1)

fun factTr n acc = if n <= 1 then acc else factTr (n - 1) (n * acc)

fun main () : transaction page = return <xml>{[fact 10]}, {[factTr 10 1]}</xml>