computing the normal form of a simply-typed lambda term in standard (not de Bruijn) notation. can make use for your task of the code given for checking that a term is typable.
The data type defining a lambda term in standard form is:
data STerm = Vs Int | Ls Int STerm | As STerm STerm deriving (Eq,Show,Read)
if you might want to look at/or change the program , at LamEval.hs.,that computes the normal form of an arbitrary lambda term in de Bruijn form.
can also simplify the program knowing that the evaluation order can be one of the choice for simply-typed terms and that for them the normalization process always terminates.