mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 12:23:44 +00:00
25 lines
504 B
Mathematica
25 lines
504 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module ho_default_func_2.sub.
|
|
:- interface.
|
|
|
|
:- type t.
|
|
|
|
:- pred baz(id(t)::out) is det.
|
|
:- pred eq(t::in, t::out) is det.
|
|
:- pred do_io(t::in, io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- type t == (func(int) = int).
|
|
|
|
baz(mkid(bar)).
|
|
|
|
eq(X, X).
|
|
|
|
do_io(F, !IO) :-
|
|
io.write_int(F(42), !IO),
|
|
io.nl(!IO).
|