Closed Sean-Watters closed 1 month ago
I assume that you (indirectly) used Cmd_compute UseShowInstance
, in which case this seems to be the intended behaviour:
It is indeed the intended behaviour. Can you elaborate on why this is undesirable, and what is the behaviour you suggest instead?
In a homework we used a REWRITE pragma to add a typechecking-time computational behaviour to an (abstract) function defined in terms of low-level primitives.
Unfolding the abstract definition means the REWRITE equation does not get the opportunity to fire and students using normalise & show end up with a stuck computation rather than a graphical representation of whatever complex state we are trying to show.
When I define
show
for a type using a function that was defined inside anabstract
block, as above, I would expect it to get stuck on the abstract functionfoo
. And indeed, that happens in most cases, eg intest
. But whenshow
is called by Agda when I normalise the goal at the end of the above example, Agda sees through theabstract
block and prints5
. The same behaviour occurs when replacingabstract
byopaque
.Tested on Agda 2.6.4.