#3659: two-dimensional PArrays in data parallel code
-----------------------------+----------------------------------------------
Reporter:  ams               |          Owner:                  
    Type:  feature request   |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.4            |       Severity:  normal          
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 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 }
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3659>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to