)
import Name ( Name, getOccName, getSrcLoc )
import FieldLabel ( fieldLabelName )
)
import Name ( Name, getOccName, getSrcLoc )
import FieldLabel ( fieldLabelName )
-import TcEnv ( tcLookupClass, tcLookupGlobalId, newLocalId, badCon )
+import TcEnv ( tcLookupClass, tcLookupDataCon, tcLookupGlobalId, newLocalId )
import TcType ( TcType, TcTyVar, tcInstTyVars, newTyVarTy )
import TcMonoType ( tcHsSigType )
import TcUnify ( unifyTauTy, unifyListTy, unifyTupleTy )
import TcType ( TcType, TcTyVar, tcInstTyVars, newTyVarTy )
import TcMonoType ( tcHsSigType )
import TcUnify ( unifyTauTy, unifyListTy, unifyTupleTy )
doublePrimTy, addrPrimTy
)
import TysWiredIn ( charTy, stringTy, intTy, integerTy )
doublePrimTy, addrPrimTy
)
import TysWiredIn ( charTy, stringTy, intTy, integerTy )
-import PrelNames ( eqClassOpKey, geClassOpKey,
- cCallableClassKey, eqStringIdKey,
- )
+import PrelNames ( eqStringName, eqName, geName, cCallableClassName )
returnTc (NPat lit stringTy (HsVar eq_id `HsApp` HsLit lit),
emptyLIE, emptyBag, emptyBag, emptyLIE)
returnTc (NPat lit stringTy (HsVar eq_id `HsApp` HsLit lit),
emptyLIE, emptyBag, emptyBag, emptyLIE)
tcPat tc_bndr pat@(NPatIn over_lit) pat_ty
= newOverloadedLit (PatOrigin pat) over_lit pat_ty `thenNF_Tc` \ (over_lit_expr, lie1) ->
tcPat tc_bndr pat@(NPatIn over_lit) pat_ty
= newOverloadedLit (PatOrigin pat) over_lit pat_ty `thenNF_Tc` \ (over_lit_expr, lie1) ->
newMethod origin eq_sel_id [pat_ty] `thenNF_Tc` \ (lie2, eq_id) ->
returnTc (NPat lit' pat_ty (HsApp (HsVar eq_id) over_lit_expr),
newMethod origin eq_sel_id [pat_ty] `thenNF_Tc` \ (lie2, eq_id) ->
returnTc (NPat lit' pat_ty (HsApp (HsVar eq_id) over_lit_expr),
\begin{code}
tcPat tc_bndr pat@(NPlusKPatIn name lit@(HsIntegral i _) minus) pat_ty
= tc_bndr name pat_ty `thenTc` \ bndr_id ->
\begin{code}
tcPat tc_bndr pat@(NPlusKPatIn name lit@(HsIntegral i _) minus) pat_ty
= tc_bndr name pat_ty `thenTc` \ bndr_id ->
- tcLookupGlobalId minus `thenNF_Tc` \ minus_sel_id ->
- tcLookupGlobalId geClassOpName `thenNF_Tc` \ ge_sel_id ->
+ tcLookupGlobalId minus `thenNF_Tc` \ minus_sel_id ->
+ tcLookupGlobalId geName `thenNF_Tc` \ ge_sel_id ->
newOverloadedLit origin lit pat_ty `thenNF_Tc` \ (over_lit_expr, lie1) ->
newMethod origin ge_sel_id [pat_ty] `thenNF_Tc` \ (lie2, ge_id) ->
newMethod origin minus_sel_id [pat_ty] `thenNF_Tc` \ (lie3, minus_id) ->
newOverloadedLit origin lit pat_ty `thenNF_Tc` \ (over_lit_expr, lie1) ->
newMethod origin ge_sel_id [pat_ty] `thenNF_Tc` \ (lie2, ge_id) ->
newMethod origin minus_sel_id [pat_ty] `thenNF_Tc` \ (lie3, minus_id) ->
unifyTauTy pat_ty result_ty `thenTc_`
returnTc (data_con, ex_tvs', dicts, lie_avail, arg_tys')
unifyTauTy pat_ty result_ty `thenTc_`
returnTc (data_con, ex_tvs', dicts, lie_avail, arg_tys')