[mercury-users] higher-order programming

Simon Taylor stayl at cs.mu.OZ.AU
Mon May 23 14:52:32 AEST 2005


On 23-May-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Peter Ross, Sunday, 22 May 2005:
> > 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.
> 
> I agree: this is a real wart and needs fixing.

As does "Sorry, can't take address of procedure with multiple modes".

Simon.
--------------------------------------------------------------------------
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