[mercury-users] false function

Michael Day mikeday at yeslogic.com
Wed Jul 30 10:56:58 AEST 2003


> > :- func false = _ is failure.
> 
> I don't like this idea: false is a proposition, not a function.

A better name, then? A value that cannot be computed? nonexistent?  
nothing? priceless? worthless?

To clarify, it is convenient for this kind of function:

foo(X) =
   ( if bar(X) then
      value1
   else if baz(X) then
      value2
   else
      nothing
   ).

which cannot be written as a semidet switch, as either bar or baz could 
potentially succeed (although in reality usually only one could, but there 
is no way to tell the compiler this yet at present?).

Michael

-- 
YesLogic Prince prints XML!
http://yeslogic.com

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