-
-
Save liufengyun/4b60710181ad0230d54f25921b291a32 to your computer and use it in GitHub Desktop.
first milestone
This file contains 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
// all elements are `Int`, `N` is the size of the vector | |
trait Vector[N] { | |
def map(f: Int => Int): Vector[N] | |
def pad(x: Int): Vector[x + N] | |
def concat[M](v: Vector[M]): Vector[M + N] | |
def splitAt(i: Int): (Vector[i + 1], Vector[N - i - 1]) | |
def slice(i: Int, j: Int): Vector[j - i + 1] | |
def dot(v: Vector[N]): Int | |
def size: Int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment