Skip to content

Conversation

@Shimuuar
Copy link
Contributor

@Shimuuar Shimuuar commented Feb 2, 2020

Fixes #140

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Implementation looks good, but haddock needs fixing, it still describes the behavior of unfoldrN functions

Data/Vector.hs Outdated

-- | /O(n)/ Construct a vector with at most @n@ elements by repeatedly applying
-- the generator function to a seed. The generator function yields 'Just' the
-- next element and the new seed or 'Nothing' if there are no more elements.
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and other places the doc was copy pasted and needs fixing.

{-# INLINE_FUSED unfoldrExactN #-}
unfoldrExactN n f = unfoldrExactNM n (return . f)

-- | Unfold at most @n@ elements with a monadic functions
Copy link
Contributor

Choose a reason for hiding this comment

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

Should say Unfold exactly @n@ elements ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And I thought I fixed haddock... Thanks! I guess I mixed up copy-paste somewhere

Copy link
Contributor

Choose a reason for hiding this comment

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

The doc is still not right :)

Should say: Unfold exactly @n@ elements with a monadic function

(note function is not plural)

@Shimuuar
Copy link
Contributor Author

Shimuuar commented Feb 3, 2020

I think I fixed haddocks

{-# INLINE unfoldrN #-}
unfoldrN = M.unfoldrN

-- | Unfold at most @n@ elements
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here:

Unfold exactly @n@ elements

@lehins lehins self-requested a review February 16, 2020 18:53
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

LGTM

@lehins lehins force-pushed the kh/unfoldr-exact branch from 8cf8345 to 43d02dd Compare June 7, 2020 09:14
@lehins
Copy link
Contributor

lehins commented Jun 7, 2020

I made a minor adjustment to this PR: lehins@ccc6e50

Once the CI passes it will be good to merge

@lehins lehins merged commit 01f3e2d into haskell:master Jun 7, 2020
@Shimuuar Shimuuar deleted the kh/unfoldr-exact branch June 19, 2020 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add exact size unfoldrN(M)

2 participants