[commit: packages/filepath] master: Clean up CPP/Haddock interaction (35c1907)

git at git.haskell.org git at git.haskell.org
Fri Oct 18 09:49:21 UTC 2013


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

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/35c19074f3a22eba5f5322bc35ef3ced24032ef3

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

commit 35c19074f3a22eba5f5322bc35ef3ced24032ef3
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Oct 18 11:18:10 2013 +0200

    Clean up CPP/Haddock interaction
    
    This removes the obsolete pre-Haddock2 `__HADDOCK__` conditional check
    which isn't supported anymore by Haddock2 (and in fact the conditional
    isn't needed anyway).
    
    This commit also moves more content into the
    `System/FilePath/Internal.hs` template that's `#include`d by
    `System/FilePath/{Posix,Windows}.hs` and as a side-effect, a part of the
    Haddock module-level documentation containing usage examples is now
    shown again in the generated HTML output.
    
    Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>


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

35c19074f3a22eba5f5322bc35ef3ced24032ef3
 System/FilePath.hs          |    4 ++--
 System/FilePath/Internal.hs |   23 +++++++++++++++++------
 System/FilePath/Posix.hs    |   23 -----------------------
 System/FilePath/Windows.hs  |   22 ----------------------
 4 files changed, 19 insertions(+), 53 deletions(-)

diff --git a/System/FilePath.hs b/System/FilePath.hs
index 7c1221c..fcfc351 100644
--- a/System/FilePath.hs
+++ b/System/FilePath.hs
@@ -1,11 +1,11 @@
 {-# LANGUAGE CPP #-}
-#ifdef __GLASGOW_HASKELL__
+#if __GLASGOW_HASKELL__ >= 704
 {-# LANGUAGE Safe #-}
 #endif
 {- |
 Module      :  System.FilePath
 Copyright   :  (c) Neil Mitchell 2005-2007
-License     :  BSD-style (see the file libraries/base/LICENSE)
+License     :  BSD3
 
 Maintainer  :  libraries at haskell.org
 Stability   :  stable
diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs
index f486120..b509541 100644
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@ -1,7 +1,22 @@
-{-# LANGUAGE CPP #-}
-#ifdef __GLASGOW_HASKELL__
+#if __GLASGOW_HASKELL__ >= 704
 {-# LANGUAGE Safe #-}
 #endif
+
+-- This template expects CPP definitions for:
+--     MODULE_NAME = Posix | Windows
+--     IS_WINDOWS  = False | True
+
+-- |
+-- Module      :  System.FilePath.MODULE_NAME
+-- Copyright   :  (c) Neil Mitchell 2005-2007
+-- License     :  BSD3
+--
+-- Maintainer  :  libraries at haskell.org
+-- Stability   :  stable
+-- Portability :  portable
+--
+-- A library for FilePath manipulations, using MODULE_NAME style paths on
+-- all platforms. Importing "System.FilePath" is usually better.
 --
 -- Some short examples:
 --
@@ -26,10 +41,6 @@
 -- tests, and should give clear semantics for the functions.
 -----------------------------------------------------------------------------
 
--- expects CPP definitions for:
---     MODULE_NAME = Posix | Windows
---     IS_WINDOWS  = False | True
-
 module System.FilePath.MODULE_NAME
     (
     -- * Separator predicates
diff --git a/System/FilePath/Posix.hs b/System/FilePath/Posix.hs
index e65ca46..3fbd0ff 100644
--- a/System/FilePath/Posix.hs
+++ b/System/FilePath/Posix.hs
@@ -1,27 +1,4 @@
 {-# LANGUAGE CPP #-}
-#ifdef __GLASGOW_HASKELL__
-{-# LANGUAGE Safe #-}
-#endif
 #define MODULE_NAME     Posix
 #define IS_WINDOWS      False
-
------------------------------------------------------------------------------
--- |
--- Module      :  System.FilePath.Posix
--- Copyright   :  (c) Neil Mitchell 2005-2007
--- License     :  BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer  :  libraries at haskell.org
--- Stability   :  stable
--- Portability :  portable
---
--- A library for FilePath manipulations, using Posix style paths on
--- all platforms. Importing "System.FilePath" is usually better.
-
--- Unfortunately, this #include breaks when haddocking with Cabal
-#ifdef __HADDOCK__
-module System.FilePath.Posix where
-#else
 #include "Internal.hs"
-#endif
-
diff --git a/System/FilePath/Windows.hs b/System/FilePath/Windows.hs
index 6224557..3e3e9d6 100644
--- a/System/FilePath/Windows.hs
+++ b/System/FilePath/Windows.hs
@@ -1,26 +1,4 @@
 {-# LANGUAGE CPP #-}
-#ifdef __GLASGOW_HASKELL__
-{-# LANGUAGE Safe #-}
-#endif
 #define MODULE_NAME     Windows
 #define IS_WINDOWS      True
-
------------------------------------------------------------------------------
--- |
--- Module      :  System.FilePath.Windows
--- Copyright   :  (c) Neil Mitchell 2005-2007
--- License     :  BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer  :  libraries at haskell.org
--- Stability   :  stable
--- Portability :  portable
---
--- A library for FilePath manipulations, using Windows style paths on
--- all platforms. Importing "System.FilePath" is usually better.
-
--- Unfortunately, this #include breaks when haddocking with Cabal
-#ifdef __HADDOCK__
-module System.FilePath.Windows where
-#else
 #include "Internal.hs"
-#endif



More information about the ghc-commits mailing list