Option.map returns another Option, which you clearly don't want if you want something to blow up. Instead of option.map(_ + 1) you'd write option.get + 1
If you require that the Option contains a value then you probably didn't want an Option in the first place but a direct (non-null) value. On Jun 5, 2012 1:25 PM, "Cédric Beust ♔" <[email protected]> wrote: > > On Tue, Jun 5, 2012 at 9:18 AM, Ricky Clarkson <[email protected]> > wrote: > >> Option gives you the same choices > > > How do I get Option to blow up if I try to map on a None? > > -- > Cédric > > > > > -- > You received this message because you are subscribed to the Google Groups > "Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
