ychr-0.1.0.0: test/golden/is_deref_compound/is_deref_compound.chr
:- module(idc, [arith/1, ufun/1, bare_quoted/1]).
:- use_module(prelude).
:- chr_constraint arith/1, ufun/1, bare_quoted/1.
:- function tenfold/1.
tenfold(N) -> N * 10.
% RHS is a bare variable bound to an arithmetic compound; the
% deep-evaluator must walk it.
arith(R) <=> X = 1 + 1, R is X.
% Same idea with a user-defined function as the bound functor.
ufun(R) <=> Y = tenfold(3), R is Y.
% Bare-functor unification: VTerm carries the unqualified `+` atom.
% The deep-evaluator's prelude host-call fallback (parallel to Haskell's
% `hostCalls` lookup in `invokeByKey`) handles this case identically
% on both backends.
bare_quoted(R) <=> X = '+'(1, 1), R is X.