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,334
    • Issues 4,334
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 369
    • Merge Requests 369
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19050

Closed
Open
Opened Dec 10, 2020 by Sebastian Graf@sgraf812Developer

Refactor Demand lattice so that it has less semantic equalities

Since !4371 (closed), Demand is defined pretty simply as data Demand = Card :* SubDemand. But for absent demands (e.g. when Card is C_00 or C_10), the SubDemand doesn't actually make sense because it describes how the thing is evaluated nestedly, if it is evaluated at all. If the premise is never satisfied, as for absent demands, that information is never useful. We should make use sites aware of that fact, so they pick whatever SubDemand they want for absent demands.

More concretely, this ticket is about assessing whether we can bring back some of the demand structure we had before !4371 (closed) and refactor to:

data Card = C_01 | C_0N | C_11 | C_1N -- NB: C_00 and C_10 are gone!
data Demand = Absent | Bottom | Card :* SubDemand
data SubDemand = Poly Card | Prod [Demand] | Call Demand

Note that Call now takes a Demand instead of a Card and a SubDemand separately. The interpretation of that demand is a little different than those demands inside a product, particularly around plusSubDmd, because call demands are relative, whereas product demands are ... at least in part absolute (cf. #18885). Nevertheless, the analogy is fitting: The demand 1C(A) then says "evaluated once and called with one argument, but not called further". UC(1C(1U) means "evaluted multiple times, but called exactly one with two arguments" and so on.

Let's see whether that works.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#19050