Files
mercury/tests/declarative_debugger/app.m
Zoltan Somogyi ecb5e4a9e6 Update the style of many test cases.
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.
2021-07-25 23:26:17 +10:00

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).