The following construction is based upon a note scribbled by
Conor McFermat^W McBride on a draft of my PhD thesis a few
months ago. Upon seeing an earlier version of this file,
Stevan Andjelkovic (aka Mr Freemonadic) urged me to borrow
one of his free monads to write my recursive functions.

The tl;dr: we intensionally characterise a class of Bove-Capretta
predicates (using a custom-made universe of datatypes) with the
guarantee that these predicates are "collapsible", ie. have no
run-time cost. We then write a generic program that computes such
a predicate from the recursive definition of a function. Using this
framework, we can write a recursive function without being bothered by
that administrative termination-checker and prove its termination
after the fact.