Skip to content

Conversation

@gallais
Copy link
Member

@gallais gallais commented Apr 17, 2020

Following Philippe de Rochambeau's request on the mailing list.

------------------------------------------------------------------------
-- Splitting a list

wordsBy : {P : Pred A p} Decidable P List A List (List A)
Copy link
Contributor

Choose a reason for hiding this comment

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

I was just about to merge this in when it occurred to me that this is usually called split rather than wordsBy in most languages right?

@gallais
Copy link
Member Author

gallais commented Apr 26, 2020

There are a lot of different strategies depending on whether you decide to retain
the separator, whether you are happy to split on a List A and not just a single
A, etc. The split package on hackage implements a lot of these strategies.

I think wordsBy is unambiguous: it transparently is a generalisation of words
just like e.g. sortBy is a generalisation of sort in Haskell.

@MatthewDaggitt
Copy link
Contributor

Haha, fair enough 👍

@MatthewDaggitt MatthewDaggitt merged commit 9f454e2 into master Apr 27, 2020
@MatthewDaggitt MatthewDaggitt deleted the words branch April 27, 2020 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants