simplify for indexHead, indexTail of Const
add a type signature