Guarded Horn Clauses
1 program
Added 2026-02-27T00:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: GHC, Flat GHC
Provenance: commit eaf7b168fe · authored 2026-02-27T19:56:05+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/ghcRelated languages
LLM-contributed programs
Quicksort
Provenance: commit eaf7b168fe · authored 2026-02-27T19:56:05+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
:- module quicksort.
sort(X, Y) :- sort(X, Y, []).
sort([], Y, Z) :- Y = Z.
sort([P|X], Y, Z) :-
partition(P, X, X1, X2),
sort(X1, Y, [P|Y1]),
sort(X2, Y1, Z).
partition(_, [], S, L) :-
S = [],
L = [].
partition(P, [W|X], S, L) :- W =< P |
S = [W|S1],
partition(P, X, S1, L).
:- module main.
main :-
X = [9,2,8,3,6,7,4,1,5],
builtin:print(X),
quicksort:sort(X, Y),
builtin:print(Y).
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.)