[m-dev.] impurity of catch

Peter Wang novalazy at gmail.com
Thu Aug 21 14:03:00 AEST 2014


Hi,

What makes builtin_catch / catch_impl actually impure?

I considered to enable the impurity annotation below
as the comment about impure higher-order pred terms is out of date.

Peter

% catch_impl/3 is actually impure.  But we don't declare it as impure,
% because the code for try_all/3 takes its address (to pass to
% unsorted_solutions/2), and Mercury does not (yet?) support
% impure higher-order pred terms.
:- pragma promise_pure(catch_impl/3).
:- /* impure */ pred catch_impl(pred(T), handler(T), T).



More information about the developers mailing list