[mercury-users] higher-order programming

Peter Ross pro at missioncriticalit.com
Sun May 22 21:44:21 AEST 2005


Hi,

Can someone please remind me why it's not possible to write the
following program, instead one must use the commented out line.

:- pred p(int::out) is det.

p(X) :-
        F = f(1),
        G = F(2),
    	% G = (func(X1) = F(2, X1)),
        X = G(3).

:- func f(int, int, int) = int.

The reason why I ask is that writing higher order combinator programs is
very clunky in Mercury, and seeing that there is a lot of work on the
type-checker, maybe it would be possible to adapt it to allow the above
program.

Cheers,
Pete
-- 
Software Engineer                                (Work)   +32 2 757 10 15
Mission Critical                                 (Mobile) +32 485 482 559
--------------------------------------------------------------------------
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