Skip to content

Commit 3fbefa7

Browse files
committed
Remove newtypes
1 parent de1e6ea commit 3fbefa7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

QSharpMathUtils/src/Matrices/Constructors.qs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ namespace Matrices.Constructors {
22
import Std.Diagnostics.*;
33
import Std.Arrays.*;
44
import Std.Convert.*;
5+
import Std.Math.*;
6+
57
import Matrices.Properties.*;
68
import Matrices.Identity.*;
79
import Matrices.Multiply.*;
810
import Categories.Monoid.*;
9-
10-
newtype Matrix = Double[][];
1111

1212
function MonoidReduceMatrix(n : Int) : (Double[][][] -> Double[][]) {
13+
let mul : Int -> Int -> Int = x -> y -> x * y;
14+
15+
1316
let validate : Double[][] -> Double[][] = M -> IsSquareArray(M) and Shape(M) == (n, n) ? M | fail $"Must be square array with height / width of {n}";
1417
MonoidReduceValidate(IdentityMatrix(n), MatMulD, validate)
1518
}

0 commit comments

Comments
 (0)