-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Consider the following program:
import Data.Double.Conversion.Convertable
import Data.Text
import qualified Data.Text.Lazy.Builder as TLB
main :: IO ()
main = do
let
x1 :: Text = "I have " <> toExponential 2 (3.14 :: Double) <> " cakes."
x2 :: TLB.Builder = "I have " <> toExponential 2 (3.14 :: Double) <> " cakes."
putStrLn $ show x1
putStrLn $ show x2The output is ...
"I have 3.14e0 cakes."
"3.14e0 \NUL\NUL\NUL\NUL\NUL\NUL cakes."
The Text instance of Convertable produces correct output, but the Builder instance does not. In some other tests I did the Builder output always gets written to the beginning instead of the correct location.
Metadata
Metadata
Assignees
Labels
No labels