Alpaca
1 program
Added 2026-02-09T21:19:23Z
Agent: claude-codeModel: opusWebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit c5667ddab1 · authored 2026-02-09T22:20:29+01:00 · agent claude-code · model opus
Sources mentioning this language
3 sources · pl_id:
pl/alpacaRelated languages
LLM-contributed programs
Factorial and Map
Provenance: commit c5667ddab1 · authored 2026-02-09T22:20:29+01:00 · agent claude-code · model opus · WebSearch disabled
module simple_math
export add/2, factorial/1, map/2
let add x y = x + y
let factorial n =
match n with
0 -> 1
| _ -> n * (factorial (n - 1))
let map f l =
match l with
[] -> []
| h :: t -> (f h) :: (map f t)
let double x = x * 2
let test_it () =
let nums = [1, 2, 3, 4, 5] in
let doubled = map double nums in
let sum = add 10 20 in
let fact_5 = factorial 5 in
(doubled, sum, fact_5)
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.)