- tc_fields field_tys []
- = returnTc ([], emptyLIE, emptyBag, emptyBag, emptyLIE)
-
- tc_fields field_tys ((field_label, rhs_pat, pun_flag) : rpats)
- | null matching_fields
- = addErrTc (badFieldCon name field_label) `thenNF_Tc_`
- tc_fields field_tys rpats
-
- | otherwise
- = ASSERT( null extras )
- tc_fields field_tys rpats `thenTc` \ (rpats', lie_req1, tvs1, ids1, lie_avail1) ->
-
- tcLookupValue field_label `thenNF_Tc` \ sel_id ->
- tcPat tc_bndr rhs_pat rhs_ty `thenTc` \ (rhs_pat', lie_req2, tvs2, ids2, lie_avail2) ->
-
- returnTc ((sel_id, rhs_pat', pun_flag) : rpats',
- lie_req1 `plusLIE` lie_req2,
- tvs1 `unionBags` tvs2,
- ids1 `unionBags` ids2,
- lie_avail1 `plusLIE` lie_avail2)
- where
- matching_fields = [ty | (f,ty) <- field_tys, f == field_label]
- (rhs_ty : extras) = matching_fields
-\end{code}
-
-%************************************************************************
-%* *
-\subsection{Non-overloaded literals}
-%* *
-%************************************************************************
-
-\begin{code}
-tcPat tc_bndr (LitPatIn lit@(HsChar _)) pat_ty = tcSimpleLitPat lit charTy pat_ty
-tcPat tc_bndr (LitPatIn lit@(HsIntPrim _)) pat_ty = tcSimpleLitPat lit intPrimTy pat_ty
-tcPat tc_bndr (LitPatIn lit@(HsCharPrim _)) pat_ty = tcSimpleLitPat lit charPrimTy pat_ty
-tcPat tc_bndr (LitPatIn lit@(HsStringPrim _)) pat_ty = tcSimpleLitPat lit addrPrimTy pat_ty
-tcPat tc_bndr (LitPatIn lit@(HsFloatPrim _)) pat_ty = tcSimpleLitPat lit floatPrimTy pat_ty
-tcPat tc_bndr (LitPatIn lit@(HsDoublePrim _)) pat_ty = tcSimpleLitPat lit doublePrimTy pat_ty
-
-tcPat tc_bndr (LitPatIn lit@(HsLitLit s)) pat_ty = tcSimpleLitPat lit intTy pat_ty
- -- This one looks weird!