Matrix chain multiplication: Difference between revisions
m
→{{header|Haskell}}: (minor update to suggested application of hlint, hindent)
(→{{header|Haskell}}: Suggested edit (OP may prefer to revert): applied hlint hindent, specified imports) |
m (→{{header|Haskell}}: (minor update to suggested application of hlint, hindent)) |
||
Line 374:
=={{header|Haskell}}==
<lang Haskell>import Data.
import Data.List (elemIndex)▼
import Data.Char (chr, ord)
mats :: [[Int]]
Line 392:
(a !! i) * (a !! (j + 1)) * (a !! (k + 1))
| k <- [i .. j - 1] ]
| otherwise = (0, -1)
|