blob: acaef86f2531a6644866e6a23db6b188d125d9e7 (
plain)
1
2
3
4
5
6
7
8
9
10
|
package chisel3
object MetaConnect {
implicit class Connection[A](that: A) {
def makeConnection[B, C](me: B)(implicit f: A => B => C): C = {
f(that)(me)
}
}
implicit def abstractInterfaceConnection[A, B, C](implicit f: A => B => C): AbstractInterface[A] => AbstractInterface[B] => AbstractInterface[C] = (a: AbstractInterface[A]) => (b: AbstractInterface[B]) => new AbstractInterface(f(a.params)(b.params))
}
|