Changed Linear.idr to make more use of Data.Matrix