From 86e0b4b9fd28ec0bdb9e376813e90f85e852ed64 Mon Sep 17 00:00:00 2001 From: Jose Pedro Magalhaes Date: Thu, 12 Feb 2009 13:23:27 +0000 Subject: [PATCH] #2759: Amend previous patch --- Data/Data.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ------------------------------------------------------------------------------ -- -- 1.7.10.4