Skip to content

Conversation

@andrewthad
Copy link
Contributor

Resolves #106

Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

But actually, perhaps the legit other way to resolve this is to make the original list style code correct by making ByteString an instance of IsList so that OverloadedLists work :-) This would actually be quite easy.

-- reduced values from the left. This function will fuse.
--
-- > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
-- > scanl f z [x1, x2, ...] == pack [z, z `f` x1, (z `f` x1) `f` x2, ...]
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're doing this we'd need to be consistent, so that'd be pack on both lists.

Copy link
Member

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

IMHO this isn't a great improvement – it's easy to see that the list notation represents the bytes of a ByteString. If we apply pack consistently, I believe the increased visual noise would probably make this less readable than the current state.

Regarding @dcoutts' idea of an IsList instance – that seems like a reasonable idea to me, given that the Item type is Word8.

@Bodigrim
Copy link
Contributor

Bodigrim commented Jul 4, 2020

Superseded by #219

@Bodigrim Bodigrim closed this Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad docs for scanl

4 participants