HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

  • Packagematrices-0.5.0
  • Exports67
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceStorable.hs

Accessors

0 declarations

length information

Indexing

Construction

8 declarations
valuematrix :: Context a => Int -> [a] -> Matrix a
#

O(m*n) Matrix construction

valuefromLists :: Context a => [[a]] -> Matrix a
#

O(m*n) Create matrix from list of lists, it doesn't check if the list of list is a valid matrix

Conversions

14 declarations
valuetoList :: Context a => Matrix a -> [a]
#

O(m*n) Create a list by concatenating rows

valuetoLists :: Context a => Matrix a -> [[a]]
#

O(m*n) List of lists

valuesubMatrix
  1. :: Context a
  2. => (Int, Int)

    upper left corner of the submatrix

  3. -> (Int, Int)

    bottom right corner of the submatrix

  4. -> Matrix a
  5. -> Matrix a
#

O(1) Extract sub matrix

valuediag
  1. :: (Context a, Num a, Foldable t)
  2. => t a

    diagonal

  3. -> Matrix a
#

O(m*n) Create a square matrix with given diagonal, other entries default to 0

valuediagRect
  1. :: (Context a, Foldable t)
  2. => a

    default value

  3. -> (Int, Int)
  4. -> t a

    diagonal

  5. -> Matrix a
#

O(m*n) Create a rectangular matrix with default values and given diagonal

valuefoldl :: Context b => (a -> b -> a) -> a -> Matrix b -> a
#

Mapping

2 declarations

Monadic mapping

6 declarations
valueimapM
  1. :: (Context a, Context b, Monad m)
  2. => (Int, Int) -> a -> m b
  3. -> Matrix a
  4. -> m (Matrix b)
#

O(m*n) Apply the monadic action to every element and its index, yielding a matrix of results.

valueimapM_
  1. :: (Context a, Monad m)
  2. => (Int, Int) -> a -> m b
  3. -> Matrix a
  4. -> m ()
#

O(m*n) Apply the monadic action to every element and its index, ignoring the results.

Zipping

15 declarations

Monadic Zipping

2 declarations

Unzipping

6 declarations

Mutable matrix

5 declarations