In A.2.2 of the HoTT book, the structural rules for contexts are presented. I am not sure these inference rules are written well however.
Take the rule Subst₁
Γ
a : A Γ, x : A, Δ 
b : B
{\displaystyle \vdash }―――――――――――――― Subst₁
Γ, Δ[a / x] 
b[a / x] ; B[a / x]
Given that contexts are a list, I don't see how we can "pattern match" against non-constructors such as context concatenation Γ, Δ. I don't know any functional languages which allow you to pattern match in the middle of a list.
Now there are two solutions to this problem:
1. Rewrite all rules with this kind of term to avoid them magically. (I have not been able to work this out).
2. Contexts are not really lists
I am inclined to believe 2. is more correct however this doesn't actually help define what they are.
Could somebody clear this up for me?