-
Notifications
You must be signed in to change notification settings - Fork 1
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
Iterating over finite spaces #29
Comments
Another option might be to do |
Hey, you make a good point about Either way, |
Also, as always, sorry for the slow response. The NeurIPS deadline is coming up thick and fast, but rest assured I will get everything up once that's over. |
As always, no sweat, it's not urgent, I can work around it, and my use cases are not yours. Good luck with the experimenting / writing! |
Hi!
Recently I came to the conclusion that using the FiniteSpace trait in a generic way (when building other traits and abstractions) is quite unwieldy. I think boils down to the
range()
function being at the same time not powerful enough, and quite strict due to the return type of::std::ops::Range
.Range<CustomType>
, making it hard to implementSpace
for a custom type (i.e. an enum).Range<T>
does not implyRange<T>: Iterator<Item = T>
, requiring the need to specify this bound yourself, which is usually quite awkward. E.g.:Range<State<Self>>: Iterator<Item = State<Self>>
. If this is in a trait, it also requires all implementors to copy this. Iterating comfortably over all values in a space seems like quite useful for a finite space.So I would propose doing something like this:
Would you be interested in receiving PR from me applying this change?
The text was updated successfully, but these errors were encountered: