Commits

wowus committed e03de93

Used realToFrac instead of toRational . fromRational.

  • Participants
  • Parent commits dfaba1c

Comments (0)

Files changed (1)

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 #-}