Last active
June 8, 2018 13:08
-
-
Save kell18/61c85e2e3cef48b340473f6eb8d21a84 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
| trait FromSlice[C] { | |
| def apply(v: C): Int | |
| } | |
| def tupleSlice[T] = new FromSlice[Tuple[T]] { | |
| def apply(v: Tuple[T]): Int = v.size | |
| } | |
| // ... Same for Either and other | |
| tupleSlice(((1, Left), (2, Right)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment