[mercury-users] higher-order programming
Ralph Becket
rafe at cs.mu.OZ.AU
Mon May 23 10:09:37 AEST 2005
Peter Ross, Sunday, 22 May 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.
I agree: this is a real wart and needs fixing.
--------------------------------------------------------------------------
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