[Haskell-cafe] translate imperative pseudo code into haskell

Joerg Fritsch fritsch at joerg.cc
Fri Aug 9 17:04:16 CEST 2013


I would need some help to get to a reasonable function involving the DB
read, addition and multiplication.

 

for 0 <= i < row dimension of A

         for 0 <= j < column dimension of B

            for 0 <= k < column dimension of A = row dimension of B

               sum += (read A (i,k))* (read B(k,j))

 

 

I started like this but then somehow lost the compass:

 

main = do

           map my.read (map (\(x,y) -> "matrixA:" ++ show row ++ ":" ++ show
column) [ (i, j, k) | i <- [1..50], j <- [1..20], k <- [1..30] ]) 

 

Can you pls help?

 

--Joerg

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130809/fd2527a7/attachment.htm>


More information about the Haskell-Cafe mailing list