Source

aeson / Data / Aeson / Types / Class.hs

The default branch has multiple heads

Diff from to

File Data/Aeson/Types/Class.hs

     {-# INLINE parseJSON #-}
 
 instance HasResolution a => ToJSON (Fixed a) where
-    toJSON = Number . fromRational . toRational
+    toJSON = Number . realToFrac
     {-# INLINE toJSON #-}
 
 instance HasResolution a => FromJSON (Fixed a) where
     parseJSON (Number n) = pure $ case n of
-                                    D d -> fromRational $ toRational d
+                                    D d -> realToFrac d
                                     I i -> fromIntegral i
     parseJSON v          = typeMismatch "Fixed" v
     {-# INLINE parseJSON #-}