
11 Nov
2002
11 Nov
'02
12:41 p.m.
It might be wise also to add a function like:
flushByte :: BinHandle -> IO ()
Interfaces to other things with alignment constraints (e.g., memory allocators) often have one of two generalizations: 1) (Most likely to be useful): --| flushBytes h n aligns the strean to the next 2^n byte (bit?) boundary flushBytes :: BinHandle -> Int -> IO () 2) (Less likely to be useful in this context) --| flushBytes h m n aligns the stream such that the position p satisfies: -- p `mod` 2^m == n flushBytes :: BinHandle -> Int -> IO () I'd guess that the former could be useful and that the latter is excessive for this case. -- Alastair