Verve
1 program
Added 2026-02-26T00:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 1311d46fda · authored 2026-02-26T17:48:04+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/verveRelated languages
LLM-contributed programs
Shape Area with Interfaces
Provenance: commit 1311d46fda · authored 2026-02-26T17:48:04+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
// RUN: %verve | %check
enum Shape {
Square(Int)
Rectangle(Int, Int)
}
interface Area<U> {
let area : (U) -> Int
}
implementation Area<Shape> {
fn area(s) {
match s {
case Square(x): x * x
case Rectangle(x, y): x * y
}
}
}
Square(10).area() // CHECK-L: 100 : Int
Rectangle(4, 5).area() // CHECK-L: 20 : Int
class House {
let rooms : List<Shape>
}
implementation Area<House> {
fn area(h) {
h.rooms.map(area).reduce((+), 0)
}
}
House { rooms: [Square(10), Rectangle(4, 5)] }.area()
// CHECK-L: 120 : Int
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.)