Skip to content

Add safe conversions from ShortByteString - #34

Merged
hasufell merged 2 commits into
haskell:masterfrom
maurges:master
Aug 7, 2025
Merged

Add safe conversions from ShortByteString#34
hasufell merged 2 commits into
haskell:masterfrom
maurges:master

Conversation

@maurges

@maurges maurges commented Aug 6, 2025

Copy link
Copy Markdown

OsString is internally represented as a ShortByteString, however safe conversion functions fromBytes and fromBytestring were only present for ByteStrings; when dealing with ShortByteStrings directly this would require a useless conversion to a bytestring first.

This PR adds the fromShortBytes and fromShortBytestring functions which create an OsString from ShortByteString, possibly throwing an error on incorrect encoding

Comment thread System/OsString/Common.hs
@maurges

maurges commented Aug 6, 2025

Copy link
Copy Markdown
Author

Hm, I somehow doubt that armv7 CI failing is my fault, is it?

@hasufell

hasufell commented Aug 6, 2025

Copy link
Copy Markdown
Member

Hm, I somehow doubt that armv7 CI failing is my fault, is it?

We can ignore armv7. GHC is broken there.

@hasufell
hasufell merged commit 1f01b0e into haskell:master Aug 7, 2025
24 of 26 checks passed
@hasufell

hasufell commented Aug 7, 2025

Copy link
Copy Markdown
Member

https://hackage.haskell.org/package/os-string-2.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants