-
Notifications
You must be signed in to change notification settings - Fork 0
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
any basic generators? #23
Comments
Actually I’m realizing now how easy it is to create an iterable using the function* syntax. So maybe there is not much need for unfold, range, init, repeat, and other ways of creating an iterable in your library. |
Wouldn't I think Right now I'm just adding modules as I need them, but I'm open to ideas. I'm taking the .NET Framework and lodash as inspirations. |
No. Unfold is like the inverse of fold. Take an initial state and from that generate a sequence, each time generating a new item to be emitted and the next state. Probably can do that with custom generators. Some good inspiration here too.
https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/collections.seq-module-%5Bfsharp%5D
…________________________________
From: Sean Genabe <[email protected]>
Sent: Tuesday, May 29, 2018 4:35:07 AM
To: seangenabe/starry
Cc: Justin Magaram; Author
Subject: Re: [seangenabe/starry] any basic generators? (#23)
Wouldn't unfold just be equivalent to a map function?
I think init/initInfinite would be covered with a function* generator function, yes.
Right now I'm just adding modules as I need them, but I'm open to ideas. I'm taking the .NET Framework and lodash as inspirations.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#23 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ANecS-fbB6GVLWfqiWfpfa-c8tZlA4jWks5t3TJrgaJpZM4T-Xvm>.
|
Does the library have any basic generators, like "the numbers from 1 to 1000"? This would be a nice addition. Check out F# Seq module. Some basic generators like...
unfold
init
initInfinite
...would go a long way. Here is an unfold implementation...
The text was updated successfully, but these errors were encountered: