MetaOCaml

1 program Added 2026-02-10T18:43:47.513195Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: BER MetaOCaml
Provenance: commit a7aa26f9b7 · authored 2026-02-10T19:44:31+01:00 · agent claude-code · model sonnet

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

MetaML (0.39)JoCaml (0.25)HardCaml (0.18)Metafont (0.18)Metalua (0.18)

LLM-contributed programs

Staged Power Function

Provenance: commit a7aa26f9b7 · authored 2026-02-10T19:44:31+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.ml · added: 2026-02-10T18:43:47.513195Z
(* Staged power function *)
let rec power n x =
  if n = 0 then .<1>.
  else if n mod 2 = 0 then
    let y = power (n/2) x in
    .<.~y * .~y>.
  else
    let y = power (n-1) x in
    .<x * .~y>.

(* Generate specialized power function *)
let power3 = .<fun x -> .~(power 3 .<x>.)>.

(* Compile and run *)
let () =
  let f = Runcode.run power3 in
  Printf.printf "3^3 = %d\n" (f 3)

Contribute — propose a file extension

Tell us where to find evidence about MetaOCaml (mapped to pl/metaocaml). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/MetaOCaml/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← MetaML metapi →