From e4fce3ffd02b69e36b42ffe3c868570c45aef986 Mon Sep 17 00:00:00 2001 From: Thomas Bauereiss Date: Thu, 10 Aug 2017 17:42:27 +0100 Subject: Add support for early return to Lem backend Implemented using the exception monad, by throwing and catching the return value --- src/rewriter.mli | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/rewriter.mli') diff --git a/src/rewriter.mli b/src/rewriter.mli index 9c91b55b..9dbdee3d 100644 --- a/src/rewriter.mli +++ b/src/rewriter.mli @@ -154,3 +154,10 @@ val fold_exp : ('a,'exp,'exp_aux,'lexp,'lexp_aux,'fexp,'fexp_aux,'fexps,'fexps_a 'pat,'pat_aux,'fpat,'fpat_aux) exp_alg -> 'a exp -> 'exp val id_pat_alg : ('a,'a pat, 'a pat_aux, 'a fpat, 'a fpat_aux) pat_alg + +val compute_exp_alg : 'b -> ('b -> 'b -> 'b) -> + ('a,('b * 'a exp),('b * 'a exp_aux),('b * 'a lexp),('b * 'a lexp_aux),('b * 'a fexp), + ('b * 'a fexp_aux),('b * 'a fexps),('b * 'a fexps_aux), + ('b * 'a opt_default_aux),('b * 'a opt_default),('b * 'a pexp),('b * 'a pexp_aux), + ('b * 'a letbind_aux),('b * 'a letbind), + ('b * 'a pat),('b * 'a pat_aux),('b * 'a fpat),('b * 'a fpat_aux)) exp_alg -- cgit v1.2.3