Skip to content

range: unfold a range of values #13

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

Merged
merged 1 commit into from
Dec 10, 2017
Merged

Conversation

matthewleon
Copy link
Contributor

following conversation here: #11

@@ -88,6 +89,11 @@ none = unfoldr (const Nothing) unit
singleton :: forall f a. Unfoldable f => a -> f a
singleton = replicate 1

-- | Create an Unfoldable containing a range of values, with both endpoints.
range :: forall f a. Unfoldable f => Ord a => Semiring a => a -> a -> f a
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little wary that Ord a => Semiring a => ... is a bit too general to be useful, without some laws relating them. Why not just use Int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@paf31
Copy link
Contributor

paf31 commented Dec 10, 2017

Thanks!

@paf31 paf31 merged commit 101ce1c into purescript:master Dec 10, 2017
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.

2 participants