MetaML
1 program
Added 2026-02-28T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: MetaML
Provenance: commit 6d90bc2032 · authored 2026-02-28T12:13:51+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/metamlRelated languages
LLM-contributed programs
Staged Power Function
Provenance: commit 6d90bc2032 · authored 2026-02-28T12:13:51+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
(* MetaML: Staged Power Function *)
(* from Taha, W. "A Gentle Introduction to Multi-stage Programming" *)
let rec power : int -> <int -> int> =
fun n ->
if n = 0 then
<fun _ -> 1>
else
<fun x -> x * ~(power (n-1)) x>
let () =
let p3 = run (power 3) in
Printf.printf "2^3 = %d\n" (p3 2);
Printf.printf "3^3 = %d\n" (p3 3);
Printf.printf "4^3 = %d\n" (p3 4)
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)