[mercury-users] How do you call a semidet constant function?

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Mar 10 03:26:25 AEDT 2006


Hello,

I'm trying to implement a function like the following:

:- func default_value(((func) = T)::in((func) = out is semidet), T::in)
	= (T::out) is det.

default_value(F, X) =
        ( if F = Y then
                Y
        else
                X
        ).

How do I convince the compiler to unify Y with the result of F and not
the function F?

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