You can avoid eta-contraction by installing an appropriate print_translation
. There are several examples for binders and tuples in the HOL sources, e.g., for THE
in HOL.thy
. They are easy to adapt to filter
, for example:
print_translation {*
[(@{const_syntax filter}, fn _ => fn [Abs abs, xs] =>
let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
in Syntax.const @{syntax_const "_filter"} $ x $ t $ xs end)]
*} -- {* To avoid eta-contraction of body *}