Skip to content

Make some Posix/Windows specific APIs portable in Path#3090

Merged
harendra-kumar merged 3 commits intomasterfrom
filepath-fixup
Jul 11, 2025
Merged

Make some Posix/Windows specific APIs portable in Path#3090
harendra-kumar merged 3 commits intomasterfrom
filepath-fixup

Conversation

@harendra-kumar
Copy link
Copy Markdown
Member

No description provided.

@harendra-kumar harendra-kumar marked this pull request as ready for review July 10, 2025 20:16
-- paths (e.g. Apple HFS), it may cause surprising results as the path used by
-- the user may not have the same bytes as later returned by the file system.
newtype OS_PATH = OS_PATH (Array WORD_TYPE)
newtype OS_PATH = OS_PATH (Array OS_WORD_TYPE)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we define a newtype in the Path module? The portable module should not have this right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nvm. This is under else branch.

--
{-# INLINE dropTrailingSeparators #-}
dropTrailingSeparators :: OS_PATH -> OS_PATH
dropTrailingSeparators :: OS_PATH_TYPE -> OS_PATH_TYPE
Copy link
Copy Markdown
Member

@adithyaov adithyaov Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The portable module could have used the definition directly, but it may not be possible to implement that in an easy/clean way.

dropTrailingSeparators :: OS_PATH_TYPE -> OS_PATH_TYPE
dropTrailingSeparators = Streamly.Internal.FileSystem.OS_PATH.dropTrailingSeparators

Copy link
Copy Markdown
Member

@adithyaov adithyaov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Don't think there is a better way to do this.

@harendra-kumar harendra-kumar merged commit 1be8b88 into master Jul 11, 2025
17 of 22 checks passed
@harendra-kumar harendra-kumar deleted the filepath-fixup branch July 12, 2025 23:29
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.

2 participants