mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-27 23:34:52 +00:00
30 lines
532 B
Groff
30 lines
532 B
Groff
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module change_class_r_2.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- type foo
|
|
---> a
|
|
; b(int).
|
|
|
|
:- pred init_foo(foo::out) is det.
|
|
|
|
:- typeclass io(T) where [
|
|
pred output(T::in, io::di, io::uo) is det
|
|
].
|
|
|
|
:- instance io(foo).
|
|
|
|
:- implementation.
|
|
|
|
:- instance io(foo) where [
|
|
pred(output/3) is io.write
|
|
].
|
|
|
|
init_foo(a).
|