by ProfHewitt · 5y ago · 0 comments
because the definition is not strongly typed.
Instead recursion must be added as an additional primitive to
the lambda calculus.
(Haskell)
anyType :: a
anyType = anyType
or(Rust)
fn any_type<T>() -> T {
any_type()
}Extensions with a letrec-like construct are common, and are sometimes inaccurately called 'System F', but those languages do not have the properties of System F.
Could you use your Java code to define Factorial?
let fact' = ref (fun x -> x) in
let fact = fun n -> if n = 0 then 1 else n * !fact' (n-1) in
fact' := fact; fact 3