Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15996
Closed
Open
Created Dec 05, 2018 by chessai@chessaiDeveloper

Add Unlifted List type to base

data UList (a :: TYPE 'UnliftedRep) where
  UNil :: UList a
  UCons :: a -> UList a -> UList a

This would guarantee that values stored inside the list would not be thunks. It would likely live in something like GHC.List.Unlifted, since it uses GHC-specific things.

An example of something it might improve is the implementation of Control.Concurrent.QSem.QSem:

data QSem = QSem !(MVar (Int, [MVar ()], [MVar ()]))

this could instead be:

type MVarIO = MVar# RealWorld -- type synonym for brevity

data QSem = QSem (MVarIO (Int, UList (MVarIO ()), UList (MVarIO ())))

Note that in this example the tuple inside the outermost MVarIO boxes the Int - this tuple could be represented as a datatype which ensures the unboxing on the Int.

The main idea here though is that now you can use MVar# inside of the UList.

Trac metadata
Trac field Value
Version 8.6.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking