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

More idiomatically F#. :) #143

Merged
merged 2 commits into from
Apr 6, 2014
Merged

More idiomatically F#. :) #143

merged 2 commits into from
Apr 6, 2014

Conversation

rachelblasucci
Copy link
Contributor

I ran into an exception that wasn't being raised from this bit of code the other day, and just noticed this section could be more idiomatic. Thanks!

@lefthandedgoat
Copy link
Owner

Yah, If I remember correctly atleastOneItemWritten was there so that if there are multiple elements for your selector, it tries to write to all of them, and considers it successful if at least one worked.

With exists it will change the behavior to stop after first successful write.

@rachelblasucci
Copy link
Contributor Author

Ahh, okay, I had misunderstood that writeToElement intends to attempt to write to all elements. I could change this to a List.map? My original concern was the use of a ref cell, when atLeastOneItemWritten doesn't need to be mutable. Thanks.

@rachelblasucci
Copy link
Contributor Author

I realized I still needed a List.exists to gather the list of bools at the end to mimic the original atLeastOneItemWritten, but let me know if that works for you all. :) Thanks.

@lefthandedgoat
Copy link
Owner

This works! Thanks! I can do a new build of this is causing you immediate troubles?

lefthandedgoat added a commit that referenced this pull request Apr 6, 2014
@lefthandedgoat lefthandedgoat merged commit d04e488 into lefthandedgoat:master Apr 6, 2014
@rachelblasucci
Copy link
Contributor Author

Nah, no need for an immediate build. But thanks!

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