haskell / haskell/double-conversion
Text builder instance writes to wrong offset
- Dominant language
- C++
- Stars
- 18
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following program:
``` Haskell
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 x2
```
The 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.