text-builder 0.6.3 → 0.6.4
raw patch · 2 files changed
+19/−2 lines, 2 filesdep ~deferred-folds
Dependency ranges changed: deferred-folds
Files
- library/Text/Builder.hs +17/−0
- text-builder.cabal +2/−2
library/Text/Builder.hs view
@@ -29,10 +29,15 @@ utf8CodeUnits3, utf8CodeUnits4, -- ** Integers+ -- *** Decimal decimal, unsignedDecimal, thousandSeparatedDecimal, thousandSeparatedUnsignedDecimal,+ -- *** Binary+ unsignedBinary,+ unsignedPaddedBinary,+ -- *** Hexadecimal hexadecimal, unsignedHexadecimal, -- ** Digits@@ -255,6 +260,18 @@ if mod index 3 == 0 && index /= 0 then return (decimalDigit digit <> char separatorChar) else return (decimalDigit digit)++{-| Unsigned binary number -}+{-# INLINE unsignedBinary #-}+unsignedBinary :: Integral a => a -> Builder+unsignedBinary =+ foldMap decimalDigit . Unfoldr.binaryDigits++{-| Unsigned binary number -}+{-# INLINE unsignedPaddedBinary #-}+unsignedPaddedBinary :: (Integral a, FiniteBits a) => a -> Builder+unsignedPaddedBinary a =+ padFromLeft (finiteBitSize a) '0' $ foldMap decimalDigit $ Unfoldr.binaryDigits a {-| Hexadecimal representation of an integral value -} {-# INLINE hexadecimal #-}
text-builder.cabal view
@@ -1,5 +1,5 @@ name: text-builder-version: 0.6.3+version: 0.6.4 category: Text synopsis: An efficient strict text builder homepage: https://github.com/nikita-volkov/text-builder@@ -25,7 +25,7 @@ base >=4.9 && <5, base-prelude <2, bytestring >=0.10 && <0.11,- deferred-folds >=0.9 && <0.10,+ deferred-folds >=0.9.9 && <0.10, semigroups >=0.18 && <0.19, text >=1 && <2, transformers >=0.5 && <0.6