+ returnTc (texpr, lie)
+
+\end{code}
+
+Typecheck expression which in most cases will be an Id.
+
+\begin{code}
+tcExpr_id :: RenamedHsExpr
+ -> TcM s (TcExpr s,
+ LIE s,
+ TcType s)
+tcExpr_id id_expr
+ = case id_expr of
+ HsVar name -> tcId name `thenNF_Tc` \ stuff ->
+ returnTc stuff
+ other -> newTyVarTy mkTypeKind `thenNF_Tc` \ id_ty ->
+ tcExpr id_expr id_ty `thenTc` \ (id_expr', lie_id) ->
+ returnTc (id_expr', lie_id, id_ty)
+
+
+--ToDo: move to Unify?
+unifyListTy :: TcType s -- expected list type
+ -> TcM s (TcType s) -- list element type
+unifyListTy res_ty
+ -- ToDo: more direct way of testing if res_ty is a list type (cf. unifyFunTy)?
+ = newTyVarTy mkBoxedTypeKind `thenNF_Tc` \ elt_ty ->
+ unifyTauTy (mkListTy elt_ty) res_ty `thenTc_`
+
+ -- This zonking makes the returned type as informative
+ -- as possible.
+ zonkTcType elt_ty `thenNF_Tc` \ elt_ty' ->
+ returnTc elt_ty'