{-# OPTIONS_GHC -XNoImplicitPrelude -XBangPatterns #-}
-{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.IO.Device
SeekMode(..)
) where
+#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.Word
import GHC.Arr
import GHC.Num
import GHC.IO
import {-# SOURCE #-} GHC.IO.Exception ( unsupportedOperation )
+#endif
+#ifdef __NHC__
+import Foreign
+import Ix
+import Control.Exception.Base
+unsupportedOperation = userError "unsupported operation"
+#endif
-- | A low-level I/O provider where the data is bytes in memory.
class RawIO a where
isSeekable :: a -> IO Bool
isSeekable _ = return False
- -- | seek to the specified positing in the data.
+ -- | seek to the specified position in the data.
seek :: a -> SeekMode -> Integer -> IO ()
seek _ _ _ = ioe_unsupportedOperation
-- -----------------------------------------------------------------------------
-- SeekMode type
--- | A mode that determines the effect of 'hSeek' @hdl mode i@, as follows:
+-- | A mode that determines the effect of 'hSeek' @hdl mode i@.
data SeekMode
= AbsoluteSeek -- ^ the position of @hdl@ is set to @i@.
| RelativeSeek -- ^ the position of @hdl@ is set to offset @i@