{-# LANGUAGE CPP #-}
#ifdef USE_MONO_PAT_BINDS
{-# LANGUAGE MonoPatBinds #-}
#endif
module Blaze.ByteString.Builder.Int
(
writeInt8
, writeInt16be
, writeInt32be
, writeInt64be
, writeInt16le
, writeInt32le
, writeInt64le
, writeInthost
, writeInt16host
, writeInt32host
, writeInt64host
, fromInt8
, fromInt8s
, fromInt16be
, fromInt32be
, fromInt64be
, fromInt32sbe
, fromInt16sbe
, fromInt64sbe
, fromInt16le
, fromInt32le
, fromInt64le
, fromInt16sle
, fromInt32sle
, fromInt64sle
, fromInthost
, fromInt16host
, fromInt32host
, fromInt64host
, fromIntshost
, fromInt16shost
, fromInt32shost
, fromInt64shost
) where
import Blaze.ByteString.Builder.Internal
import Blaze.ByteString.Builder.Word
import Foreign
writeInt8 :: Int8 -> Write
writeInt8 = writeWord8 . fromIntegral
{-# INLINE writeInt8 #-}
writeInt16be :: Int16 -> Write
writeInt16be = writeWord16be . fromIntegral
{-# INLINE writeInt16be #-}
writeInt16le :: Int16 -> Write
writeInt16le = writeWord16le . fromIntegral
{-# INLINE writeInt16le #-}
writeInt32be :: Int32 -> Write
writeInt32be = writeWord32be . fromIntegral
{-# INLINE writeInt32be #-}
writeInt32le :: Int32 -> Write
writeInt32le = writeWord32le . fromIntegral
{-# INLINE writeInt32le #-}
writeInt64be :: Int64 -> Write
writeInt64be = writeWord64be . fromIntegral
{-# INLINE writeInt64be #-}
writeInt64le :: Int64 -> Write
writeInt64le = writeWord64le . fromIntegral
{-# INLINE writeInt64le #-}
writeInthost :: Int -> Write
writeInthost = writeStorable
{-# INLINE writeInthost #-}
writeInt16host :: Int16 -> Write
writeInt16host = writeStorable
{-# INLINE writeInt16host #-}
writeInt32host :: Int32 -> Write
writeInt32host = writeStorable
{-# INLINE writeInt32host #-}
writeInt64host :: Int64 -> Write
writeInt64host = writeStorable
{-# INLINE writeInt64host #-}
fromInt8 :: Int8 -> Builder
fromInt8 = fromWriteSingleton writeInt8
fromInt8s :: [Int8] -> Builder
fromInt8s = fromWriteList writeInt8
fromInt16be :: Int16 -> Builder
fromInt16be = fromWriteSingleton writeInt16be
{-# INLINE fromInt16be #-}
fromInt16sbe :: [Int16] -> Builder
fromInt16sbe = fromWriteList writeInt16be
{-# INLINE fromInt16sbe #-}
fromInt16le :: Int16 -> Builder
fromInt16le = fromWriteSingleton writeInt16le
{-# INLINE fromInt16le #-}
fromInt16sle :: [Int16] -> Builder
fromInt16sle = fromWriteList writeInt16le
{-# INLINE fromInt16sle #-}
fromInt32be :: Int32 -> Builder
fromInt32be = fromWriteSingleton writeInt32be
{-# INLINE fromInt32be #-}
fromInt32sbe :: [Int32] -> Builder
fromInt32sbe = fromWriteList writeInt32be
{-# INLINE fromInt32sbe #-}
fromInt32le :: Int32 -> Builder
fromInt32le = fromWriteSingleton writeInt32le
{-# INLINE fromInt32le #-}
fromInt32sle :: [Int32] -> Builder
fromInt32sle = fromWriteList writeInt32le
{-# INLINE fromInt32sle #-}
fromInt64be :: Int64 -> Builder
fromInt64be = fromWriteSingleton writeInt64be
{-# INLINE fromInt64be #-}
fromInt64sbe :: [Int64] -> Builder
fromInt64sbe = fromWriteList writeInt64be
{-# INLINE fromInt64sbe #-}
fromInt64le :: Int64 -> Builder
fromInt64le = fromWriteSingleton writeInt64le
{-# INLINE fromInt64le #-}
fromInt64sle :: [Int64] -> Builder
fromInt64sle = fromWriteList writeInt64le
{-# INLINE fromInt64sle #-}
fromInthost :: Int -> Builder
fromInthost = fromWriteSingleton writeInthost
{-# INLINE fromInthost #-}
fromIntshost :: [Int] -> Builder
fromIntshost = fromWriteList writeInthost
{-# INLINE fromIntshost #-}
fromInt16host :: Int16 -> Builder
fromInt16host = fromWriteSingleton writeInt16host
{-# INLINE fromInt16host #-}
fromInt16shost :: [Int16] -> Builder
fromInt16shost = fromWriteList writeInt16host
{-# INLINE fromInt16shost #-}
fromInt32host :: Int32 -> Builder
fromInt32host = fromWriteSingleton writeInt32host
{-# INLINE fromInt32host #-}
fromInt32shost :: [Int32] -> Builder
fromInt32shost = fromWriteList writeInt32host
{-# INLINE fromInt32shost #-}
fromInt64host :: Int64 -> Builder
fromInt64host = fromWriteSingleton writeInt64host
{-# INLINE fromInt64host #-}
fromInt64shost :: [Int64] -> Builder
fromInt64shost = fromWriteList writeInt64host
{-# INLINE fromInt64shost #-}