In Agda, one can conveniently represent λ-terms using PHOAS:
data Term (V : Set) : Set where
var : V → Term V
abs : (V → Term V) → Term V
app : Term V → Term V → Term V
That approach has several benefits over Bruijn indices, as explained in "Parametric Higher-Order Abstract Syntax for Mechanized
Semantics". As far as I know, though, there can't be a eval : ∀ {V} -> Term V -> Term V
function that, given a λ-term, returns its normal form - after all, Agda is total and the λ-calculus is not. But I wonder if it would be possible to write such eval
function for affine λ-terms; i.e., those where bound variables occur at most once. That language is obviously total.