[mercury-users] no clauses for predicate, mistaken higher-order predicate call

Tyson Dowd trd at cs.mu.OZ.AU
Fri Apr 27 20:47:03 AEST 2001


On 27-Apr-2001, Terrence Brannon <princepawn at earthlink.net> wrote:
> Please help me obliterate this final error.
> 
> [localhost:mercury/primality/divisors] metaperl% mmc -E --infer-all divisors.m
> divisors.m:005: Error: no clauses for predicate `divisors:main/2'.
> divisors.m:010: Inferred :- pred --->(pred((io:state), (io:state)), (pred)).
> [localhost:mercury/primality/divisors] metaperl% 
> 
> ==== program follows
> 
> :- module divisors.
> :- interface.
> :- import_module io.
> 
> :- pred main(io__state::di, io__state::uo) is det.
> 
> :- implementation.
> :- import_module std_util, int, list.
> 
> main ---> prime(12).

Try:

main --> prime(12).

(the arrow is shorter)


---> is really only used for defining types 
	:- type foo ---> ..... 

The compiler tried to infer a type for a predicate called ---> which
took a pred (main) and a second pred (prime(12)).

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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