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 to splitWith documentation #560

Open
Boarders opened this issue Dec 2, 2022 · 2 comments
Open

Add to splitWith documentation #560

Boarders opened this issue Dec 2, 2022 · 2 comments

Comments

@Boarders
Copy link
Contributor

Boarders commented Dec 2, 2022

The function Data.ByteString.Char8.splitWith lists the following example:

splitWith (=='a') "aabbaca" == ["","","bb","c",""]

I do not understand what the meaning of the ""."" output is whatsoever. I would be happy to improve these docs if someone can explain what is the intended meaning behind this.

@sjakobi
Copy link
Member

sjakobi commented Dec 2, 2022

Does the relationship with intercalate pointed out in the docs for split help clarify?

intercalate [c] . split c == id
split == splitWith . (==)

It might be useful to repeat the intercalate law in the docs for splitWith.

@Boarders
Copy link
Contributor Author

Boarders commented Dec 2, 2022

I think that exactly clarifies things. I'll add it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants