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

Scan documentation is poor #363

Open
Boarders opened this issue Aug 12, 2021 · 3 comments
Open

Scan documentation is poor #363

Boarders opened this issue Aug 12, 2021 · 3 comments

Comments

@Boarders
Copy link

Boarders commented Aug 12, 2021

The documentation for scanl was probably taken straight from Data.List but is a little confusing in the context of Text (I also am not very clear on whether scans make much sense but that is above my pay grade):

-- | /O(n)/ 'scanl' is similar to 'foldl', but returns a list of
-- successive reduced values from the left.
-- Performs replacement on invalid scalar values.
--
-- > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
--
-- Note that
--
-- > last (scanl f z xs) == foldl f z xs.
@Boarders Boarders changed the title Scan documentation is poor. Scan documentation is poor Aug 12, 2021
@Boarders
Copy link
Author

Maybe this is not a problem as it is clearly conceptual, I'm not sure - could be worth adding a comment.

@Bodigrim
Copy link
Contributor

One needs to clarify, whether replacement of invalid scalar values (safe) happens in between of successive applications of f or only afterwards.

@Justbeth22
Copy link

One needs to clarify, whether replacement of invalid scalar values (safe) happens in between of successive applications of f or only afterwards.

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

4 participants