Skip to content

Instantly share code, notes, and snippets.

@andrevidela
Last active January 7, 2019 14:39
Show Gist options
  • Save andrevidela/36e347fb330b76b5fe41cafa3d42712d to your computer and use it in GitHub Desktop.
Save andrevidela/36e347fb330b76b5fe41cafa3d42712d to your computer and use it in GitHub Desktop.
extension Vector: FancyMult where A: Additive, A: Multiplicative {
typealias FancyVal = A
static func ** (lhs: Vector<A>, rhs: Vector<A>) -> A {
return lhs.fst * rhs.fst + lhs.fst * rhs.fst
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment