module Blaze.ByteString.Builder.Word
(
writeWord8
, writeWord16be
, writeWord32be
, writeWord64be
, writeWord16le
, writeWord32le
, writeWord64le
, writeWordhost
, writeWord16host
, writeWord32host
, writeWord64host
, fromWord8
, fromWord8s
, fromWord16be
, fromWord32be
, fromWord64be
, fromWord32sbe
, fromWord16sbe
, fromWord64sbe
, fromWord16le
, fromWord32le
, fromWord64le
, fromWord16sle
, fromWord32sle
, fromWord64sle
, fromWordhost
, fromWord16host
, fromWord32host
, fromWord64host
, fromWordshost
, fromWord16shost
, fromWord32shost
, fromWord64shost
) where
import Data.Word
import Blaze.ByteString.Builder.Compat.Write ( Write, writePrimFixed )
import Data.ByteString.Builder ( Builder )
import qualified Data.ByteString.Builder as B
import qualified Data.ByteString.Builder.Extra as B
import qualified Data.ByteString.Builder.Prim as P
writeWord8 :: Word8 -> Write
writeWord8 :: Word8 -> Write
writeWord8 = FixedPrim Word8 -> Word8 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word8
P.word8
{-# INLINE writeWord8 #-}
writeWord16be :: Word16 -> Write
writeWord16be :: Word16 -> Write
writeWord16be = FixedPrim Word16 -> Word16 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word16
P.word16BE
{-# INLINE writeWord16be #-}
writeWord32be :: Word32 -> Write
writeWord32be :: Word32 -> Write
writeWord32be = FixedPrim Word32 -> Word32 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word32
P.word32BE
{-# INLINE writeWord32be #-}
writeWord64be :: Word64 -> Write
writeWord64be :: Word64 -> Write
writeWord64be = FixedPrim Word64 -> Word64 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word64
P.word64BE
{-# INLINE writeWord64be #-}
writeWord16le :: Word16 -> Write
writeWord16le :: Word16 -> Write
writeWord16le = FixedPrim Word16 -> Word16 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word16
P.word16LE
{-# INLINE writeWord16le #-}
writeWord32le :: Word32 -> Write
writeWord32le :: Word32 -> Write
writeWord32le = FixedPrim Word32 -> Word32 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word32
P.word32LE
{-# INLINE writeWord32le #-}
writeWord64le :: Word64 -> Write
writeWord64le :: Word64 -> Write
writeWord64le = FixedPrim Word64 -> Word64 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word64
P.word64LE
{-# INLINE writeWord64le #-}
writeWordhost :: Word -> Write
writeWordhost :: Word -> Write
writeWordhost = FixedPrim Word -> Word -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word
P.wordHost
{-# INLINE writeWordhost #-}
writeWord16host :: Word16 -> Write
writeWord16host :: Word16 -> Write
writeWord16host = FixedPrim Word16 -> Word16 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word16
P.word16Host
{-# INLINE writeWord16host #-}
writeWord32host :: Word32 -> Write
writeWord32host :: Word32 -> Write
writeWord32host = FixedPrim Word32 -> Word32 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word32
P.word32Host
{-# INLINE writeWord32host #-}
writeWord64host :: Word64 -> Write
writeWord64host :: Word64 -> Write
writeWord64host = FixedPrim Word64 -> Word64 -> Write
forall a. FixedPrim a -> a -> Write
writePrimFixed FixedPrim Word64
P.word64Host
{-# INLINE writeWord64host #-}
fromWord8 :: Word8 -> Builder
fromWord8 :: Word8 -> Builder
fromWord8 = Word8 -> Builder
B.word8
{-# INLINE fromWord8 #-}
fromWord8s :: [Word8] -> Builder
fromWord8s :: [Word8] -> Builder
fromWord8s = FixedPrim Word8 -> [Word8] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word8
P.word8
{-# INLINE fromWord8s #-}
fromWord16be :: Word16 -> Builder
fromWord16be :: Word16 -> Builder
fromWord16be = Word16 -> Builder
B.word16BE
{-# INLINE fromWord16be #-}
fromWord32be :: Word32 -> Builder
fromWord32be :: Word32 -> Builder
fromWord32be = Word32 -> Builder
B.word32BE
{-# INLINE fromWord32be #-}
fromWord64be :: Word64 -> Builder
fromWord64be :: Word64 -> Builder
fromWord64be = Word64 -> Builder
B.word64BE
{-# INLINE fromWord64be #-}
fromWord32sbe :: [Word32] -> Builder
fromWord32sbe :: [Word32] -> Builder
fromWord32sbe = FixedPrim Word32 -> [Word32] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word32
P.word32BE
{-# INLINE fromWord32sbe #-}
fromWord16sbe :: [Word16] -> Builder
fromWord16sbe :: [Word16] -> Builder
fromWord16sbe = FixedPrim Word16 -> [Word16] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word16
P.word16BE
{-# INLINE fromWord16sbe #-}
fromWord64sbe :: [Word64] -> Builder
fromWord64sbe :: [Word64] -> Builder
fromWord64sbe = FixedPrim Word64 -> [Word64] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word64
P.word64BE
{-# INLINE fromWord64sbe #-}
fromWord16le :: Word16 -> Builder
fromWord16le :: Word16 -> Builder
fromWord16le = Word16 -> Builder
B.word16LE
{-# INLINE fromWord16le #-}
fromWord32le :: Word32 -> Builder
fromWord32le :: Word32 -> Builder
fromWord32le = Word32 -> Builder
B.word32LE
{-# INLINE fromWord32le #-}
fromWord64le :: Word64 -> Builder
fromWord64le :: Word64 -> Builder
fromWord64le = Word64 -> Builder
B.word64LE
{-# INLINE fromWord64le #-}
fromWord16sle :: [Word16] -> Builder
fromWord16sle :: [Word16] -> Builder
fromWord16sle = FixedPrim Word16 -> [Word16] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word16
P.word16LE
{-# INLINE fromWord16sle #-}
fromWord32sle :: [Word32] -> Builder
fromWord32sle :: [Word32] -> Builder
fromWord32sle = FixedPrim Word32 -> [Word32] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word32
P.word32LE
{-# INLINE fromWord32sle #-}
fromWord64sle :: [Word64] -> Builder
fromWord64sle :: [Word64] -> Builder
fromWord64sle = FixedPrim Word64 -> [Word64] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word64
P.word64LE
{-# INLINE fromWord64sle #-}
fromWordhost :: Word -> Builder
fromWordhost :: Word -> Builder
fromWordhost = Word -> Builder
B.wordHost
{-# INLINE fromWordhost #-}
fromWord16host :: Word16 -> Builder
fromWord16host :: Word16 -> Builder
fromWord16host = Word16 -> Builder
B.word16Host
{-# INLINE fromWord16host #-}
fromWord32host :: Word32 -> Builder
fromWord32host :: Word32 -> Builder
fromWord32host = Word32 -> Builder
B.word32Host
{-# INLINE fromWord32host #-}
fromWord64host :: Word64 -> Builder
fromWord64host :: Word64 -> Builder
fromWord64host = Word64 -> Builder
B.word64Host
{-# INLINE fromWord64host #-}
fromWordshost :: [Word] -> Builder
fromWordshost :: [Word] -> Builder
fromWordshost = FixedPrim Word -> [Word] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word
P.wordHost
{-# INLINE fromWordshost #-}
fromWord16shost :: [Word16] -> Builder
fromWord16shost :: [Word16] -> Builder
fromWord16shost = FixedPrim Word16 -> [Word16] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word16
P.word16Host
{-# INLINE fromWord16shost #-}
fromWord32shost :: [Word32] -> Builder
fromWord32shost :: [Word32] -> Builder
fromWord32shost = FixedPrim Word32 -> [Word32] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word32
P.word32Host
{-# INLINE fromWord32shost #-}
fromWord64shost :: [Word64] -> Builder
fromWord64shost :: [Word64] -> Builder
fromWord64shost = FixedPrim Word64 -> [Word64] -> Builder
forall a. FixedPrim a -> [a] -> Builder
P.primMapListFixed FixedPrim Word64
P.word64Host
{-# INLINE fromWord64shost #-}