X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FPrelInfo.lhs;h=58a3d8fe2e9e95b50ca1ffea948e6ee6cab9fbde;hb=e921b2e307532e0f30eefa88b11a124be592bde4;hp=c84d072c025287fe7ada2e726a3491f80e975cbe;hpb=edd06d674dd5ffa05c08b6d75dd3a6b63b016f58;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/PrelInfo.lhs b/ghc/compiler/prelude/PrelInfo.lhs index c84d072..58a3d8f 100644 --- a/ghc/compiler/prelude/PrelInfo.lhs +++ b/ghc/compiler/prelude/PrelInfo.lhs @@ -14,19 +14,19 @@ module PrelInfo ( -- it is here, unique and all. Includes all the derivingOccurrences, -- For a given class C, this tells what other - -- things are needed as a result of a + derivableClassKeys, -- things are needed as a result of a -- deriving(C) clause -- Random other things main_NAME, ioTyCon_NAME, deRefStablePtr_NAME, makeStablePtr_NAME, - bindIO_NAME, + bindIO_NAME, maybeCharLikeCon, maybeIntLikeCon, needsDataDeclCtxtClassKeys, cCallishClassKeys, cCallishTyKeys, isNoDictClass, isNumericClass, isStandardClass, isCcallishClass, - isCreturnableClass, numericTyKeys, + isCreturnableClass, numericTyKeys, fractionalClassKeys, -- RdrNames for lots of things, mainly used in derivings eq_RDR, ne_RDR, le_RDR, lt_RDR, ge_RDR, gt_RDR, max_RDR, min_RDR, @@ -319,12 +319,13 @@ ioDataCon_RDR = dataQual pREL_IO_BASE_Name SLIT("IO") bindIO_RDR = varQual pREL_IO_BASE_Name SLIT("bindIO") orderingTyCon_RDR = tcQual pREL_BASE_Name SLIT("Ordering") -rationalTyCon_RDR = tcQual pREL_NUM_Name SLIT("Rational") -ratioTyCon_RDR = tcQual pREL_NUM_Name SLIT("Ratio") -ratioDataCon_RDR = dataQual pREL_NUM_Name SLIT(":%") -byteArrayTyCon_RDR = tcQual pREL_ARR_Name SLIT("ByteArray") -mutableByteArrayTyCon_RDR = tcQual pREL_ARR_Name SLIT("MutableByteArray") +rationalTyCon_RDR = tcQual pREL_REAL_Name SLIT("Rational") +ratioTyCon_RDR = tcQual pREL_REAL_Name SLIT("Ratio") +ratioDataCon_RDR = dataQual pREL_REAL_Name SLIT(":%") + +byteArrayTyCon_RDR = tcQual pREL_BYTEARR_Name SLIT("ByteArray") +mutableByteArrayTyCon_RDR = tcQual pREL_BYTEARR_Name SLIT("MutableByteArray") foreignObjTyCon_RDR = tcQual pREL_IO_BASE_Name SLIT("ForeignObj") stablePtrTyCon_RDR = tcQual pREL_STABLE_Name SLIT("StablePtr") @@ -401,13 +402,14 @@ plus_RDR = varQual pREL_NUM_Name SLIT("+") times_RDR = varQual pREL_NUM_Name SLIT("*") -- Other numberic classes -realClass_RDR = clsQual pREL_NUM_Name SLIT("Real") -integralClass_RDR = clsQual pREL_NUM_Name SLIT("Integral") -fractionalClass_RDR = clsQual pREL_NUM_Name SLIT("Fractional") -floatingClass_RDR = clsQual pREL_NUM_Name SLIT("Floating") -realFracClass_RDR = clsQual pREL_NUM_Name SLIT("RealFrac") -realFloatClass_RDR = clsQual pREL_NUM_Name SLIT("RealFloat") -fromRational_RDR = varQual pREL_NUM_Name SLIT("fromRational") +realClass_RDR = clsQual pREL_REAL_Name SLIT("Real") +integralClass_RDR = clsQual pREL_REAL_Name SLIT("Integral") +realFracClass_RDR = clsQual pREL_REAL_Name SLIT("RealFrac") +fractionalClass_RDR = clsQual pREL_REAL_Name SLIT("Fractional") +fromRational_RDR = varQual pREL_REAL_Name SLIT("fromRational") + +floatingClass_RDR = clsQual pREL_FLOAT_Name SLIT("Floating") +realFloatClass_RDR = clsQual pREL_FLOAT_Name SLIT("RealFloat") -- Class Ix ixClass_RDR = clsQual iX_Name SLIT("Ix") @@ -549,6 +551,7 @@ because the list of ambiguous dictionaries hasn't been simplified. isCcallishClass, isCreturnableClass, isNoDictClass, isNumericClass, isStandardClass :: Class -> Bool +isFractionalClass clas = classKey clas `is_elem` fractionalClassKeys isNumericClass clas = classKey clas `is_elem` numericClassKeys isStandardClass clas = classKey clas `is_elem` standardClassKeys isCcallishClass clas = classKey clas `is_elem` cCallishClassKeys @@ -560,7 +563,11 @@ numericClassKeys = [ numClassKey , realClassKey , integralClassKey - , fractionalClassKey + ] + ++ fractionalClassKeys + +fractionalClassKeys = + [ fractionalClassKey , floatingClassKey , realFracClassKey , realFloatClassKey