mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 13:23:47 +00:00
37 lines
968 B
Mathematica
37 lines
968 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module direct_arg_parent.direct_arg_sub.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- type foo
|
|
---> foo(int, int).
|
|
|
|
:- pred write_maybe_foo(maybe_foo::in, io::di, io::uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- pragma no_inline(write_maybe_foo/3).
|
|
|
|
write_maybe_foo(M, !IO) :-
|
|
(
|
|
M = no,
|
|
io.write_string("no\n", !IO)
|
|
;
|
|
M = not_possible(Foo),
|
|
io.write_string("not_possible(", !IO),
|
|
io.write(Foo, !IO),
|
|
io.write_string(")\n", !IO)
|
|
;
|
|
M = forced(Foo),
|
|
io.write_string("forced(", !IO),
|
|
io.write(Foo, !IO),
|
|
io.write_string(")\n", !IO)
|
|
).
|