From: Jose Pedro Magalhaes Date: Thu, 12 Feb 2009 13:23:27 +0000 (+0000) Subject: #2759: Amend previous patch X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=86e0b4b9fd28ec0bdb9e376813e90f85e852ed64;p=ghc-base.git #2759: Amend previous patch --- diff --git a/Data/Data.hs b/Data/Data.hs index ef44933..8c746dd 100644 --- a/Data/Data.hs +++ b/Data/Data.hs @@ -640,7 +640,7 @@ readConstr dt str = case dataTypeRep dt of AlgRep cons -> idx cons IntRep -> mkReadCon (\i -> (mkPrimCon dt str (IntConstr i))) - FloatRep -> mkReadCon (\f -> (mkPrimCon dt str (FloatConstr f))) + FloatRep -> mkReadCon ffloat CharRep -> mkReadCon (\c -> (mkPrimCon dt str (CharConstr c))) NoRep -> Nothing where @@ -658,6 +658,8 @@ readConstr dt str = then Nothing else Just (head fit) + ffloat :: Double -> Constr + ffloat = mkPrimCon dt str . FloatConstr . toRational ------------------------------------------------------------------------------ --