mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
Update programming style.
tests/declarative_debugger/*.inp:
Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
Update expected line numbers.
tests/exceptions/Mercury.options:
tests/general/Mercury.options:
Disable some warnings that are irrelevant to the test.
34 lines
809 B
Mathematica
34 lines
809 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module app.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module list.
|
|
|
|
:- type foo(T)
|
|
---> append(T, T, T).
|
|
|
|
main(!IO) :-
|
|
A = [1, 2, 3, 4, 5],
|
|
B = [6, 7, 8],
|
|
app(A, B, C),
|
|
io.write(app.append(A, B, C), !IO),
|
|
io.write_string(".\n", !IO),
|
|
D = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5],
|
|
E = [6, 7, 8],
|
|
app(D, E, F),
|
|
io.write(app.append(D, E, F), !IO),
|
|
io.write_string(".\n", !IO).
|
|
|
|
:- pred app(list(T)::in, list(T)::in, list(T)::out) is det.
|
|
|
|
app([], Bs, Bs).
|
|
app([A | As], Bs, [A | Cs]) :-
|
|
app(As, Bs, Cs).
|