%-----------------------------------------------------------------------------% :- module intermod_typeclass_exist. :- interface. :- typeclass dynamic_block(T) where [ some [Q] pred generate_block(T::in, Q::out) is det ]. %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% :- implementation. :- import_module int. :- import_module list. %-----------------------------------------------------------------------------% :- type simple_dynamic_block ---> simple_dynamic_block. :- instance dynamic_block(simple_dynamic_block) where [ pred(generate_block/2) is do_generate_block ]. % works % :- some [Q] pred do_generate_block(simple_dynamic_block::in, Q::out) is det. :- pred do_generate_block(simple_dynamic_block::in, string::out) is det. do_generate_block(simple_dynamic_block, "qqq"). %-----------------------------------------------------------------------------% % vim: ft=mercury ts=8 sts=4 sw=4 et