Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path comparison operations #2926

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add path comparison operations #2926

wants to merge 4 commits into from

Conversation

harendra-kumar
Copy link
Member

No description provided.

@harendra-kumar harendra-kumar marked this pull request as ready for review January 17, 2025 01:59
@adithyaov adithyaov linked an issue Jan 18, 2025 that may be closed by this pull request
Int -> ((a -> Bool) -> Stream m a -> Stream m (Int, Int))
-> (a -> Bool) -> MutArray a -> m (MutArray a, MutArray a)
revBreakUsing adj indexer predicate arr = do
r <- D.head $ indexer predicate (readRev arr)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be D.last?
Can you add some simple doctests to this?

{-# INLINE breakEndBy #-}
breakEndBy :: (MonadIO m, Unbox a) =>
(a -> Bool) -> MutArray a -> m (MutArray a, MutArray a)
breakEndBy = breakUsing 0 D.indexEndBy
Copy link
Member

Choose a reason for hiding this comment

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

Can you add some simple doctests to break-ish combinators?

Comment on lines +2971 to +2977
len1 = len + adj
arr0 =
if len1 >= arrLen
then empty
else unsafeGetSlice 0 (arrLen - len1) arr
in return (arr0, unsafeGetSlice (arrLen - 1 - i) len arr)
Nothing -> return (arr, empty)
Copy link
Member

Choose a reason for hiding this comment

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

This looks incorrect to me. Can you add doctests to this?


where

getStart cur = do
Copy link
Member

Choose a reason for hiding this comment

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

getStart and getLast can possibly be moved out.
Perhaps indexBy and indexByRev.

-- >>> isValidWin "\\\\??\\x"
-- True
isValid :: (Integral a, Unbox a) => OS -> Array a -> Bool
isValid Posix path
Copy link
Member

Choose a reason for hiding this comment

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

Skimmed through this as you've already written a lot of doctests.

@adithyaov
Copy link
Member

Few comments.
Rest looks good.
Skimmed through functions that have doctests.

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.

Provide an normalization routine for normalizing Path
2 participants