main :: IO ()
main = defaultMain $ concat
    [ benchmark "[String]"
        (mconcat . map (mconcat . (map $ Binary.singleton .  fromIntegral . ord)))
        (mconcat . map Blaze.fromString)
        strings
    , benchmark "L.ByteString"
        (Binary.fromLazyByteString)
        (Blaze.fromLazyByteString)
        byteStrings
    , benchmark "[Text]"
        (mconcat . map (Binary.fromByteString . encodeUtf8))
        (mconcat . map Blaze.fromText)
        texts
    , benchmark "[Word8]"
        (mconcat . map Binary.singleton)
        (Blaze.fromWord8s)
        word8s
    ]
  where
    benchmark name binaryF blazeF x =
        [ bench (name ++ " (Data.Binary builder)") $
            whnf (L.length . Binary.toLazyByteString . binaryF) x
        , bench (name ++ " (blaze builder)") $
            whnf (L.length . Blaze.toLazyByteString . blazeF) x
        ]
main :: IO ()
main = defaultMain $ concat
    [ benchmark "[String]"
        (mconcat . map (mconcat . (map $ Binary.singleton .  fromIntegral . ord)))
        (mconcat . map Blaze.fromString)
        strings
    , benchmark "L.ByteString"
        (Binary.fromLazyByteString)
        (Blaze.fromLazyByteString)
        byteStrings
    , benchmark "[Text]"
        (mconcat . map (Binary.fromByteString . encodeUtf8))
        (mconcat . map Blaze.fromText)
        texts
    , benchmark "[Word8]"
        (mconcat . map Binary.singleton)
        (Blaze.fromWord8s)
        word8s
    ]
  where
    benchmark name binaryF blazeF x =
        [ bench (name ++ " (Data.Binary builder)") $
            whnf (L.length . Binary.toLazyByteString . binaryF) x
        , bench (name ++ " (blaze builder)") $
            whnf (L.length . Blaze.toLazyByteString . blazeF) x
        ]
main = defaultMain $ concat
    [ benchmark "[String]"
        (mconcat . map (mconcat . (map $ Binary.singleton .  fromIntegral . ord)))
        (mconcat . map Blaze.fromString)
        strings
    , benchmark "L.ByteString"
        (Binary.fromLazyByteString)
        (Blaze.fromLazyByteString)
        byteStrings
    , benchmark "[Text]"
        (mconcat . map (Binary.fromByteString . encodeUtf8))
        (mconcat . map Blaze.fromText)
        texts
    , benchmark "[Word8]"
        (mconcat . map Binary.singleton)
        (Blaze.fromWord8s)
        word8s
    ]
  where
    benchmark name binaryF blazeF x =
        [ bench (name ++ " (Data.Binary builder)") $
            whnf (L.length . Binary.toLazyByteString . binaryF) x
        , bench (name ++ " (blaze builder)") $
            whnf (L.length . Blaze.toLazyByteString . blazeF) x
        ]