return True
else do
-- there might be bytes in the byte buffer waiting to be decoded
- cbuf' <- readTextDeviceNonBlocking handle_ cbuf
+ cbuf' <- decodeByteBuf handle_ cbuf
writeIORef haCharBuffer cbuf'
if not (isEmptyBuffer cbuf') then return True else do
bufReadNBEmpty h_ buf (castPtr ptr) 0 count
haFD :: Handle__ -> FD
-haFD h_@Handle__{} =
- case cast h_ of
+haFD h_@Handle__{..} =
+ case cast haDevice of
Nothing -> error "not an FD"
Just fd -> fd