Roughly, I have
check : UExpr -> Maybe Expr
And I have a test term
testTerm : UExpr
Which I hope will check successfully, after which I want to extract the resulting Expr and manipulate it further. Basically
realTerm : Expr
just realTerm = check testTerm
Such that this definition would fail to typecheck if check testTerm turned out to be nothing. Is this possible?