Created
March 30, 2017 00:16
-
-
Save jodersky/faf45eba5fffb2c3a766e88d8db15629 to your computer and use it in GitHub Desktop.
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
object Main extends App { | |
type Succ[A] <: Shape | |
type _0 <: Shape | |
type _1 = Succ[_0] | |
type _2 = Succ[_1] | |
type _3 = Succ[_2] | |
type Shape | |
case class Matrix[M <: Shape, N <: Shape]() | |
def read[M <: Shape, N <: Shape](): Matrix[M, N] = ??? | |
def sum[M <: Shape, N <: Shape](m1: Matrix[M, N], m2: Matrix[M, N]): Matrix[M, N] = ??? | |
def multiply[M <: Shape, N <: Shape, L <: Shape](m1: Matrix[M, N], m2: Matrix[N, L]): Matrix[M, L] = ??? | |
val m1 = Matrix[_1, _2]() | |
val m2 = Matrix[_2, _3]() | |
val m3 = Matrix[_1, _2]() | |
//sum(m1, m2) | |
sum(m1, m3) | |
//multiply(m1, m3) | |
multiply(m1, m2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment