Skip to content

Commit 63208c5

Browse files
committed
Add Haddock string to formatRealFloat
This also describes the gh-231 related wart
1 parent 8f1a2c4 commit 63208c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Data/Text/Lazy/Builder/RealFloat.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ realFloat :: (RealFloat a) => a -> Builder
4646
{-# SPECIALIZE realFloat :: Double -> Builder #-}
4747
realFloat x = formatRealFloat Generic Nothing x
4848

49+
-- | Encode a signed 'RealFloat' according to 'FPFormat' and optionally requested precision.
50+
--
51+
-- This corresponds to the @show{E,F,G}Float@ operations provided by @base@'s "Numeric" module.
52+
--
53+
-- __NOTE__: The functions in @base-4.12@ changed the serialisation in
54+
-- case of a @Just 0@ precision; this version of @text@ still provides
55+
-- the serialisation as implemented in @base-4.11@. The next major
56+
-- version of @text@ will switch to the more correct @base-4.12@ serialisation.
4957
formatRealFloat :: (RealFloat a) =>
5058
FPFormat
5159
-> Maybe Int -- ^ Number of decimal places to render.

0 commit comments

Comments
 (0)