two-dimensional PArrays in data parallel code
Hi -- Is it possible to create two-dimensional PArrays? It seems like an expression like
fromList [fromList [1]]
would do it (where fromList is from Data.Array.Parallel.Prelude), but a type class constraint seems not to be matched here:
No instance for (Elt (PArray Int))
arising from a use of `fromList' at Main.hs:8:16-42
Possible fix: add an instance declaration for (Elt (PArray Int))
(Details below.) Are there any other ways?
Thanks -- Adam Shaw
$ cat Main.hs
import Data.Array.Parallel.PArray as P
main :: IO ()
main
= do
let v2D = P.fromList [P.fromList [1::Int]]
print v2D
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.13.20090929
$ ghc -fdph-seq Main.hs
Main.hs:6:16:
No instance for (Elt (PArray Int))
arising from a use of `fromList' at Main.hs:6:16-47
Possible fix: add an instance declaration for (Elt (PArray Int))
In the expression: fromList [fromList [1 :: Int]]
In the definition of `v2D': v2D = fromList [fromList [1 :: Int]]
In the expression:
do { let v2D = fromList ...;
print v2D }
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.4 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |