-
Notifications
You must be signed in to change notification settings - Fork 67
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
base: master
Are you sure you want to change the base?
Conversation
bc759a1
to
7dd104d
Compare
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Few comments. |
No description provided.