Re: Option flatten does not use an implicit conversion
Oliver Ruebenacker <[email protected]> Fri, 4 Mar 2016 10:01:42 -0500
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAA=X4OCXMJnUSZ=cZoZjZqJ9p028PEw+61vYLqAnksY4Y2cpmQ@mail.gmail.com> |
Hello,
How would it work with an implicit conversion?
Best, Oliver
On Fri, Mar 4, 2016 at 5:33 AM, Bruno Bieth <[email protected]> wrote:
> I was surprised that Some(Success(1)).flatten does not compile?
> What is the rationale behind this:
>
> def flatten[B](implicit ev: A <:< Option[B]): Option[B] = if (isEmpty)
> None else ev(this.get)
>
> Why not having an implicit conversion: (implicit conv: A => Option[B])?
>
> Bruno
>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Oliver Ruebenacker
Senior Software Engineer, Diabetes Portal
<http://www.type2diabetesgenetics.org/>, Broad Institute
<http://www.broadinstitute.org/>
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.