Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
c8bee878
Commit
c8bee878
authored
Mar 03, 2017
by
Peter van 't Hof
Browse files
Remove Either object
parent
bb9a3e4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/implicits/Either.scala
deleted
100644 → 0
View file @
bb9a3e4e
package
nl.lumc.sasc.biopet.utils.implicits
/**
* Created by pjvanthof on 20/02/2017.
*/
object
Either
{
implicit
def
optionEitherLeft
[
T
](
x
:
Option
[
Either
[
T
,
_
]])
:
Option
[
Option
[
T
]]
=
{
x
match
{
case
Some
(
i
:
Either
[
T
,
_
])
if
i
.
isLeft
=>
Some
(
i
.
left
.
toOption
)
case
_
=>
None
}
}
implicit
def
optionEitherRight
[
T
](
x
:
Option
[
Either
[
_
,
T
]])
:
Option
[
Option
[
T
]]
=
{
x
match
{
case
Some
(
i
:
Either
[
_
,
T
])
if
i
.
isRight
=>
Some
(
i
.
right
.
toOption
)
case
_
=>
None
}
}
implicit
def
eitherLeft
[
T
](
x
:
Either
[
T
,
_
])
:
Option
[
T
]
=
{
x
match
{
case
Left
(
x
)
=>
Some
(
x
)
case
_
=>
None
}
}
implicit
def
eitherRight
[
T
](
x
:
Either
[
_
,
T
])
:
Option
[
T
]
=
{
x
match
{
case
Right
(
x
)
=>
Some
(
x
)
case
_
=>
None
}
}
implicit
def
left
[
T
](
x
:
T
)
:
Left
[
T
,
_
]
=
Left
(
x
)
implicit
def
right
[
T
](
x
:
T
)
:
Right
[
_
,
T
]
=
Right
(
x
)
implicit
def
left
[
T
](
x
:
Option
[
T
])
:
Option
[
Left
[
T
,
_
]]
=
x
.
map
(
Left
(
_
))
implicit
def
right
[
T
](
x
:
Option
[
T
])
:
Option
[
Right
[
_
,
T
]]
=
x
.
map
(
Right
(
_
))
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment