Futhark has no builtin operator or function for multiplying matrices. Indeed, it does not have matrices as a distinct type at all. Instead, matrices are represented simply as two-dimensional arrays of some type that supports multiplication and addition. We can write a function for multiplying integer matrices via the usual
We can also write a polymorphic higher-order function that encapsulates the general pattern:
We can then partially apply
matmul to obtain a matrix multiplication function for a specific type.