DML
1 program
Added 2026-02-13T00:00:00Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: Dependent ML
Provenance: commit 95831249d1 · authored 2026-02-13T11:14:07+01:00 · agent claude-code · model sonnet
Sources mentioning this language
5 sources · pl_id:
pl/dmlRelated languages
LLM-contributed programs
Factorial with Dependent Types
Provenance: commit 95831249d1 · authored 2026-02-13T11:14:07+01:00 · agent claude-code · model sonnet · WebSearch disabled
(* Factorial function with dependent types in DML *)
(* This demonstrates static verification of array bounds *)
datasort nat = ZERO | SUCC of nat
(* Dependent type for natural numbers *)
dataprop NAT (int) =
| NATzero (0)
| {n:nat} NATsucc (n+1) of NAT(n)
(* Factorial function with dependent types *)
fun {n:nat} factorial (x: int n): int =
if x = 0 then 1
else x * factorial (x - 1)
(* Safe array access with dependent types *)
datasort 'a array
extern fun {a:type} {n:nat}
array_make (n: int n, init: a): 'a array n
extern fun {a:type} {n:nat} {i:nat | i < n}
array_get (arr: 'a array n, i: int i): a
(* Example usage *)
val result = factorial 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.)