Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,610
    • Issues 3,610
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 200
    • Merge Requests 200
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2200

Closed
Open
Opened Apr 06, 2008 by jsnx@trac-jsnx
  • Report abuse
  • New issue
Report abuse New issue

big static random access arrays

These would be unlike StorableArrays because they would be available at compile time, and would be pure values. They would amount to arrays of bytes, of course, but it'd be nice if they could be (Storable a) => StaticArray a and we could walk down them or randomly access them to get the a values out of them. They should be capable of storing hundreds of thousands of Ints.

What are some functions that work on these arrays? We need just one:

indexInto :: (Storable a) => StaticArray a -> Word -> a

Then we can make a Monad to walk up and down the array. It will be some State hybrid. No IO. A bright person could implement static Tries, RoseTrees and other things using this Monad -- storing the offsets mixed in with the data in an unholy mess and skipping forward or backward, leveraging "the world’s most beautiful imperative language."

It's been suggested (SamB) that this should be implemented in Template Haskell.

Important features of this array relative to other arrays and lists in Haskell:

Specificity of Index A machine `Word` since that contains the finest grained pointer. When indexing into a `Storable a`, the index is multiplied by `sizeOf (undefined :: a)`.
Static Nature Exists to facilitate large static constants. The array does not support any append or delete operations, there is no way to change any of its values and it can not be copied.
Trac metadata
Trac field Value
Version 6.8.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC SamB
Operating system Multiple
Architecture Multiple

Related issues

  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
4
Labels
core libraries feature request P::normal Trac import
Assign labels
  • View project labels
Reference: ghc/ghc#2200