Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Inverted-syntax/Mercury/inverted-syntax-1.mercury
Normal file
8
Task/Inverted-syntax/Mercury/inverted-syntax-1.mercury
Normal 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.
|
||||
8
Task/Inverted-syntax/Mercury/inverted-syntax-2.mercury
Normal file
8
Task/Inverted-syntax/Mercury/inverted-syntax-2.mercury
Normal 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.
|
||||
7
Task/Inverted-syntax/Mercury/inverted-syntax-3.mercury
Normal file
7
Task/Inverted-syntax/Mercury/inverted-syntax-3.mercury
Normal 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).
|
||||
13
Task/Inverted-syntax/Mercury/inverted-syntax-4.mercury
Normal file
13
Task/Inverted-syntax/Mercury/inverted-syntax-4.mercury
Normal 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).
|
||||
Loading…
Add table
Add a link
Reference in a new issue