module Data.Streaming.ByteString.Builder.Class
( StreamingBuilder (..)
, module Data.Streaming.ByteString.Builder
) where
import qualified Data.ByteString.Builder
import qualified Data.ByteString.Builder.Internal
import Data.Monoid (Monoid)
import Data.Streaming.ByteString.Builder hiding (newByteStringBuilderRecv)
import qualified Data.Streaming.ByteString.Builder
#if !MIN_VERSION_blaze_builder(0,4,0)
import qualified Blaze.ByteString.Builder
import Data.Streaming.Blaze
instance StreamingBuilder Blaze.ByteString.Builder.Builder where
newBuilderRecv = newBlazeRecv
builderFlush = Blaze.ByteString.Builder.flush
#endif /* !MIN_VERSION_blaze_builder(0,4,0) */
class Monoid b => StreamingBuilder b where
newBuilderRecv :: BufferAllocStrategy -> IO (b -> IO BuilderPopper, BuilderFinish)
builderFlush :: b
instance StreamingBuilder Data.ByteString.Builder.Builder where
newBuilderRecv = Data.Streaming.ByteString.Builder.newByteStringBuilderRecv
builderFlush = Data.ByteString.Builder.Internal.flush