Skip to content

Conversation

@Shou
Copy link

@Shou Shou commented Mar 30, 2016

#93

@bgamari
Copy link
Collaborator

bgamari commented Apr 8, 2016

It would be nice if the commit history were a bit cleaner. Why not just fold the last three commits together?

-- This complements @manyTill@ and can be used to find a specific
-- pattern in a text.
--
-- The value returned by @p@ is forced to WHNF.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't believe this is true, is it?

@Shou
Copy link
Author

Shou commented Apr 23, 2016

@bgamari you're right, and skipTill' p wasn't forced to WHNF either. I've removed the comment regarding forcing WHNF in skipTill, and should've fixed skipTill' in this commit.

skipTill' :: (MonadPlus m) => m a -> m b -> m b
skipTill' p end = scan
where scan = end `mplus` (p !*> scan)
(!*>) !a0 a1 = a0 *> a1
Copy link
Collaborator

@bgamari bgamari Jun 30, 2016

Choose a reason for hiding this comment

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

This will force the m a but presumably you wanted to instead force the a, right?

skipTill' p end = scan
where scan = end `mplus` (p !*> scan)
(!*>) !a0 a1 = a0 *> a1
(!*>) a0 a1 = fmap (\(!a) -> a) a0 *> a1
Copy link
Author

Choose a reason for hiding this comment

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

@bgamari This should do it, right?

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