Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,394
    • Issues 4,394
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 377
    • Merge Requests 377
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #3659

Closed
Open
Opened Nov 12, 2009 by ams@trac-ams

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
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#3659