AV
Size: a a a
AV
AV
AV
formatDecimal i
| i < 0 = minus Mon.<>
if i <= -128
then formatPositive (-(i `quot` 10)) Mon.<> digit (-(i `rem` 10))
else formatPositive (-i)
| otherwise = formatPositive i
AV
AV
AV
formatPositive = go
where go n | n < 10 = digit n
| otherwise = go (n `quot` 10) Mon.<> digit (n `rem` 10)
AV
digit :: Integral a => a -> Builder
digit n = word8 $! i2w (fromIntegral n)
AV
AV
-- | Uses decimal encoding with optional sign.
instance
ToField
Int64 where
toField
=
decimal
{-# INLINE toField #-
AV
class F a where
fb :: a -> Builder
newtype Fast a = Fast a
instance F a => ToField (Fast a) where
toField (F a) = toStrict . toLazyByteString $ fb a
deriving via F Int64 instance ToField Int64
AV
AV
AV
AV
MK
AV
AV
AV
AV
AV