1. Aleksey Khudyakov
  2. binary-combinators

Commits

Aleksey Khudyakov  committed a2f7770

Use data-binary-ieee754

  • Participants
  • Parent commits 232282c
  • Branches default

Comments (0)

Files changed (2)

File Data/Binary/Combinators.hs

View file
  • Ignore whitespace
 import Data.Binary
 import Data.Binary.Get
 import Data.Binary.Put
+import Data.Binary.IEEE754
 import Data.Int
 
 
 
 -- | Put number as double precition (64bit) IEEE floating point number
 putAsFloat  :: Real a => a -> Put
-putAsFloat  = putFloatIEEEhost . realToFrac
+putAsFloat  = putFloat32le . realToFrac
 {-# INLINE putAsFloat #-}
 -- | Put number as double precition (64bit) IEEE floating point number
 putAsDouble :: Real a => a -> Put
-putAsDouble = putDoubleIEEEhost . realToFrac
+putAsDouble = putFloat64le . realToFrac
 {-# INLINE putAsDouble #-}
 
 -- | Get number as double precition (64bit) IEEE floating point number
 -- realToFrac <$> getFloat32le
 getAsFloat  :: Fractional a => Get a
-getAsFloat = {-# SCC "getAsFloat" #-} realToFrac <$> getFloatIEEEhost
+getAsFloat = {-# SCC "getAsFloat" #-} realToFrac <$> getFloat32le
 {-# INLINE getAsFloat #-}
 -- | Get number as double precition (64bit) IEEE floating point number
 getAsDouble :: Fractional a => Get a
-getAsDouble = {-# SCC "getAsDouble" #-} realToFrac <$> getDoubleIEEEhost
+getAsDouble = {-# SCC "getAsDouble" #-} realToFrac <$> getFloat64le
 {-# INLINE getAsDouble #-}
 
 ----------------------------------------------------------------

File binary-combinators.cabal

View file
  • Ignore whitespace
                    haskell98,
                    bytestring,
                    binary,
+                   data-binary-ieee754 >= 0.4.2.1,
                    zlib
   Exposed-modules: Data.Binary.Combinators
                    Data.Binary.Stream