Bryan O'Sullivan avatar Bryan O'Sullivan committed 6dd06b5

Rename Format to FPFormat.

Comments (0)

Files changed (3)

Data/Text/Format/RealFloat.hs

 import Data.Text.Format.Functions ((<>), i2d)
 import Data.Text.Format.RealFloat.Functions (roundTo)
 import Data.Text.Format.Int (integral)
-import Data.Text.Format.Types (Format(..))
+import Data.Text.Format.Types (FPFormat(..))
 import qualified Data.Text as T
 import Data.Array.Base (unsafeAt)
 import Data.Text.Lazy.Builder
 {-# SPECIALIZE showFloat :: Double -> Builder #-}
 showFloat x = formatRealFloat Generic Nothing x
 
-formatRealFloat :: (RealFloat a) => Format -> Maybe Int -> a -> Builder
-{-# SPECIALIZE formatRealFloat :: Format -> Maybe Int -> Float -> Builder #-}
-{-# SPECIALIZE formatRealFloat :: Format -> Maybe Int -> Double -> Builder #-}
+formatRealFloat :: (RealFloat a) => FPFormat -> Maybe Int -> a -> Builder
+{-# SPECIALIZE formatRealFloat :: FPFormat -> Maybe Int -> Float -> Builder #-}
+{-# SPECIALIZE formatRealFloat :: FPFormat -> Maybe Int -> Double -> Builder #-}
 formatRealFloat fmt decs x
    | isNaN x                   = "NaN"
    | isInfinite x              = if x < 0 then "-Infinity" else "Infinity"

Data/Text/Format/RealFloat/Fast.hs

 import Data.Text.Format.Int (integral)
 import Data.Text.Format.RealFloat.Fast.Internal (posToDigits)
 import Data.Text.Format.RealFloat.Functions (roundTo)
-import Data.Text.Format.Types (Format(..))
+import Data.Text.Format.Types (FPFormat(..))
 import Data.Text.Lazy.Builder
 import qualified Data.Text as T
 
 {-# SPECIALIZE fshowGFloat :: Maybe Int -> Double -> Builder #-}
 fshowGFloat d x =  formatFloat Generic d x
 
-formatFloat :: DispFloat a => Format -> Maybe Int -> a -> Builder
-{-# SPECIALIZE formatFloat :: Format -> Maybe Int -> Float -> Builder #-}
-{-# SPECIALIZE formatFloat :: Format -> Maybe Int -> Double -> Builder #-}
+formatFloat :: DispFloat a => FPFormat -> Maybe Int -> a -> Builder
+{-# SPECIALIZE formatFloat :: FPFormat -> Maybe Int -> Float -> Builder #-}
+{-# SPECIALIZE formatFloat :: FPFormat -> Maybe Int -> Double -> Builder #-}
 formatFloat fmt decs x
     | isNaN x                   = "NaN"
     | isInfinite x              = if x < 0 then "-Infinity" else "Infinity"

Data/Text/Format/Types.hs

 
 module Data.Text.Format.Types
     (
-      Format(..)
+      FPFormat(..)
     , Fast(..)
     , Only(..)
     , Shown(..)
     ) where
 
 -- | Control the rendering of floating point numbers.
-data Format = Exponent
+data FPFormat = Exponent
               -- ^ Scientific notation (e.g. @2.3e123@).
-            | Fixed
+              | Fixed
               -- ^ Standard decimal notation.
-            | Generic
+              | Generic
               -- ^ Use decimal notation for values between @0.1@ and
               -- @9,999,999@, and scientific notation otherwise.
-            deriving (Enum, Read, Show)
+                deriving (Enum, Read, Show)
 
 -- | Render a floating point number using a much faster algorithm than
 -- the default (up to 10x faster). This performance comes with a
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.