haskell: add packToHandle'

This commit is contained in:
tanakh
2010-09-07 16:14:00 +09:00
parent 43eab5c4e5
commit c56926428c

View File

@@ -25,6 +25,7 @@ module Data.MessagePack(
-- * Pack functions
packToString,
packToHandle,
packToHandle',
packToFile,
-- * Unpack functions
@@ -83,6 +84,10 @@ packToString = runPut
packToHandle :: Handle -> Put -> IO ()
packToHandle h = L.hPutStr h . packToString
-- | Pack to Handle and Flush Handle
packToHandle' :: Handle -> Put -> IO ()
packToHandle' h p = packToHandle h p >> hFlush h
-- | Pack to File
packToFile :: FilePath -> Put -> IO ()
packToFile path = L.writeFile path . packToString