I base the issue on the following assumption:
Assumption 1: In the explicitly typed calculus, terms that are contained within other terms are also explicitly typed.
Example: ((fun: A -> B) (arg: A)): B - in this instance of applying fun to arg, not only is the whole Application annotated with types but also the terms that are "inside" are in their annotated versions.
An example contradicting Assumption 1: (fun arg): B - in this instance the "inner" terms are still untyped.
Am I right that for the explicitly-typed variant of the calculus, Assumption 1 should hold?
Conjecture 1: It is impossible to derive a meaningful instance of the Ids typeclass for a explicitly typed terms.
Context: Ids (termType: Type) is a typeclass requiring to provide a function ids : var -> termType
.
If I understand correctly, that function should be an 'identity substitution' which is equivalent to a variable constructor (ref: page 2).
Given Assumption 1, to create a proper Var, we need not only its index but its target type, which is not available in the given context.
We could realize the function with ids (x: var) := Var x TNat
which would assign by default type Nat to all variables. But this sounds like simply a wrong thing to do.
I'm however not exactly sure how the Ids instance is used, because I think it may still work for closed terms.