on master help sign in
Used realToFrac instead of toRational . fromRational.
commit3d4178f726ba7569277a2c381ed505716ebfa1fc authorClark Gaebel <cgaebel@uwaterloo.ca> dateThu 25 Oct 2012, 15:52 (14 years ago) parent1034181
1 file changed+2−2
Data/Aeson/Types/Class.hs+2−2
Data/Aeson/Types/Class.hs+2−2
@@ -307,12 +307,12 @@ instance FromJSON (Ratio Integer) where
307307 {-# INLINE parseJSON #-}
308308
309309instance HasResolution a => ToJSON (Fixed a) where
310− toJSON = Number . fromRational . toRational
310+ toJSON = Number . realToFrac
311311 {-# INLINE toJSON #-}
312312
313313instance HasResolution a => FromJSON (Fixed a) where
314314 parseJSON (Number n) = pure $ case n of
315− D d -> fromRational $ toRational d
315+ D d -> realToFrac d
316316 I i -> fromIntegral i
317317 parseJSON v = typeMismatch "Fixed" v
318318 {-# INLINE parseJSON #-}