packages feed

os-string 2.0.5 → 2.0.6

raw patch · 3 files changed

+41/−1 lines, 3 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

+ System.OsString.Posix: fromBytestring :: ByteString -> PosixString
+ System.OsString.Windows: fromString :: String -> WindowsString

Files

System/OsString/Common.hs view
@@ -34,7 +34,13 @@   , encodeWith   , encodeFS   , encodeLE+#ifdef WINDOWS+  , fromString+#endif   , fromBytes+#ifndef WINDOWS+  , fromBytestring+#endif   , pstr   , singleton   , empty@@ -289,6 +295,21 @@ encodeLE = fmap PosixString . encodeWithBasePosix' #endif +#ifdef WINDOWS+-- | Like 'encodeLE but not in IO.+--+-- 'encodeLE' was designed to have a symmetric type signature+-- on unix and windows, but morally the function has no IO effects on windows,+-- so we provide this variant without breaking existing API.+--+-- On windows, 'encodeLE' is equivalent to 'encodeFS'.+--+-- This function does not exist on unix.+--+-- @since 2.0.6+fromString :: String -> WindowsString+fromString = unsafePerformIO . fmap WindowsString . encodeWithBaseWindows+#endif  #ifdef WINDOWS_DOC -- | Partial unicode friendly decoding.@@ -403,6 +424,20 @@   in either throwM (const . pure $ ws) $ decodeWith ucs2le ws #else fromBytes = pure . PosixString . BSP.toShort+#endif++#ifndef WINDOWS+-- | Like 'fromBytes', but not in IO.+--+-- 'fromBytes' was designed to have a symmetric type signature+-- on unix and windows, but morally the function has no IO effects on unix,+-- so we provide this variant without breaking existing API.+--+-- This function does not exist on windows.+--+-- @since 2.0.6+fromBytestring :: ByteString -> PosixString+fromBytestring = PosixString . BSP.toShort #endif  
changelog.md view
@@ -1,5 +1,10 @@ # Changelog for [`os-string` package](http://hackage.haskell.org/package/os-string) +## 2.0.6 *Jun 2024*++* add `fromString` on windows+* add `fromBytestring` on unix+ ## 2.0.5 *Jun 2024*  * Add `decodeLE`/`encodeLE` and deprecate `decodeFS`/`encodeFS` (pointing users to `System.OsPath` instead), fixes [#19](https://github.com/haskell/os-string/issues/19)
os-string.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.2 name:               os-string-version:            2.0.5+version:            2.0.6  -- NOTE: Don't forget to update ./changelog.md license:            BSD-3-Clause