-
Notifications
You must be signed in to change notification settings - Fork 95
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
length None = 0 #40
Comments
Interesting. The idea is that option are containers, something like a list that can be either empty or with only one element (actually that was the way I emulated options 15 years ago in other languages). So why does it works here? It works because We can certainly change that behavior, but to me looks good in principle, unless you have a good reason to remove it. Sometime ago there was a suggestion in the F# user voice to make Option<'T> implement IEnumerable<'T> which was declined for technical limitation. |
No need to change that. It was only surprising (not knowing that). maybe this should be document |
Actually, on my free time, I'm working on documenting the library. PS: I think in other languages/libraries (Haskell, Purescript, Idris, Scalaz) it's also a Foldable. |
Hey that looks sweet! |
There was quite a bit of criticism and confusion in the Haskell community around this when they were discussing whether to make Foldable part of the Prelude, notably around tuples. https://mail.haskell.org/pipermail/libraries/2016-February/026805.html Personally I think it's fine. |
@robkuz It would be really, really nice to have some samples either linked or at the foot of each abstraction page. I just updated the docs to the latest version I have. If you want to add more stuff or samples, please do it. If you have questions about how to add things to the docs, please open an Issue with the questions and I will help. Thanks in advance. |
Description
I just realized (via runtime err) that
legth None = 0
.So my question is why is that? It makes sense on the one hand that something none existing is 0 but then ...
The text was updated successfully, but these errors were encountered: