diff options
author | vlad <vlad@driver.xyz> | 2017-06-13 16:15:07 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-13 16:15:07 -0700 |
commit | 91a4120b4253dc4a1e9552ec39fcb25c303a21e1 (patch) | |
tree | 9173797ed8e3d780f98ac8d0f85507eeb10c8016 /src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala | |
parent | cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c (diff) | |
download | rest-query-d55b202095f733138d5583966984c22e102c08f8.tar.gz rest-query-d55b202095f733138d5583966984c22e102c08f8.tar.bz2 rest-query-d55b202095f733138d5583966984c22e102c08f8.zip |
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala b/src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala index 96fb0c3..d069f86 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/compat/EitherOps.scala @@ -2,10 +2,12 @@ package xyz.driver.pdsuicommon.compat final class EitherOps[A, B](val self: Either[A, B]) extends AnyVal { - def map[B2](f: B => B2): Either[A, B2] = flatMap { x => Right(f(x)) } + def map[B2](f: B => B2): Either[A, B2] = flatMap { x => + Right(f(x)) + } def flatMap[B2](f: B => Either[A, B2]): Either[A, B2] = self match { - case Left(x) => Left(x) + case Left(x) => Left(x) case Right(x) => f(x) } |