Re: [Haskell-cafe] translate imperative pseudo code into haskell

2013-08-09 Thread Frerich Raabe
On 2013-08-09 17:28, Frerich Raabe wrote: On 2013-08-09 17:04, Joerg Fritsch wrote: 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)) [..] -- This is one

Re: [Haskell-cafe] translate imperative pseudo code into haskell

2013-08-09 Thread Frerich Raabe
(Int, Int) -> Int readValue = undefined -- This is one way to write your pseudo code in Haskell products :: Matrix -> Matrix -> Int products a b = sum $ do i <- [1..rows a] j <- [1..columns b] k <- [1..columns a] return $ readValue a (i, k) * readValue b (k, j)

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Frerich Raabe
... return $ p {c = readFile path} I get error Couldn't match expected type `IOS' with actual type `IO String' which is correct. So, the question is: Is it possible to somehow "cast" 'IO String' to 'IOS' With the change to you

[Haskell-cafe] Projects using Shake

2013-05-30 Thread Frerich Raabe
w Shake is used, but unfortunately I didn't find anything yet. Is anybody aware of open source projects which I could look at, or is there maybe a conventional file extension for… what do you call them, "Shakefiles"? other than .hs which I could google for? -- Freri