Skip to content

Commit 5ed6b02

Browse files
committed
blockio: expose serialHasBlockIO from an internal module
We use `serialHasBlockIO` in the `sim` sub-library and so we have to expose it somewhere, but we'd actually prefer it if it was not part of the public API. Exposing it only from an internal module makes it clear that it should ideally not be used by users.
1 parent d58e149 commit 5ed6b02

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

blockio/blockio.cabal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ library
6969
exposed-modules:
7070
System.FS.BlockIO.API
7171
System.FS.BlockIO.IO
72+
System.FS.BlockIO.Serial.Internal
73+
74+
other-modules:
75+
System.FS.BlockIO.IO.Internal
7276
System.FS.BlockIO.Serial
7377

74-
other-modules: System.FS.BlockIO.IO.Internal
7578
build-depends:
7679
, base >=4.16 && <4.22
7780
, deepseq ^>=1.4 || ^>=1.5

blockio/src-sim/System/FS/BlockIO/Sim.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import qualified System.FS.API.Lazy as API
1818
import qualified System.FS.API.Strict as API
1919
import System.FS.BlockIO.API (HasBlockIO (..), LockFileHandle (..),
2020
LockMode (..))
21-
import System.FS.BlockIO.Serial
21+
import System.FS.BlockIO.Serial.Internal
2222
import System.FS.CallStack (prettyCallStack)
2323
import System.FS.Sim.Error
2424
import System.FS.Sim.MockFS hiding (hClose, hOpen)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- | This is an internal module that has to be exposed for technical reasons. Do
2+
-- not use it.
3+
module System.FS.BlockIO.Serial.Internal (
4+
-- We have to re-export from somewhere so that the @blockio:sim@ sub-library
5+
-- can use it. Unfortunately, this makes the function part of the public API
6+
-- even though we'd prefer to keep it truly hidden. There are ways around
7+
-- this, for example using a new private sub-library that contains the
8+
-- "System.FS.BlockIO.Serial" module, but it's a lot of boilerplate.
9+
serialHasBlockIO
10+
) where
11+
12+
import System.FS.BlockIO.Serial (serialHasBlockIO)

0 commit comments

Comments
 (0)