Let us be lazy and use
ocaml
-
rectypes
:
let
fix
=
(
fun
f
' ->
(
fun
f
-> (
fun
x
->
f
' (
f
f
)
x
))
(
fun
f
-> (
fun
x
->
f
' (
f
f
)
x
))
);;
val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun>
let
fact
=
fix
fact
'
in
fact
5;;
- : int = 120