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

Spurious example code in docs #161

Closed
jmackie opened this issue Aug 6, 2018 · 0 comments
Closed

Spurious example code in docs #161

jmackie opened this issue Aug 6, 2018 · 0 comments

Comments

@jmackie
Copy link

jmackie commented Aug 6, 2018

For example: Data.ByteString.split has the type: Word8 -> ByteString -> [ByteString], yet the code examples suggest it takes a Char.

-- > split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
-- > split 'a'  "aXaXaXa"    == ["","X","X","X",""]
-- > split 'x'  "x"          == ["",""]

I suspect this might be deliberate as the samples are instructive, and in the above example not using Char would be much less clear, but nonetheless this could be a source of confusion for newbies. Surely all the documentation code should compile? I'll happily open a PR to integrate doctest for this?

fumieval added a commit to fumieval/bytestring that referenced this issue Jul 4, 2020
fumieval added a commit to fumieval/bytestring that referenced this issue Jul 4, 2020
fumieval added a commit to fumieval/bytestring that referenced this issue Jul 5, 2020
fumieval added a commit to fumieval/bytestring that referenced this issue Jul 7, 2020
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