Hoogle Search
Within LTS Haskell 24.27 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
diagonalList :: Int -> a -> [a] -> Matrix amatrix Data.Matrix Diagonal matrix from a non-empty list given the desired size. Non-diagonal elements will be filled with the given default element. The list must have at least order elements.
diagonalList n 0 [1..] = n 1 ( 1 0 ... 0 0 ) 2 ( 0 2 ... 0 0 ) ( ... ) ( 0 0 ... n-1 0 ) n ( 0 0 ... 0 n )
fromList :: Int -> Int -> [a] -> Matrix amatrix Data.Matrix Create a matrix from a non-empty list given the desired size. The list must have at least rows*cols elements. An example:
( 1 2 3 ) ( 4 5 6 ) fromList 3 3 [1..] = ( 7 8 9 )
fromLists :: [[a]] -> Matrix amatrix Data.Matrix Create a matrix from a non-empty list of non-empty lists. Each list must have at least as many elements as the first list. Examples:
fromLists [ [1,2,3] ( 1 2 3 ) , [4,5,6] ( 4 5 6 ) , [7,8,9] ] = ( 7 8 9 )
fromLists [ [1,2,3 ] ( 1 2 3 ) , [4,5,6,7] ( 4 5 6 ) , [8,9,0 ] ] = ( 8 9 0 )
-
matrix Data.Matrix Get the elements of a matrix stored in a list.
( 1 2 3 ) ( 4 5 6 ) toList ( 7 8 9 ) = [1,2,3,4,5,6,7,8,9]
-
matrix Data.Matrix Get the elements of a matrix stored in a list of lists, where each list contains the elements of a single row.
( 1 2 3 ) [ [1,2,3] ( 4 5 6 ) , [4,5,6] toLists ( 7 8 9 ) = , [7,8,9] ]
data
ToListSym0 (a1 :: TyFun t a [a])singletons-base Data.Foldable.Singletons No documentation available.
type family
ToListSym1 (a6989586621680407280 :: t a) :: [a]singletons-base Data.Foldable.Singletons No documentation available.
-
singletons-base Data.Foldable.Singletons No documentation available.
type family
FromList (a1 :: [a]) :: NonEmpty asingletons-base Data.List.NonEmpty.Singletons No documentation available.
data
FromListSym0 (a1 :: TyFun [a] NonEmpty a)singletons-base Data.List.NonEmpty.Singletons No documentation available.