summaryrefslogtreecommitdiff
path: root/haskell/src/Data
diff options
context:
space:
mode:
authortanakh <tanaka.hideyuki@gmail.com>2010-09-07 16:14:00 +0900
committertanakh <tanaka.hideyuki@gmail.com>2010-09-07 16:14:00 +0900
commitc56926428c2b66fd3f112b9095c46f46e0527cd7 (patch)
tree00a4c625130d2777150d99f9e189a47ae73357f6 /haskell/src/Data
parent43eab5c4e5ac378b7e1b9b200bb9120ece53f9d9 (diff)
downloadmsgpack-python-c56926428c2b66fd3f112b9095c46f46e0527cd7.tar.gz
haskell: add packToHandle'
Diffstat (limited to 'haskell/src/Data')
-rw-r--r--haskell/src/Data/MessagePack.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/haskell/src/Data/MessagePack.hs b/haskell/src/Data/MessagePack.hs
index b53066b..7137589 100644
--- a/haskell/src/Data/MessagePack.hs
+++ b/haskell/src/Data/MessagePack.hs
@@ -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