[mercury-users] Mode polymorphism

Mark Brown mark at cs.mu.OZ.AU
Fri Jul 29 13:59:58 AEST 2005


On 29-Jul-2005, Peter Hawkins <peter at hawkins.emu.id.au> wrote:
> main(!IO) :-
>    A = get_list,
>    B = [0,1],
>    Z = map_poly(get_elem(A), B),
>    print_non_empty_list(Z, !IO),
>    true.

The compiler is not able to infer a polymorphic inst for the first argument
in the call to map_poly.  You'll need to use an explicit lambda expression
which gives the mode that you want.

Cheers,
Mark.

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list