Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,8 @@
:- pred progress(int::in, int::in, int::out, int::out) is det.
progress(Past, Future, At, Total) :-
At = Past + 1,
Total = Past + Future.
progress(Past, Future, At, Total) :-
Past + Future = Total,
Past + 1 = At.

View file

@ -0,0 +1,8 @@
:- func example(int) = string.
example(N) = S :-
from_int(N) = S0,
pad_left(S0, '0', 3, S).
example(N) = S :-
pad_left(S0, '0', 3, S),
from_int(N) = S0.

View file

@ -0,0 +1,7 @@
main(IO0, IO) :-
io.write_string("Hello, ", IO0, IO1),
io.write_string("world!\n", IO1, IO).
main(!IO) :-
io.write_string("Hello, ", !IO),
io.write_string("world!\n", !IO).

View file

@ -0,0 +1,13 @@
main(!IO) :-
io.write_string(X, !IO), io.nl(!IO),
some_long_uninteresting_thing(X).
% this is the same:
main(!IO) :-
some_long_uninteresting_thing(X),
io.write_string(X, !IO), io.nl(!IO).
% but this is different!
main(!IO) :-
io.nl(!IO), io.write_string(X, !IO),
some_long_uninteresting_thing(X).