family
type family Mutable (m :: (Type -> Type) -> Type -> Type) :: (Type -> Type -> Type) -> Type -> Type -> Type:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulematrices-0.5.0Haskell2010
type family Mutable (m :: (Type -> Type) -> Type -> Type) :: (Type -> Type -> Type) -> Type -> Type -> Typeclass (MMatrix (Mutable m) (Mutable v) a, Vector v a) => Matrix (m :: (Type -> Type) -> Type -> Type) (v :: Type -> Type) a wheredim :: m v a -> (Int, Int)unsafeIndex :: m v a -> (Int, Int) -> aunsafeFromVector :: (Int, Int) -> v a -> m v aflatten :: m v a -> v aDefault algorithm is O((m*n) * O(unsafeIndex)).
unsafeTakeRow :: m v a -> Int -> v aExtract a row. Default algorithm is O(n * O(unsafeIndex)).
unsafeTakeColumn :: m v a -> Int -> v aExtract a column. Default algorithm is O(m * O(unsafeIndex)).
takeDiag :: m v a -> v aExtract the diagonal. Default algorithm is O(min(m,n) * O(unsafeIndex)).
thaw :: PrimMonad s => m v a -> s (Mutable m (Mutable v) (PrimState s) a)unsafeThaw :: PrimMonad s => m v a -> s (Mutable m (Mutable v) (PrimState s) a)freeze :: PrimMonad s => Mutable m (Mutable v) (PrimState s) a -> s (m v a)unsafeFreeze :: PrimMonad s => Mutable m (Mutable v) (PrimState s) a -> s (m v a)Derived methods
Return the number of rows
Return the number of columns
Indexing
O(m*n) Create a list by concatenating rows
O(m*n) Create matrix from list of lists, it doesn't check if the list of list is a valid matrix
O(m*n) Matrix construction
O(m*n) Create matrix from rows
Extract a row.
O(m) Return the rows
Extract a row.
O(m*n) Return the columns
O(m*n) List of lists