Created
May 7, 2020 19:17
-
-
Save yilinwei/7f092ee60b798fee75fe18e2535f0a4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Example { | |
def failsHorribly[T1 <: Tuple, T2 <: Tuple](f: () => Either[Unit, Tuple.Concat[T1, T2]])(using size: Tuple.Size[T1]): () => Either[Unit, T2] = { | |
() => { | |
f() match { | |
case Left(_) => Left(()) | |
case Right(item) => Right(item.drop(size).asInstanceOf[T2]) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment