shithub: MicroHs

Download patch

ref: a13fe877d6059d07e6ecc56801f33a2da2799919
parent: f58d438a7f4226655ce54b9f1fa63d4a38874c1a
author: Lennart Augustsson <lennart@augustsson.net>
date: Thu Nov 28 19:34:26 EST 2024

Add setBuffering

--- a/lib/System/IO.hs
+++ b/lib/System/IO.hs
@@ -24,6 +24,10 @@
   openTmpFile, openTempFile, openBinaryTempFile,
 
   withFile,
+
+  BufferMode(..),
+  hSetBuffering,
+
   ) where
 import Prelude()              -- do not import Prelude
 import Primitives
@@ -40,6 +44,7 @@
 import Data.List
 import Data.Maybe
 import Data.Num
+import Data.Ord
 import Data.String
 import Data.Tuple
 import Text.Show
@@ -320,3 +325,10 @@
 
 openBinaryTempFile :: FilePath -> String -> IO (String, Handle)
 openBinaryTempFile = openTempFile' openBinaryFile
+
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+  deriving (Eq, Ord, Show)
+
+-- This currently does nothing.
+hSetBuffering :: Handle -> BufferMode -> IO ()
+hSetBuffering _ _ = return ()