[commit: packages/directory] master: Make internal modules visible (4f9c05a)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:35:26 UTC 2017


Repository : ssh://git@git.haskell.org/directory

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4f9c05a6a50a028f2a3c9ee61eaa61b6dd20140f/directory

>---------------------------------------------------------------

commit 4f9c05a6a50a028f2a3c9ee61eaa61b6dd20140f
Author: Phil Ruffwind <rf at rufflewind.com>
Date:   Tue Feb 28 04:30:43 2017 -0500

    Make internal modules visible
    
    Some of them were already available (as required by tests), but they had
    their documentation hidden.  Hackage insists on showing the module names
    anyway.
    
    There's not really anything to hide here: the only reason they are
    internal is because they have no API stability guarantees, so may as
    well just make everything public.  The only exception is Config because
    there is nothing useful in there and the presence of exeExtension may
    mislead users into thinking that it's not available in the public API.
    
    There is a blank line in C_utimensat and Posix.  They are needed because
    hsc's {-# LINE ... #-} pragmas break the Haddock documentation.


>---------------------------------------------------------------

4f9c05a6a50a028f2a3c9ee61eaa61b6dd20140f
 System/Directory.hs                       |  8 ++++++++
 System/Directory/Internal.hs              | 22 +++++++++++++---------
 System/Directory/Internal/C_utimensat.hsc |  9 +++++++++
 System/Directory/Internal/Config.hs       |  4 ----
 System/Directory/Internal/Posix.hsc       |  9 +++++++++
 System/Directory/Internal/Prelude.hs      | 13 ++++++++++---
 System/Directory/Internal/Windows.hsc     |  8 ++++++++
 directory.cabal                           |  6 +++---
 8 files changed, 60 insertions(+), 19 deletions(-)

diff --git a/System/Directory.hs b/System/Directory.hs
index c0a2a45..3d895c8 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -115,6 +115,7 @@ import Data.Time.Clock.POSIX
   , utcTimeToPOSIXSeconds
   , POSIXTime
   )
+import qualified System.Directory.Internal.Config as Cfg
 #ifdef mingw32_HOST_OS
 import qualified System.Win32 as Win32
 #else
@@ -1293,6 +1294,13 @@ findFilesWithLazy f dirs path
         then return (Just (p, ListT (find ds)))
         else find ds
 
