From 56476c86ac9334f68ee112492d9748b33dad5c64 Mon Sep 17 00:00:00 2001 From: Julian Ospald <hasufell@posteo.de> Date: Sat, 25 Nov 2023 15:26:02 +0800 Subject: [PATCH] Add deprecation warnings for os-string split --- System/OsPath/Data/ByteString/Short.hs | 4 +++- System/OsPath/Data/ByteString/Short/Internal.hs | 2 +- System/OsPath/Data/ByteString/Short/Word16.hs | 2 +- System/OsPath/Encoding/Internal.hs | 2 +- System/OsString.hs | 2 +- System/OsString/Common.hs | 2 +- System/OsString/Internal.hs | 2 +- System/OsString/Internal/Types.hs | 2 +- System/OsString/Types.hs | 2 +- changelog.md | 4 ++++ filepath.cabal | 2 +- 11 files changed, 16 insertions(+), 10 deletions(-) diff --git a/System/OsPath/Data/ByteString/Short.hs b/System/OsPath/Data/ByteString/Short.hs index f3a666f..c8265bd 100644 --- a/System/OsPath/Data/ByteString/Short.hs +++ b/System/OsPath/Data/ByteString/Short.hs @@ -23,7 +23,9 @@ -- -- > import qualified Data.ByteString.Short as B.Short -- -module System.OsPath.Data.ByteString.Short ( +module System.OsPath.Data.ByteString.Short {-# DEPRECATED "Use System.OsString.Data.ByteString.Short from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} + + ( -- * The @ShortByteString@ type diff --git a/System/OsPath/Data/ByteString/Short/Internal.hs b/System/OsPath/Data/ByteString/Short/Internal.hs index 5003f99..faf1408 100644 --- a/System/OsPath/Data/ByteString/Short/Internal.hs +++ b/System/OsPath/Data/ByteString/Short/Internal.hs @@ -17,7 +17,7 @@ -- -- Internal low-level utilities mostly for 'System.OsPath.Data.ByteString.Short.Word16', -- such as byte-array operations and other stuff not meant to be exported from Word16 module. -module System.OsPath.Data.ByteString.Short.Internal where +module System.OsPath.Data.ByteString.Short.Internal {-# DEPRECATED "Use System.OsString.Data.ByteString.Short.Internal from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} where import Control.Monad.ST import Control.Exception (assert, throwIO) diff --git a/System/OsPath/Data/ByteString/Short/Word16.hs b/System/OsPath/Data/ByteString/Short/Word16.hs index 6ad8134..c3b3ca4 100644 --- a/System/OsPath/Data/ByteString/Short/Word16.hs +++ b/System/OsPath/Data/ByteString/Short/Word16.hs @@ -29,7 +29,7 @@ -- -- All functions will error out if the input string is not a valid UTF16 stream (uneven number of bytes). -- So use this module with caution. -module System.OsPath.Data.ByteString.Short.Word16 ( +module System.OsPath.Data.ByteString.Short.Word16 {-# DEPRECATED "Use System.OsString.Data.ByteString.Short.Word16 from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} ( -- * The @ShortByteString@ type and representation ShortByteString(..), diff --git a/System/OsPath/Encoding/Internal.hs b/System/OsPath/Encoding/Internal.hs index 1ae1c85..218ad37 100644 --- a/System/OsPath/Encoding/Internal.hs +++ b/System/OsPath/Encoding/Internal.hs @@ -6,7 +6,7 @@ {-# OPTIONS_GHC -funbox-strict-fields #-} -module System.OsPath.Encoding.Internal where +module System.OsPath.Encoding.Internal {-# DEPRECATED "Use System.OsString.Encoding.Internal from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} where import qualified System.OsPath.Data.ByteString.Short as BS8 import qualified System.OsPath.Data.ByteString.Short.Word16 as BS16 diff --git a/System/OsString.hs b/System/OsString.hs index c11a4bd..0325fd6 100644 --- a/System/OsString.hs +++ b/System/OsString.hs @@ -14,7 +14,7 @@ -- -- It captures the notion of syscall specific encoding (or the lack thereof) to avoid roundtrip issues -- and memory fragmentation by using unpinned byte arrays. Bytes are not touched or interpreted. -module System.OsString +module System.OsString {-# DEPRECATED "Use System.OsString from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} ( -- * String types OsString diff --git a/System/OsString/Common.hs b/System/OsString/Common.hs index 80eb69b..0ec7615 100644 --- a/System/OsString/Common.hs +++ b/System/OsString/Common.hs @@ -11,7 +11,7 @@ #define POSIX_DOC #endif -module System.OsString.MODULE_NAME +module System.OsString.MODULE_NAME {-# DEPRECATED "Use System.OsString.MODULE_NAME from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} ( -- * Types #ifdef WINDOWS diff --git a/System/OsString/Internal.hs b/System/OsString/Internal.hs index f72fdcb..a7639af 100644 --- a/System/OsString/Internal.hs +++ b/System/OsString/Internal.hs @@ -2,7 +2,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UnliftedFFITypes #-} -module System.OsString.Internal where +module System.OsString.Internal {-# DEPRECATED "Use System.OsString.Internal from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} where import System.OsString.Internal.Types diff --git a/System/OsString/Internal/Types.hs b/System/OsString/Internal/Types.hs index 33f960f..2f7c225 100644 --- a/System/OsString/Internal/Types.hs +++ b/System/OsString/Internal/Types.hs @@ -8,7 +8,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE PatternSynonyms #-} -module System.OsString.Internal.Types +module System.OsString.Internal.Types {-# DEPRECATED "Use System.OsString.Internal.Types from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} ( WindowsString(..) , pattern WS diff --git a/System/OsString/Types.hs b/System/OsString/Types.hs index 896c3b2..67a4e11 100644 --- a/System/OsString/Types.hs +++ b/System/OsString/Types.hs @@ -1,4 +1,4 @@ -module System.OsString.Types +module System.OsString.Types {-# DEPRECATED "Use System.OsString.Types from os-string >= 2.0.0 package instead. This module will be removed in filepath >= 1.5." #-} ( WindowsString , PosixString diff --git a/changelog.md b/changelog.md index a5bca43..feafae2 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._ +## 1.4.200.0 *Jul 2023* + +* deprecate `OsString` modules + ## 1.4.100.4 *Jul 2023* * Fix isInfixOf and breakSubString in Word16, wrt [#195](https://github.com/haskell/filepath/issues/195) diff --git a/filepath.cabal b/filepath.cabal index c3b7637..a44b206 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: filepath -version: 1.4.100.4 +version: 1.4.200.0 -- NOTE: Don't forget to update ./changelog.md license: BSD-3-Clause -- GitLab