From a4f57759924bb6c8a505caaafdb1fd44bf61ce80 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 17 Jul 2000 11:28:32 +0000 Subject: [PATCH] [project @ 2000-07-17 11:28:32 by simonpj] Eliminate need for built-in Rational type --- ghc/compiler/typecheck/Inst.lhs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs index d4d8b48..2311800 100644 --- a/ghc/compiler/typecheck/Inst.lhs +++ b/ghc/compiler/typecheck/Inst.lhs @@ -60,7 +60,7 @@ import Name ( OccName, Name, mkDictOcc, mkMethodOcc, mkIPOcc, import PprType ( pprPred ) import Type ( Type, PredType(..), ThetaType, mkTyVarTy, isTyVarTy, mkDictTy, mkPredTy, - splitForAllTys, splitSigmaTy, + splitForAllTys, splitSigmaTy, funArgTy, splitRhoTy, tyVarsOfType, tyVarsOfTypes, tyVarsOfPred, mkSynTy, tidyOpenType, tidyOpenTypes ) @@ -703,14 +703,11 @@ lookupInst inst@(LitInst u (OverloadedFractional f) ty loc) | otherwise = tcLookupValueByKey fromRationalClassOpKey `thenNF_Tc` \ from_rational -> - - -- The type Rational isn't wired in so we have to conjure it up - tcLookupTyConByKey rationalTyConKey `thenNF_Tc` \ rational_tycon -> + newMethodAtLoc loc from_rational [ty] `thenNF_Tc` \ (method_inst, method_id) -> let - rational_ty = mkSynTy rational_tycon [] + rational_ty = funArgTy (idType method_id) rational_lit = HsLitOut (HsFrac f) rational_ty in - newMethodAtLoc loc from_rational [ty] `thenNF_Tc` \ (method_inst, method_id) -> returnNF_Tc (GenInst [method_inst] (HsApp (HsVar method_id) rational_lit)) where -- 1.7.10.4