Type-checked functions
Type-checked functions
Demonstrates MeTTa's dependent type system with a recursive factorial function.
; Define typed functions
(: factorial (-> Number Number))
(= (factorial 0) 1)
(= (factorial $n)
(* $n (factorial (- $n 1))))
!(factorial 5) ; => 120