- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Option...aly bored
I got big on using Option with Some/Null - I thought it's an awesome idea
when I first saw it...now I'm getting bored however.
Isn't it the same as a checked exception, really? It started to either
require x match { case Some(x) => ... }
everywhere or messes up my interfaces now, when passing stuff around...
I figured this when I found myself using OrElse more often...
-----
Razvan Cojocaru,
Work: http://www.sigma-systems.com
Me: http://feeds.razie.com/RazvanTech
Playground: http://wiki.homecloud.ca










Re: Option...aly bored
AH-HA...my simpleton OO mind didn't comprehend this before... of course, now
it makes sense and yes, it should help.
Tony Morris-4 wrote:
>
> Option is a collection (a list with a maximum of length 1), however, not
> all things with map/flatMap/filter are a collection. Having been trying
> to educate on this matter for quite some time, I have become quite
> aversive to using analogies such as "collections" to describe "things"
> (type constructors) with map/flatMap/filter.
>
-----
Razvan Cojocaru,
Work: http://www.sigma-systems.com
Me: http://feeds.razie.com/RazvanTech
Playground: http://wiki.homecloud.ca
Re: Option...aly bored
2009/12/22 Razvan Cojocaru <razie [at] razie [dot] com>
Sure you do!Option is a collection of size either 0 or 1, you could just as easily use a list and ensure you never put more that one item in.
--
Kevin Wright
mail/google talk: kev [dot] lee [dot] wright [at] googlemail [dot] com
wave: kev [dot] lee [dot] wright [at] googlewave [dot] com
skype: kev.lee.wright
twitter: @thecoda