Section hlist.
Context {iT : Type}.
Variable F : iT -> Type.
Inductive hlist : list iT -> Type :=
| Hnil  : hlist nil
| Hcons : forall l ls, F l -> hlist ls -> hlist (l :: ls).
Definition hlist_hd {a b} (hl : hlist (a :: b)) : F a :=
match hl in hlist x return match x with
| nil => unit
| l :: _ => F l
end with
| Hnil => tt
| Hcons _ _ x _ => x
end.
Definition hlist_tl {a b} (hl : hlist (a :: b)) : hlist b :=
match hl in hlist x return match x with
| nil => unit
| _ :: ls => hlist ls
end with
| Hnil => tt
| Hcons _ _ _ x => x
end.

Lemma hlist_eta : forall ls (h : hlist ls),
h = match ls as ls return hlist ls -> hlist ls with
| nil => fun _ => Hnil
| a :: b => fun h => Hcons (hlist_hd h) (hlist_tl h)
end h.