+-- | Filename extension for executable files (including the dot if any)
+--   (usually @\"\"@ on POSIX systems and @\".exe\"@ on Windows or OS\/2).
+--
+-- @since 1.2.4.0
+exeExtension :: String
+exeExtension = Cfg.exeExtension
+
 -- | Similar to 'listDirectory', but always includes the special entries (@.@
 -- and @..@).  (This applies to Windows as well.)
 --
diff --git a/System/Directory/Internal.hs b/System/Directory/Internal.hs
index 0ce6aca..b9cc4cf 100644
--- a/System/Directory/Internal.hs
+++ b/System/Directory/Internal.hs
@@ -1,22 +1,26 @@
 {-# LANGUAGE CPP #-}
-{-# OPTIONS_HADDOCK hide #-}
+-- |
+-- Stability: unstable
+-- Portability: unportable
+--
+-- Internal modules are always subject to change from version to version.
+
 #include <HsDirectoryConfig.h>
 
 module System.Directory.Internal
-  ( module System.Directory.Internal.Config
-
-#ifdef HAVE_UTIMENSAT
-  , module System.Directory.Internal.C_utimensat
-#endif
+  (
 
 #ifdef mingw32_HOST_OS
-  , module System.Directory.Internal.Windows
+    module System.Directory.Internal.Windows
 #else
-  , module System.Directory.Internal.Posix
+    module System.Directory.Internal.Posix
+#endif
+
+#ifdef HAVE_UTIMENSAT
+  , module System.Directory.Internal.C_utimensat
 #endif
 
   ) where
-import System.Directory.Internal.Config
 
 #ifdef HAVE_UTIMENSAT
 import System.Directory.Internal.C_utimensat
diff --git a/System/Directory/Internal/C_utimensat.hsc b/System/Directory/Internal/C_utimensat.hsc
index f10c659..0d20e84 100644
--- a/System/Directory/Internal/C_utimensat.hsc
+++ b/System/Directory/Internal/C_utimensat.hsc
@@ -1,3 +1,12 @@
+
+-- |
+-- Stability: unstable
+-- Portability: unportable
+--
+-- Internal modules are always subject to change from version to version.
+-- Since this is a platform-specific module, the contents shown in the Hackage
+-- documentation may differ from what is actually available on your system.
+
 module System.Directory.Internal.C_utimensat where
 #include <HsDirectoryConfig.h>
 #ifdef HAVE_UTIMENSAT
diff --git a/System/Directory/Internal/Config.hs b/System/Directory/Internal/Config.hs
index 5cc1b3e..54d1064 100644
--- a/System/Directory/Internal/Config.hs
+++ b/System/Directory/Internal/Config.hs
@@ -2,10 +2,6 @@
 #include <HsDirectoryConfig.h>
 module System.Directory.Internal.Config where
 
--- | Filename extension for executable files (including the dot if any)
---   (usually @\"\"@ on POSIX systems and @\".exe\"@ on Windows or OS\/2).
---
--- @since 1.2.4.0
 exeExtension :: String
 exeExtension = EXE_EXTENSION
 -- We avoid using #const_str from hsc because it breaks cross-compilation
diff --git a/System/Directory/Internal/Posix.hsc b/System/Directory/Internal/Posix.hsc
index 669e5c0..15f1f86 100644
--- a/System/Directory/Internal/Posix.hsc
+++ b/System/Directory/Internal/Posix.hsc
@@ -1,3 +1,12 @@
+
+-- |
+-- Stability: unstable
+-- Portability: unportable
+--
+-- Internal modules are always subject to change from version to version.
+-- Since this is a platform-specific module, the contents shown in the Hackage
+-- documentation may differ from what is actually available on your system.
+
 module System.Directory.Internal.Posix where
 #include <HsDirectoryConfig.h>
 #ifndef mingw32_HOST_OS
diff --git a/System/Directory/Internal/Prelude.hs b/System/Directory/Internal/Prelude.hs
index 7f77851..8d28e3e 100644
--- a/System/Directory/Internal/Prelude.hs
+++ b/System/Directory/Internal/Prelude.hs
@@ -1,10 +1,18 @@
 {-# LANGUAGE CPP #-}
-{-# OPTIONS_HADDOCK hide #-}
+-- |
+-- Stability: unstable
+-- Portability: unportable
+--
+-- Internal modules are always subject to change from version to version.
+
 module System.Directory.Internal.Prelude
   ( module Prelude
-#if !MIN_VERSION_base(4, 8, 0)
+#if MIN_VERSION_base(4, 8, 0)
+  , module Data.Void
+#else
   , module Control.Applicative
   , module Data.Functor
+  , Void
 #endif
   , module Control.Arrow
   , module Control.Concurrent
@@ -29,7 +37,6 @@ module System.Directory.Internal.Prelude
   , module System.Posix.Internals
   , module System.Posix.Types
   , module System.Timeout
-  , Void
   ) where
 #if !MIN_VERSION_base(4, 6, 0)
 import Prelude hiding (catch)
diff --git a/System/Directory/Internal/Windows.hsc b/System/Directory/Internal/Windows.hsc
index 63d88f8..2f53264 100644
--- a/System/Directory/Internal/Windows.hsc
+++ b/System/Directory/Internal/Windows.hsc
@@ -1,4 +1,12 @@
 {-# LANGUAGE CPP #-}
+-- |
+-- Stability: unstable
+-- Portability: unportable
+--
+-- Internal modules are always subject to change from version to version.
+-- Since this is a platform-specific module, the contents shown in the Hackage
+-- documentation may differ from what is actually available on your system.
+
 module System.Directory.Internal.Windows where
 #include <HsDirectoryConfig.h>
 #ifdef mingw32_HOST_OS
diff --git a/directory.cabal b/directory.cabal
index f5d8d7e..886fb0b 100644
--- a/directory.cabal
+++ b/directory.cabal
@@ -44,12 +44,12 @@ Library
     exposed-modules:
         System.Directory
         System.Directory.Internal
-        System.Directory.Internal.Prelude
-    other-modules:
-        System.Directory.Internal.Config
         System.Directory.Internal.C_utimensat
         System.Directory.Internal.Posix
+        System.Directory.Internal.Prelude
         System.Directory.Internal.Windows
+    other-modules:
+        System.Directory.Internal.Config
 
     include-dirs: .
 



More information about the ghc-commits mailing list